You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by George McKInney <ge...@tantalus.com> on 2001/04/04 00:42:18 UTC

.java being taken for a .jsp ???

We have several environments on different machines, all of which use the
same codebase and build files (pointing to separate Tomcat installations).
One of these is NT, two are Solaris.

On one of the Solaris systems, we get the error below, which appears to
suggest that ErrorLog.java is being taken to be a .jsp to be compiled.
ErrorLog.java is actually a file generated by Oracle's jPublisher tool (via
sqlj). It has in fact been compiled and the .class file is where I expect it
to be. The .class files on both Solaris machines are the same length. All
three machines are using the same set of .jar files.

Any ideas about what might be happening?


Error: 500
Location: /snv/jsp/Account/SNV_cRegisterAccount.jsp
Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSP/u02/apache-tomcat/jakarta-tomcat/webapps/snv/WEB-INF/classes/com/snv/jpu
b/ErrorLog.java:15: Class com.snv.jpub.ErrorLog already defined in
ErrorLog.java.
public class ErrorLog implements CustomDatum, CustomDatumFactory
             ^
1 error

	at java.lang.Throwable.fillInStackTrace(Native Method)
	at java.lang.Throwable.fillInStackTrace(Compiled Code)
	at java.lang.Throwable.(Compiled Code)
	at java.lang.Exception.(Compiled Code)
	at javax.servlet.ServletException.(ServletException.java:107)
	at org.apache.jasper.JasperException.(JasperException.java:73)
	at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
	at org.apache.jasper.runtime.JspServlet.loadJSP(Compiled Code)
	at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(Compi
led Code)
	at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(Compiled
Code)
	at org.apache.jasper.runtime.JspServlet.serviceJspFile(Compiled Code)
	at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
	at javax.servlet.http.HttpServlet.service(Compiled Code)
	at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
	at org.apache.tomcat.core.ContextManager.service(Compiled Code)
	at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Compiled Code)
	at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
	at java.lang.Thread.run(Compiled Code)

Thanks,


George McKinney, Developer
Tantalus Communications Inc.
500-1122 Mainland Street
Vancouver, BC, Canada V6B 5L1
george@tantalus.com

Direct  604.726.6753
Main    604.609.0700
Fax     604.609.0705

"The Oracle Experts"
www.tantalus.com


RE: .java being taken for a .jsp ??? - Thanks!

Posted by George McKInney <ge...@tantalus.com>.
Matt,
> It doesn't sound like Tomcat is mistaking your Java file for a jsp. It
> actually looks like it's trying to recompile a file inside of
> your one of
> your jars, which is pretty weird.
>
Thanks. Your comment put me on (what appears to be ) the right track.

There are some .java files in the WEB-INF/classes/com/snv/jpub/*

These are (oops :-) copied over from the place they are generated as part of
the rather baroque jpub/sqlj build process.

I'm really not sure WHY Tomcat tries to compile the .java when there is a
perfectly good .class file sitting in the same directory, but it could be
that the timestamp sequence is altered when the files are copied. Usually,
the .java would be older than the .class, but it might be that the .class
file got copied first and the .java later (by a millisecond or two). That
still doesn't explain why the problem only shows up on one machine.

The only cases where I have seen this being a problem is where one of these
classes is referred to by a .jsp - many other classes use them without
problems, but then, they aren't trying to compile stuff on the fly.

I've just made sure that the .java files don't end up in WEB-INF/classes,
and the problem hasn't shown up.

Thanks again,

George McKinney, Developer
Tantalus Communications Inc.
500-1122 Mainland Street
Vancouver, BC, Canada V6B 5L1
george@tantalus.com

Direct  604.726.6753
Main    604.609.0700
Fax     604.609.0705

"The Oracle Experts"
www.tantalus.com



Re: .java being taken for a .jsp ???

Posted by Matt Youell <ma...@siliconspike.com>.
George,

It doesn't sound like Tomcat is mistaking your Java file for a jsp. It
actually looks like it's trying to recompile a file inside of your one of
your jars, which is pretty weird.

Sounds more like an situation where you've got multiple copies of the same
class in your classpath. Is the classpath identical on both machines? And
are there any errant copies of ErrorLog.java or the Oracle jar lying around
on that system?


__________________________________________________
Matt Youell    "Think different - just like everyone else."



----- Original Message -----
From: "George McKInney" <ge...@tantalus.com>
To: "'tomcat user list'" <to...@jakarta.apache.org>
Sent: Tuesday, April 03, 2001 3:42 PM
Subject: .java being taken for a .jsp ???


> We have several environments on different machines, all of which use the
> same codebase and build files (pointing to separate Tomcat installations).
> One of these is NT, two are Solaris.
>
> On one of the Solaris systems, we get the error below, which appears to
> suggest that ErrorLog.java is being taken to be a .jsp to be compiled.
> ErrorLog.java is actually a file generated by Oracle's jPublisher tool
(via
> sqlj). It has in fact been compiled and the .class file is where I expect
it
> to be. The .class files on both Solaris machines are the same length. All
> three machines are using the same set of .jar files.
>
> Any ideas about what might be happening?
>
>
> Error: 500
> Location: /snv/jsp/Account/SNV_cRegisterAccount.jsp
> Internal Servlet Error:
>
> org.apache.jasper.JasperException: Unable to compile class for
>
JSP/u02/apache-tomcat/jakarta-tomcat/webapps/snv/WEB-INF/classes/com/snv/jpu
> b/ErrorLog.java:15: Class com.snv.jpub.ErrorLog already defined in
> ErrorLog.java.
> public class ErrorLog implements CustomDatum, CustomDatumFactory
>              ^
> 1 error
>
> at java.lang.Throwable.fillInStackTrace(Native Method)
> at java.lang.Throwable.fillInStackTrace(Compiled Code)
> at java.lang.Throwable.(Compiled Code)
> at java.lang.Exception.(Compiled Code)
> at javax.servlet.ServletException.(ServletException.java:107)
> at org.apache.jasper.JasperException.(JasperException.java:73)
> at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
> at org.apache.jasper.runtime.JspServlet.loadJSP(Compiled Code)
> at
>
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(Compi
> led Code)
> at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(Compiled
> Code)
> at org.apache.jasper.runtime.JspServlet.serviceJspFile(Compiled Code)
> at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
> at javax.servlet.http.HttpServlet.service(Compiled Code)
> at org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
> at org.apache.tomcat.core.ContextManager.service(Compiled Code)
> at
>
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Compiled Code)
> at org.apache.tomcat.service.TcpConnectionThread.run(Compiled Code)
> at java.lang.Thread.run(Compiled Code)
>
> Thanks,
>
>
> George McKinney, Developer
> Tantalus Communications Inc.
> 500-1122 Mainland Street
> Vancouver, BC, Canada V6B 5L1
> george@tantalus.com
>
> Direct  604.726.6753
> Main    604.609.0700
> Fax     604.609.0705
>
> "The Oracle Experts"
> www.tantalus.com
>