Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370508

Summary: Jetty WTP can't find javac for compiling JSP-pages
Product: [RT] Jetty Reporter: Jonas Pettersson <jlpettersson>
Component: wtpAssignee: Jesse McConnell <jesse.mcconnell>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: janb, jetty-inbox
Version: 8.0.4   
Target Milestone: 7.5.x   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jonas Pettersson CLA 2012-02-02 18:31:28 EST
Deploying a "Dynamic Web Project" by exporting it as a WAR-file to jetty/webapps and starting Jetty with "java -jar start.jar" works fine (both Servlets and JSP).

(Also described on http://stackoverflow.com/questions/9113346/pwc6345-there-is-an-error-in-invoking-javac-error-when-using-jetty-wtp-plugi)

But if I use Jetty WTP plugin, only Servlets works fine. When I visit a JSP-page I get an error:

org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.  A full JDK (not just JRE) is required
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:119)
    at org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:208)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:271)
    at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:98)
    at com.example.FormProcessServlet.doPost(FormProcessServlet.java:39)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:558)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:346)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:941)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
    at java.lang.Thread.run(Unknown Source)
Comment 1 Jesse McConnell CLA 2012-02-02 20:09:07 EST
I don't know that the WTP plugin supports enabling jsp or not, I thought it did but its been ages since I used it.

if you can modify the command line given to jetty you should be able to add jsp

oh, actually if you go into the jetty instance that the WTP adaptor is pointing to you can enable jsp in the start.ini file and that ought to work.

reopen if you can't get it to work at all and I'll try and take a look, but that ought to work for you
Comment 2 Jonas Pettersson CLA 2012-02-02 20:21:33 EST
The command line options given to Jetty looks the same, from Jetty WTP and "native" Jetty.

In start.ini (both "native" and in Eclipse Servers) I have this line:
OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations

I have looked in the other config files too, but haven't found anything that I think can help.
Comment 3 Jan Bartel CLA 2012-02-02 20:46:38 EST
I think this page should answer it:

http://wiki.eclipse.org/Jetty/Howto/Configure_JSP

Just install the most recent jetty and the version of jsp will support using an external (ecj) compiler.

Jan
Comment 4 Jesse McConnell CLA 2012-02-02 20:53:53 EST
oh! you were using 8.0.4

yes, listen to the oracle of jsp, Jan :)
Comment 5 Jonas Pettersson CLA 2012-02-02 20:58:56 EST
(In reply to comment #3)
> I think this page should answer it:
> 
> http://wiki.eclipse.org/Jetty/Howto/Configure_JSP
> 
> Just install the most recent jetty and the version of jsp will support using an
> external (ecj) compiler.
> 
> Jan

I already use the most recent stable Jetty, version 8.0.4. Jetty works fine if I deploy the app with JSP as an exported WAR-file, but not when deployed from Jetty WTP plugin.

I have read that "Configure_JSP" page now, but can't see how it help me. I think it most be some misconfiguration by the Jetty WTP since it works fine when exported as a WAR-file.
Comment 6 Jesse McConnell CLA 2012-02-02 21:03:42 EST
give 8.1.0.v20120127 a whirl
Comment 7 Jonas Pettersson CLA 2012-02-02 21:30:44 EST
(In reply to comment #6)
> give 8.1.0.v20120127 a whirl

I have tried that one now. But I got the exactly same error, it doesn't work from Jetty WTP but exported as a WAR-file.

There is also another problem with both versions, I have to add two external JAR-files manually from jetty/lib/annotations , it's only the JAR-files from jetty/lib that is added automatically. That workaround is described on http://pipecuts.wordpress.com/2011/01/30/classnotfoundexception-org-objectweb-asm-classvisitor/
Comment 8 Jesse McConnell CLA 2012-02-02 21:35:30 EST
well, wtp is not well maintained so if your using maven I would recommend giving webby a try perhaps
Comment 9 Jan Bartel CLA 2012-02-02 22:18:27 EST
Did you define the system property as described here:

 http://wiki.eclipse.org/Jetty/Howto/Configure_JSP

?

If you don't define that property, then I believe that the jdk's internal compiler is going to be tried, and obviously you don't have one.

Jan
Comment 10 Jonas Pettersson CLA 2012-02-03 10:55:25 EST
(In reply to comment #9)
> Did you define the system property as described here:
> 
>  http://wiki.eclipse.org/Jetty/Howto/Configure_JSP
> 
> ?
> 
> If you don't define that property, then I believe that the jdk's internal
> compiler is going to be tried, and obviously you don't have one.
> 
> Jan

Thanks.

It worked when I added:

-Dorg.apache.jasper.compiler.disablejsr199=true

to the start.ini-file in Eclipse for the Jetty WTP Server.