So this could be a fun question. I installed tomcat5 on centos 5.5 x64, and am able to get it up and running and whatnot. My issue is that one of the webapps needs to use javamail, however in the catalina log i get the error:
(+ several hundred lines of completely meaningful "stacktrace" that we all know and love...)
Now I've read in many places that this means smtp.jar is not in my classpath - but im not sure about how to make sure this is the case. In catalina log I get the notice:
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-188.8.131.52.x86_64/jre/lib/amd64/server: /usr/lib/jvm/java-1.6.0-openjdk-184.108.40.206.x86_64/jre/lib/amd64: /usr/lib/jvm/java-1.6.0-openjdk-220.127.116.11.x86_64/jre/../lib/amd64: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
(I added newlines so you could read it). 1. Is this my classpath? I can probably answer this and say no its not this is the java library path.
So I am able to find some directory called:
imap-1.3.1.jar mail-1.3.1-api.jar mailapi.jar pop3-1.3.1.jar smtp-1.3.1.jar imap.jar mail-1.3.1-providers-1.1.1.jar nntp-1.3.1.jar pop3.jar smtp.jar mail-1.3.1-api-1.1.1.jar mail-1.3.1-providers.jar nntp.jar providers.jar
This looks like what I want... Additionally, in $CATALINA_HOME/common/lib I have the following entry:
[javamail].jar -> /usr/share/java/javamail.jar
Which leads me to believe that I have javamail, and the path is set up correctly, except somehow this javamail is not compatible with openjdk1.6 (installed by default for tomcat5). I've noticed javamail isn't mentioned in the list of files given by rpm -ql openjdk1.6. aslo this is my alternatives config:
alternatives --config java There are 3 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java 3 /opt/jre1.6.0_22/bin/java
(ignore /opt/jre1.6.0_22/bin/java it was a failed attempt that I will be deleting-it was completely isolated from other installs). I feel like the gcc and openjdk javas are conflicting, can I safely remove one?
So finally, given this information is:
- My suspicion that /usr/share/java/javamail.jar is not compatible with openjdk1.6 correct
- If not 1 then where can I look next (maybe the enabling dbg logs?)
- If 1 then what should I use as an alternative, and can someone show a page that will make tomcat5 like the new version (i.e. correctly use it)?
So it looks kind of like I have javamail, im just not sure if its the right version (well tomcat5 certainly doesn't like it).
Also I'm running identical code that I had up running on ubuntu (which I had configured with Sun jdk) and everything worked great there, so this is not an implementation error, just configuration error.