Re: Tomcat migration from T5 to T5.5 mail
Resolved!!! There was a mailapi.jar in the application. Tomcat 5 priorzed his library in front of that one, however, the new Tomcat 5.5 prioriced that aplication library before his lib and it crashed. Is there any place where you can configure that? Thanks a lot for your help! -- View this message in context: http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19878710.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
AlexM3 wrote: Resolved!!! There was a mailapi.jar in the application. Tomcat 5 priorzed his library in front of that one, however, the new Tomcat 5.5 prioriced that aplication library before his lib and it crashed. Is there any place where you can configure that? I am afraid not. It is probably deterministic for each major version but it isn't something you should rely on. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat migration from T5 to T5.5 mail
Hello, I'm migrating a Tomcat Cluster, when I thought everything was working fine, session cluster, balancing,etc, I noticed that the mails were not send by the java aplication. I installed the library mail.jar and activation.jar and configured the web.xml and the context.xml as the Official Tomcat notes say. The aplication has not changed and can't change, and it works perfect in the old installed Tomcat 5. The error that I get when the application tries to send the mail is: javax.mail.NoSuchProviderException: smtp at javax.mail.Session.getService(Session.java:760) at javax.mail.Session.getTransport(Session.java:685) at javax.mail.Session.getTransport(Session.java:628) ... # More errors lije that I have read in some forums that the problem could be that Tomcat is loading that libraries 2 times. I have checked everything and the only folder they are is $CATALINA_HOME/common/lib and they're not in any other place like $CATALINA_HOME/shared/lib or $CATALINA_HOME/webapps/myapplication/* Anyone has any idea why I have this error? Thank you very much -- View this message in context: http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19739822.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
I've written this step by step recipe, tested with my tomcat 5.5. You could follow up these instructions and mail sending should work. http://haveacafe.wordpress.com/2008/09/26/113/ Otherwise, can you post your context.xml ? Btw, according SUN's informations, activation.jar is part of the jdk 6, so if you have a recent java version, you don't need it anymore (tomcat doc should be updated). javax.mail.NoSuchProviderException: smtp at javax.mail.Session.getService(Session.java:760) It doesn't sound like having double library. Are you sure your smtp mail server is correctly configured ? (test it whith a commadline using sendmail or whatever). -- Albrecht ANDRZEJEWSKI Créateur - Incubateur Technologique SITE-EERIE - Parc scientifique G. Besse *** http://haveacafe.wordpress.com/ Ce message a ete envoye par le serveur IMP de l'EMA. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
AlexM3 wrote: Hello, I'm migrating a Tomcat Cluster, when I thought everything was working fine, session cluster, balancing,etc, I noticed that the mails were not send by the java aplication. I installed the library mail.jar and activation.jar and configured the web.xml and the context.xml as the Official Tomcat notes say. The aplication has not changed and can't change, and it works perfect in the old installed Tomcat 5. The error that I get when the application tries to send the mail is: javax.mail.NoSuchProviderException: smtp at javax.mail.Session.getService(Session.java:760) at javax.mail.Session.getTransport(Session.java:685) at javax.mail.Session.getTransport(Session.java:628) ... # More errors lije that I have read in some forums that the problem could be that Tomcat is loading that libraries 2 times. I have checked everything and the only folder they are is $CATALINA_HOME/common/lib and they're not in any other place like $CATALINA_HOME/shared/lib or $CATALINA_HOME/webapps/myapplication/* Anyone has any idea why I have this error? The configuration of resources changed significantly between 5.0.x and 5.5.x. Are you using the 5.5.x version? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
Hello, Firt of all thanks for your fast answer. - My Java versión is jdk1.5.0_06, it's the same that is using the old Tomcat 5 and it works. Anyway I've tried to remove aplication.jar and an error asks for him. - I've tested my linux system mail function and it works, the aplication deployed in Tomcat 5 works too. - My context.xml is: ?xml version=1.0 encoding=UTF-8? !-- The contents of this file will be loaded for each web application -- Context Resource name=mail/Session auth=Container type=javax.mail.Session mail.smtp.host=localhost/ /Context - What i've done to configure the mail is the same as your guide Albretch says: 1. Copy mail.jar and activation.jar to $CATALINA_HOME/common/lib 2. Edit context.xml and add the ressource mail/Session: Resource name=mail/Session auth=Container type=javax.mail.Session mail.smtp.host=localhost/ 3. Edit web.xml and add the resource-ref: resource-ref description Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. /description res-ref-name mail/Session /res-ref-name res-type javax.mail.Session /res-type res-auth Container /res-auth /resource-ref 4. The code is written and tested. Any idea? -- View this message in context: http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19740598.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
AlexM3 wrote: Hello, Firt of all thanks for your fast answer. - My Java versión is jdk1.5.0_06, it's the same that is using the old Tomcat 5 and it works. Anyway I've tried to remove aplication.jar and an error asks for him. You'll need that file, it is only included in 1.6 JDKs Any idea? Your configuration all looks good. Which version of Tomcat are you running? Are you sure there isn't another copy of mail.jar hanging around? What happens if you remove the one you are using? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
Any idea? Your configuration all looks good. Which version of Tomcat are you running? Are you sure there isn't another copy of mail.jar hanging around? What happens if you remove the one you are using? Mark It sounds right, Mark. Although i have said that it wasn't double mail.jar error, it could be that. I experienced putting twice the mail.jar in the server commoon lib and in the webapp libs, and it gives a class cast exception. But having more than one mail library available for mail package can produce this NoSuchProviderException:smtp so. http://forums.sun.com/thread.jspa?messageID=4111277 http://confluence.atlassian.com/display/DOC/Cannot+send+email+due+to+'javax.mail.NoSuchProviderException'+SMTP+error Check also for commons-email-1.0.jar... -- Albrecht ANDRZEJEWSKI Créateur - Incubateur Technologique SITE-EERIE - Parc scientifique G. Besse 30035 Nîmes Cedex 1 - France -- http://haveacafe.wordpress.com Ce message a ete envoye par le serveur IMP de l'EMA. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
Hello, Here is the result of a find in the tomcat5.5 directory # find /usr/local/tomcat5.5_svh/ -name *mail* /usr/local/tomcat5.5_svh/common/lib/mail.jar # Is there any path that Tomcat could be loading? If I move mail.jar out of $CATALINA_HOME it says the same: javax.mail.NoSuchProviderException: No provider for smtp at javax.mail.Session.getProvider(Session.java:433) at javax.mail.Session.getTransport(Session.java:627) ... If I move mail.jar out of $CATALINA_HOME it says: javax.servlet.ServletException: javax/activation/DataSource org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) ... -- View this message in context: http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19743187.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
Sorry the second error was obviosly without activation.jar, no mail.jar again. AlexM3 wrote: Hello, Here is the result of a find in the tomcat5.5 directory # find /usr/local/tomcat5.5_svh/ -name *mail* /usr/local/tomcat5.5_svh/common/lib/mail.jar # Is there any path that Tomcat could be loading? If I move mail.jar out of $CATALINA_HOME it says the same: javax.mail.NoSuchProviderException: No provider for smtp at javax.mail.Session.getProvider(Session.java:433) at javax.mail.Session.getTransport(Session.java:627) ... If I move mail.jar out of $CATALINA_HOME it says: javax.servlet.ServletException: javax/activation/DataSource org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) ... -- View this message in context: http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19744101.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
- Original Message - From: AlexM3 [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, September 30, 2008 12:53 PM Subject: Tomcat migration from T5 to T5.5 mail Hello, I'm migrating a Tomcat Cluster, when I thought everything was working fine, session cluster, balancing,etc, I noticed that the mails were not send by the java aplication. I installed the library mail.jar and activation.jar and configured the web.xml and the context.xml as the Official Tomcat notes say. The aplication has not changed and can't change, and it works perfect in the old installed Tomcat 5. The error that I get when the application tries to send the mail is: javax.mail.NoSuchProviderException: smtp at javax.mail.Session.getService(Session.java:760) at javax.mail.Session.getTransport(Session.java:685) at javax.mail.Session.getTransport(Session.java:628) ... # More errors lije that I have read in some forums that the problem could be that Tomcat is loading that libraries 2 times. I have checked everything and the only folder they are is $CATALINA_HOME/common/lib and they're not in any other place like $CATALINA_HOME/shared/lib or $CATALINA_HOME/webapps/myapplication/* Anyone has any idea why I have this error? Thank you very much Hi Alex, dont know but I think you should go get the new activation and mail jars and try them... just a hunch that if all else is the same, the libs are now old... Those Provider classes are properties inside mail.jar... maybe they have changed... dont know, but worth a try... Just for Info I dont use the JNDI and have no problems on any JRE or any Tomcat... so if you get really desperado I dump the Mail and Act jars into the web app... and getting a session looks like this... try{ java.util.Properties properties = System.getProperties(); properties.put(mail.smtp.host, smtpHost); session = Session.getInstance(properties,null); } catch(Exception e) { //Oops } It seems not to care if Sun changes its mind... Have Fun --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
Quoting AlexM3 [EMAIL PROTECTED]: Hello, Here is the result of a find in the tomcat5.5 directory # find /usr/local/tomcat5.5_svh/ -name *mail* /usr/local/tomcat5.5_svh/common/lib/mail.jar # Is there any path that Tomcat could be loading? Check for smtp.jar too (i don't know if you use it). Other path are your own classpath and environment variable such as PATH, etc... tomcat startup is echoing the path looked at when you call startup.sh. If I move mail.jar out of $CATALINA_HOME it says the same: javax.mail.NoSuchProviderException: No provider for smtp at javax.mail.Session.getProvider(Session.java:433) at javax.mail.Session.getTransport(Session.java:627) ... You said : It works before, and code has and won't be changed, but are you trying using the same javamail API version as in you previous working configuration ? Moreover,i suggest you to call session.setDebug(true) on you session object, so that you will have more verbose debugging output! You wil be able to trace mail.jar initialisation. ref: http://java.sun.com/products/javamail/FAQ.html#debug -- Albrecht ANDRZEJEWSKI Créateur - Incubateur Technologique SITE-EERIE - Parc scientifique G. Besse 30035 Nîmes Cedex 1 - France -- http://haveacafe.wordpress.com Ce message a ete envoye par le serveur IMP de l'EMA. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat migration from T5 to T5.5 mail
Hi, Just a thought, but you might want to check the permissions on the jar files. I've gotten errors like that when I lacked permission to read. Regards, Dave On Sep 30, 2008, at 6:54 AM, AlexM3 wrote: Hello, Firt of all thanks for your fast answer. - My Java versión is jdk1.5.0_06, it's the same that is using the old Tomcat 5 and it works. Anyway I've tried to remove aplication.jar and an error asks for him. - I've tested my linux system mail function and it works, the aplication deployed in Tomcat 5 works too. - My context.xml is: ?xml version=1.0 encoding=UTF-8? !-- The contents of this file will be loaded for each web application -- Context Resource name=mail/Session auth=Container type=javax.mail.Session mail.smtp.host=localhost/ /Context - What i've done to configure the mail is the same as your guide Albretch says: 1. Copy mail.jar and activation.jar to $CATALINA_HOME/common/lib 2. Edit context.xml and add the ressource mail/Session: Resource name=mail/Session auth=Container type=javax.mail.Session mail.smtp.host=localhost/ 3. Edit web.xml and add the resource-ref: resource-ref description Resource reference to a factory for javax.mail.Session instances that may be used for sending electronic mail messages, preconfigured to connect to the appropriate SMTP server. /description res-ref-name mail/Session /res-ref-name res-type javax.mail.Session /res-type res-auth Container /res-auth /resource-ref 4. The code is written and tested. Any idea? -- View this message in context: http://www.nabble.com/Tomcat-migration-from-T5-to-T5.5-mail-tp19739822p19740598.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]