John Doe wrote:
Hello list,

I have a strange classloading problem, that only occurs when my webapp is
deployed by tomcat (aka when tomcat expands the .war file during startup).

I'm using Tomcat 8, Java 8 and a few old Axis webservices.

The very first call to the webservice now fails with a RuntimeException
that is thrown by the axis code. The error message is "No compiler found in
your classpath!  (you may need to add 'tools.jar')".

Strangely all following calls to the webservice work without error (so
tools.jar is there after all). Even after a server restart, it still works.

However, if I stop tomcat, delete the expanded directory of the webapp in
the 'deploy' dir and restart Tomcat, the very first call fails again.


I tried adding tolls.jar explicitly to the classpath in all ways that are
described in the tomcat documentation, and it did not change a thing.

I tried to force Tomcat to run with a JDK instead of a JRE, but that did
not help either.

Another lead to follow is, that it worked with java 7. Also Axis itself may
be the source of the problem, so im working in that direction too.


Now, with the help of this list im trying to follow the other 2 leads I
have:

1. Why is there a difference in classloading when tomcat deploys a webapp
on startup that is already expanded compared to the case that there is only
a .war found? Or maybe more to the point: what does tomcat do differently
in those 2 usecases?

2. When running tomcat with a JDK, it still puts this into the logfile:

Server version: Apache Tomcat/8.0.15
Server built: Nov 2 2014 19:25:20 UTC
Server number: 8.0.15.0
OS Name: Windows Server 2008 R2
OS Version: 6.1
Architecture: x86
JAVA_HOME: *C:\Dev\Java\jdk1.8.0_25\jre*
JVM Version: 1.8.0_25-b18
JVM Vendor: Oracle Corporation

so its still running with a JRE. Any way to get it to use the JDK?


I believe that this last question cannot really be answered, because it is a bit besides the point. Let me put this in not very java-technical terms (the only ones I can provide) : Everything which Tomcat needs in order to run itself and run web applications is in the JRE. The additional stuff in the JDK, are things needed by Java developers (and support people). Therefore, there is no /need/ for Tomcat to access any of this JDK-specific stuff, and it doesn't. If you install a JDK, Tomcat will happily use the JRE which is contained in the JDK, instead of just a stand-alone JRE, but that's it.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to