Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Compiling jsp

Also note that default installation of Java on most distributions is to use the JRE as your JAVA_HOME.
If you opt to not use the internal compiler, then you are forced to either use the JDK as your JAVA_HOME or manually add in the required jars that the JDK adds automatically for you.

--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Feb 13, 2014 at 4:31 PM, Jan Bartel <janb@xxxxxxxxxxx> wrote:
Andrea,

Can you explain your set up? How are you running jetty? From a
standard jetty distribution, or from embedded, or from the
jetty-maven-plugin?

You should have these jars on the classpath:

 javax.el-3.0.0.jar
 javax.servlet.jsp-2.3.2.jar
 javax.servlet.jsp-api-2.3.1.jar
 jetty-jsp-jdt-2.3.3.jar  (*** this one contains the jsp class that
allows for compilation using jdt!)
 org.eclipse.jdt.core-3.8.2.v20130121.jar


jstl is optional - if you don't use it then you shouldn't need it on
the classpath:
 javax.servlet.jsp.jstl-1.2.0.v201105211821.jar
 org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar

Your stack trace looks like it is falling back to using the ant
compiler, which is the last resort after trying the in-jvm compiler,
and the jdt compiler. So it looks like either the
jetty-jsp-jdt-2.3.3.jar or org.eclipse.jdt.core-3.8.2.v20130121.jar is
missing from the classpath.


Jan

On 13 February 2014 19:56, Andrea Cappelli <a.cappelli@xxxxxxxxx> wrote:
> Hi list,
> I have a webapp which needs to compile some jsp
>
> I tried the suggestions in
>
> http://www.eclipse.org/jetty/documentation/current/configuring-jsp.html#compiling-jsps
>
> to instruct jetty to use it's internal compiler, but I still get
>
> org.apache.jasper.JasperException: Unable to compile class for JSP
>         at
> org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
>         at
> org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
>         at
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
>         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
>         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
>         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
>         at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>         at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:696)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:526)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:586)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>         at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:261)
>         at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:101)
>         at
> it.mareinformatica.jamboBiglie.server.core.StampaServlet.service(StampaServlet.java:92)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>         at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:696)
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1568)
>         at
> org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:164)
>         at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1539)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:524)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>         at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:568)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1110)
>         at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:453)
>         at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1044)
>         at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>         at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199)
>         at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
>         at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
>         at org.eclipse.jetty.server.Server.handle(Server.java:459)
>         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:280)
>         at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229)
>         at
> org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607)
>         at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: 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
>         at
> org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:105)
>         at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:924)
>         at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
>         at
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
>
>
> Googling I found other "solution" proposed, from explicit setting JAVA_HOME
> to adding the directory which contains tools.jar to classpath, nothing
> worked for me
>
> The only thing that worked was to copy the file tools.jar from
> $JDK/lib/tools.jar to $JDK/jre/lib/ext/tools.jar
>
> I'm using
>
> java version "1.7.0_45"
> Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
> Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
>
> and jetty 9.1.0
>
> Any hint appreciated
>
> --
> Andrea Cappelli
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top