tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vasile GABURICI <gabur...@cs.pub.ro>
Subject Re: Alternative compiler with Tomcat?
Date Wed, 10 May 2000 22:10:38 GMT

	AFAIK, there is only one Jikes: a compiler written in C++ that
compiles Java to bytecode. I am using version 1.10 for Linux.

	AFAICT, the jikes process never gets started on your machine when
accessing jsps. If there are any classpath problems or compilation errors,
you will get a page containig the output of jikes instead of your jsp.

	For instance, if I deliberately break my configuration by taking
out rt.jar from the classpath that tomcat sees, then tomcat will stil run
because JDK1.2.x doesn't need it (it can find the rt.jar itself). But
jikes won't, and any jsp will result in something like this:

                               Error: 500

Location: /orar/numguess.jsp

   Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSP
Found 2 system errors:

*** Error: Could not find package named:
                ./java/util,
                /opt/tomcat/bin/../lib/ant.jar(java/util),
                /opt/tomcat/bin/../lib/jasper.jar(java/util),
                /opt/tomcat/bin/../lib/servlet.jar(java/util),
                /opt/tomcat/bin/../lib/test/java/util,
                /opt/tomcat/bin/../lib/webserver.jar(java/util),
                /opt/tomcat/bin/../lib/xml.jar(java/util),
                /usr/local/jdk1.2.2/lib/tools.jar(java/util),
                /home/Vasile/public_html/orar/WEB-INF/classes/java/util or
                /opt/tomcat/work/localhost_8080%2Forar/java/util

*** Error: Could not find package named:
                ./java/lang,
                /opt/tomcat/bin/../lib/ant.jar(java/lang),
                /opt/tomcat/bin/../lib/jasper.jar(java/lang),
                /opt/tomcat/bin/../lib/servlet.jar(java/lang),
                /opt/tomcat/bin/../lib/test/java/lang,
                /opt/tomcat/bin/../lib/webserver.jar(java/lang),
                /opt/tomcat/bin/../lib/xml.jar(java/lang),
                /usr/local/jdk1.2.2/lib/tools.jar(java/lang),
                /home/Vasile/public_html/orar/WEB-INF/classes/java/lang or
                /opt/tomcat/work/localhost_8080%2Forar/java/lang

        at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled Code)
        at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java,
Compiled Code)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java,
Compiled Code)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java,
Compiled
 Code)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
Compiled Code)
        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled
Code)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHan
dler.java, Compiled Code)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)


	As you can see there is an output from jikes that precedes the
error. Is jikes in the PATH that tomcat can see? If you are using a
service or something NTish like that to start tomcat, I think that you
need to put jikes in System Path not in User's Path. Same goes for
classpath.


On Tue, 9 May 2000, Alec Bau wrote:

> >Do you have jikes set up correctly? Can you compile from the prompt with it?
> 
> What'd you mean by "set up correctly"? I use Jikes version 1.11 from IBM's NT binary
distribution that
> consists of a a single Jikes.exe file. From command line it works fine if you put jre\lib\rt.jar
on a
> classpath. I've tried putting this on a Tomcat classpath as well with the same "Unable
to compile class for
> JSP" JasperException result.
> 
> What bothers me is that as I know Jikes is written in portable C++.  Maybe we're talking
different Jikes
> here - one C++ and one Java? If so where can I get the Java one?
> 
> Then my understanding is that one of Tomcat's jars should contain needed Java Jikes classes
and indeed
> "org.apache.jasper.compiler.JikesJavaCompiler" is present in a jasper.jar . Is it enough
or I need something
> else?
> 
> Thanks.
> 
> Vasile GABURICI wrote:
> 
> >         Do you have jikes set up correctly? Can you compile from the
> > prompt with it?
> >
> > On Tue, 9 May 2000, Alec Bau wrote:
> >
> > > Is it possible to instruct Tomcat to use for JSP other compiler (Jikes,
> > > etc.) that's faster than stock JDK javac? Anybody tried this? If yes
> > > what compilers are available and how to configure Tomcat?
> > >
> > > When I tried to use the following in web.xml to enable Jikes it gave me
> > > an exception at a 1st attempt to compile a JSP:
> > >
> > >         <init-param>
> > >             <param-name>jspCompilerPlugin</param-name>
> > >
> > > <param-value>org.apache.jasper.compiler.JikesJavaCompiler</param-value>
> > >         </init-param>
> > >
> > > Internal Servlet Error:
> > >
> > > org.apache.jasper.JasperException: Unable to compile class for JSP
> > >  at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled
> > > Code)
> > >  at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
> > >  at
> > > org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)
> > >
> > >  at
> > > org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
> > >
> > >  at
> > > org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
> > >
> > >  at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
> > > Compiled Code)
> > >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >  at
> > > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> > > Compiled Code)
> > >  at
> > > org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
> > >  at
> > > org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
> > >
> > >  at
> > > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
> > >
> > >  at java.lang.Thread.run(Thread.java:479)
> > >
> > >
> > >
> > > Thanks.
> > >
> >
> > --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> 

Mime
View raw message