Details: Tomcat 5.0.19 OS: Solaris 2.8 (with the latest J2SEE OS patches) Apache: 2.0.48 Java: (build 1.4.2_03-b02, mixed mode)
My error message says this (in a small part): org.apache.jasper.JasperException: Unable to compile class for JSP
This is when I try to run the jsp2 example JSP Configuration. I can find the class file here:
/usr/local/jakarta-tomcat-5.0.19/webapps/jsp-examples/WEB-INF/classes/org/apache/jsp/jsp2/misc/config_jsp.class
This same error is occurring when I try to run our app which worked under Tomcat 4.
And even though someone here said NOT to copy over the $JAVA_HOME/lib/tools.jar into the common/lib for tomcat -- I did as per the error message. Then stopped and started tomcat. I continue to get the same error.
It's been my experience with other UNIX apps that when an app is called for and can not be found I have a PATH problem. So I added to the tomcat start-up script the following ENV VARS:
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar
export CLASSPATH
PATH=\ /usr/java/bin:/usr/local/bin:\ /usr/sbin:/usr/bin:/usr/local/tomcat/bin:\ /usr/local/mysql/bin:/usr/ccs/bin: export PATH
Then I added to the catalina.sh the following: echo "Using CLASSPATH: $CLASSPATH" echo "Using PATH: $PATH"
And to the setclasspath.sh
#CLASSPATH="$JAVA_HOME"/lib/tools.jar <-- commented this out to keep the classpath I set in the startup script.
echo "Using CLASSPATH in setclasspath.sh: $CLASSPATH"
Started and stopped tomcat & I see this:
Using CLASSPATH in setclasspath.sh: /usr/java/lib/tools.jar:/usr/local/tomcat/bin/commons-daemon.jar:/usr/local/tomcat/bin/bootstrap.jar
Using CATALINA_BASE: /usr/local/jakarta-tomcat-5.0.19
Using CATALINA_HOME: /usr/local/jakarta-tomcat-5.0.19
Using CATALINA_TMPDIR: /usr/local/jakarta-tomcat-5.0.19/temp
Using JAVA_HOME: /usr/java
Using CLASSPATH: /usr/java/lib/tools.jar:/usr/local/tomcat/bin/commons-daemon.jar:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.19/bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.19/bin/commons-logging-api.jar
Using PATH: /usr/java/bin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/tomcat/bin:/usr/local/mysql/bin:/usr/ccs/bin:
It looks like the $JAVA_HOME/bin directory is being accessed. So, do I have the wrong java installed?
I've been here: http://www.coreservlets.com/Apache-Tomcat-Tutorial/ and tried the suggestions.
When I goggle the only reoccurring answer is that the jdk version & tomcat version are not compatible. True? I thought Tomcat 5 needed this version of jdk?
Suggestions?
thanks, erin
At 10:10 AM 3/18/2004 -0800, Erin O'Neill wrote:
Hello all -
I'm new to setting up a tomcat server. I was asked to install tomcat 5. I can get a stand alone tomcat server up and running but some of the examples fail. Particulars of my system:
Tomcat/5.0.18 (I've got t.0.19 running??) Apache/2.0.48 JVM version: 1.4.2_03-b02 Solaris 2.8
I use a shell script to start up tomcat. The env vars are: CATALINA_HOME=/usr/local/tomcat;export CATALINA_HOME JAVA_HOME=/usr/j2se;export JAVA_HOME
(I also tried setting JAVA_HOME to point to the symlink /usr/java which points to /usr/j2se but it gave me the same error).
(on tomcat-users it was recommended to add the CLASSPATH) CLASSPATH=\ $JAVA_HOME/lib/tools.jar:\ $DAEMON_HOME/commons-daemon.jar:\ $CATALINA_HOME/bin/bootstrap.jar export CLASSPATH
I added a PATH PATH=\ /usr/java/bin:/usr/local/bin:\ /usr/sbin:/usr/bin:/usr/local/tomcat/bin:\ /usr/local/mysql/bin:/usr/ccs/bin: export PATH
The error message is:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception org.apache.jasper.JasperException: Unable to compile class for JSP
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415) org.apache.jasper.compiler.Compiler.compile(Compiler.java:458) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
In the catalina.out log I see this error: Mar 18, 2004 9:58:46 AM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK
BUT the javac compiler is in the CLASSPATH AND the PATH?? Do I need to set this up elsewhere? JAVA_HOME is also set up??
I know this is something simple, but for some reason I can see it.
thanks, erin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
