-
1. Re: Sending e-mails with mail tasks
kukeltje Oct 15, 2009 1:46 PM (in response to sebastian.s)does tomcat contain mail.jar etc...? or maybe tomcat does not support the (JEE) mail session... just guessing here.
-
2. Re: Sending e-mails with mail tasks
sebastian.s Oct 15, 2009 2:32 PM (in response to sebastian.s)I am going to verify tomorrow but actually it should work because this is the Tomcat demo setup supplied with the distribution, or not?
I think it is a javax.mail or Tomcat issue. How do I get javax.mail to be a bit more verbose? Searching with Google showed up people having the same problem but most of them could see a cause for the exception. -
3. Re: Sending e-mails with mail tasks
kukeltje Oct 15, 2009 3:03 PM (in response to sebastian.s)Not sure how much was tested on Tomcat. Jobscheduler probably was, just like the core, but not sure if mail was included. I'd hope so, but it just might have been forgotten.
I have no idea how to get javax.mail more verbose. Maybe running it in a debug mode (e.g. from eclipse) might help. -
4. Re: Sending e-mails with mail tasks
sebastian.s Oct 15, 2009 3:24 PM (in response to sebastian.s)Afaik Joram has done the integration work for Tomcat, right? Maybe I am lucky and he is going to give a statement on this. :) I searched around with Google and there are different proposals what to do. I am going to try some more things tomorrow and I'll keep you up to date here.
-
5. Re: Sending e-mails with mail tasks
sebastian.s Oct 16, 2009 3:41 AM (in response to sebastian.s)Good morning,
I was out of luck and I did not find a solution. According to my Google search the exception javax.mailNoSuchProviderException: smtp can be thrown in a various cases:
* There is no mail.jar on the classpath or no smtp.jar. But this is not the case because mail.jar is on the classpath. Furthermore according to the javamail documentation mail.jar includes smtp.jar normally and you either use mail.jar packed with all the stuff needed or single jars like mailapi.jar and smtp.jar.
* There are several copies of the files described above in the classpath and they are of different versions. But I could not find more than one mail.jar.
To verify there are no problems with the jars and Tomcat I created a web application which just sends out an email using javamail and I deployed it to the server. This worked without a problem.
I don't know jBPM sends e-mails from mail tasks. The javamail tutorial looks up a JavaMail Session via JDNI. For my test I just used Session.getDefaultInstance(). So maybe it is something related with this?
Any hints?
I think I am going to report this as a bug or not, Ronald? -
6. Re: Sending e-mails with mail tasks
sebastian.s Oct 16, 2009 4:52 AM (in response to sebastian.s)I tried to find a work-around for this and decided to send mails directly in a java task using javamail. I used the same code as in the web application mentioned above and I got the same exception which shows up when trying to use mail tasks. So I suppose it's a classpath issue. But which one exactly?
-
7. Re: Sending e-mails with mail tasks
kukeltje Oct 16, 2009 6:55 AM (in response to sebastian.s)there is a mail properties file as well afaik, not sure if that plays a role as well here.
-
8. Re: Sending e-mails with mail tasks
sebastian.s Oct 16, 2009 7:17 AM (in response to sebastian.s)Yes, I am aware of it and it looks like this. In build.xml you can specify the property mail.smtp.host and it is taken into account. Manually I also changed mail.from. As I said this works fine in a unit test with the same jbpm.mail.properties used.
mail.smtp.host=your.mail.host mail.smtp.port=25 mail.from=noreply@jbpm.org