cancel
Showing results for 
Search instead for 
Did you mean: 

commons email validate-problem

0 Kudos

hi,

i'm getting a strange error while executing a webservice-method using the webservice-navigator.

javax.mail.internet.InternetAddress.validate()V

gets thrown... but i dont know why.

here's my code-snippet:

		try {
			SimpleEmail email = new SimpleEmail();
			email.setHostName("some.mail.host");
			email.addTo("<emailaddress>");
			email.setFrom("<emailaddress>");
			email.setSubject("Test message");
			email.setMsg("This is a simple test of commons-email");
			email.send();
		} catch (Exception e) {
			LOG.debugT(e.getMessage());
		}

these are just emails for this forum, i use real emails while testing. but i dont know why the webservice-manager catches the exception and not my try&catch block... and i dont even know why an exception gets even thrown.

i used the newest activation.jar and mail.jar from sun and the newest commons-email as a used dc in my project.

if i try that locally withing my java eclipse, everything works fine, but not on the netweaver...

any suggestions?

Edited by: Constantin Wildförster on Oct 20, 2009 11:26 AM

Edited by: Constantin Wildförster on Oct 20, 2009 11:26 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Constantin.

Could you print the stack trace of the exception and the text of the exception if there is such, because "javax.mail.internet.InternetAddress.validate() V" is not an exception.

Probably that's where the exception is thrown, but without the stack trace and the exception is only guessing.

Thanks,

Ventsi

0 Kudos

hi ventsi,

the problem is.. i cant get a stacktrace. my try and catch doesnt catch an exception and even in the logs.. theres nothing..

i did a workaround, i downloaded the commons-email sources and commented out the address.validate() call, now its working. i sure check the emailaddresses even before invoking the commons-email stuff.

Former Member
0 Kudos

Hello Constantin,

I think the problem is that you are catching the exception and then logging it with severity DEBUG.

By default the DEBUG messages are not recorded in the trace files unless you have changed that.

Change debugT to errorT and most likely the exception will be recorded.

You should also add e.printStackTrace() to errorT.

Please refer to the Logging and Tracing documentation for more information:

http://help.sap.com/saphelp_nw04/helpdata/EN/a2/15ab41d60bcb46e10000000a155106/frameset.htm

Regards,

Ventsi Tsachev

Technology Development Support (J2EE Engine)

SAP Labs, Palo Alto, Ca (USA)