JSP compilation error on jetty-9.3.3

I have a webapp application which was running on embedded Jetty-7.6.8 (jdk-6), but due to Diffe-Hellman error on the browser we decided to move to newer version of Jetty. So, we moved to Jetty-9.3.3. As Jetty-9.x needs jdk-8, I upgraded jdk also. Right now jetty is starting up with no error but when I try to access my login page I get an unable compile jsp error.

These are the dependencies:


The error which comes on the log/browser:


Problem accessing /xdadm/test.jsp. Reason:

Server Error

Caused by:

org.apache.jasper.JasperException: Unable to compile class for JSP
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:600)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1686)
at com.xcom.filter.RequestHandler.doFilter(RequestHandler.java:91)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1156)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1088)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
at org.eclipse.jetty.server.Server.handle(Server.java:517)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:192)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NullPointerException
at org.apache.jasper.compiler.Validator$ValidateVisitor.<init>(Validator.java:515)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1853)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
... 33 more

Please, any clue or suggestion on what's going wrong. TIA

I had the same problem with Embedded Jetty Server 9.4.15 and JSP support. The solution is pretty simple : https://www.eclipse.org/jetty/documentation/current/embedded-examples.html#embedded-webapp-jsp

You have to enable AnnotationConfiguration :

// This webapp will use jsps and jstl. We need to enable the
// AnnotationConfiguration in order to correctly
// set up the jsp container
Configuration.ClassList classlist = Configuration.ClassList
            .setServerDefault( server );
            "org.eclipse.jetty.annotations.AnnotationConfiguration" );

453379 – Make sure to precompile jsps with the same Jetty version, If the maven jsp compiler plugin is the old one - even if Jetty starts to provide newer Created attachment 249081 [details] error log from local test build I have a some marginally working version :) Right now I am trying out 9.3.3 jetty, to see if� Please list all of your dependencies. (the jars your project uses) Joakim Erdfelt / joakim@xxxxxxxxxxx On Thu, May 31, 2018 at 3:49 PM, Ike Ikonne < iikonne@xxxxxxxxxx > wrote:

I have been stuck with the same error for sometime. So for anyone who comes across the same error, the answer is exactly what others pointed out - dependency management.

If you see the Caused by: java.lang.NullPointerException at org.apache.jasper.compiler.Validator$ValidateVisitor.<init>(Validator.java:515) it is caused by failure to detect/load taglibs by Apache Jasper engine.

In other words you're missing the taglibs dependency or its API or its implementation somewhere.

Make sure all the following dependencies/JARs are in your POM


And if you're shading the WAR into a FAT jar, you're in for another world of pain if dependencies are scoped differently (compile vs runtime), then the order of dependencies matter or otherwise you'll start getting the same NullPointerException.

jetty-9.4.32-SNAPSHOT jetty-9.4.31.v20200723, HostnameVerifier to HttpClient + 3161 Update to Apache JSP 8.5.35 + 3178 Reflection to be compatible with Java 11 + 2936 Error during initial + 706 org. apache.jasper.compiler.disablejsr199 is no longer present in Jetty 9.3+ + 708 jetty-9.3.3.v20150827 - 27 August 2015 + 470311 Introduce a proxy-protocol module� On Thu, May 31, 2018 at 3:49 PM, Ike Ikonne <iikonne@xxxxxxxxxx> wrote: Hi all, I am getting the following stacktrace from my embedded Jetty-9.4.9. I have googled this issue and it

The problem was solved after I added all these dependencies:

 jetty-lib/jetty-annotations-9.3.8.v20160314.jar jetty-lib/jetty-continuation-9.3.8.v20160314.jar
 jetty-lib/jetty-http-9.3.8.v20160314.jar jetty-lib/jetty-io-9.3.8.v20160314.jar
 jetty-lib/jetty-plus-9.3.8.v20160314.jar jetty-lib/jetty-security-9.3.8.v20160314.jar
 jetty-lib/jetty-server-9.3.8.v20160314.jar jetty-lib/jetty-servlet-9.3.8.v20160314.jar
 jetty-lib/jetty-util-9.3.8.v20160314.jar jetty-lib/jetty-webapp-9.3.8.v20160314.jar
 jetty-lib/jetty-xml-9.3.8.v20160314.jar  jetty-lib/servlet-api-3.1.jar

This how it looks like:

├── apache-jsp
│   |── org.eclipse.jdt.core.compiler.ecj-4.4.2.jar
│   ├── org.eclipse.jetty.apache-jsp-9.3.8.v20160314.jar
│   ├── org.mortbay.jasper.apache-el-8.0.27.jar
│   └── org.mortbay.jasper.apache-jsp-8.0.27.jar
├── jetty-annotations-9.3.8.v20160314.jar
├── jetty-continuation-9.3.8.v20160314.jar
├── jetty-http-9.3.8.v20160314.jar
├── jetty-io-9.3.8.v20160314.jar
├── jetty-plus-9.3.8.v20160314.jar
├── jetty-security-9.3.8.v20160314.jar
├── jetty-server-9.3.8.v20160314.jar
├── jetty-servlet-9.3.8.v20160314.jar
├── jetty-util-9.3.8.v20160314.jar
├── jetty-webapp-9.3.8.v20160314.jar
├── jetty-xml-9.3.8.v20160314.jar
├── servlet-api-3.1.jar
└── setuid
    ├── 32libsetuid-linux.so
    ├── jetty-setuid-java-1.0.3.jar
    └── libsetuid-linux.so

PS: I've moved to 9.3.8 from 9.3.3

VERSION.txt - jetty/org.eclipse.jetty.project, + 485469 permessage-deflate extension causes protocol error in Firefox/Chrome . + 485714 jetty-9.3.3.v20150827 - 27 August 2015. + 470311 + 411069 better set compiler defaults to 1.7, including webdefault.xml for jsp. + 411934 War � Hi all, I am getting the following stacktrace from my embedded Jetty-9.4.9. I have googled this issue and it seems that some people have ran into the same situation, but I could not find a full resolution for

java, 我有一个运行在嵌入式Jetty-7.6.8(jdk-6)上的webapp应用程序,但是由于浏览器上的Diffe-Hellman错误,我们 HTTP ERROR 500 Problem accessing /xdadm/test. jsp. JasperException: Unable to compile class for JSP at org.apache.jasper. and lots of errors like this. Jakarta mailing lists reveal that this may be caused by old servlet libraries on tomcat classpath. But this is not tomcat, it's jetty and moreover I'm sure JBoss developers wouldn't put outdated libraries on the beta distribution.

jetty-9.4.14.v20181114, Reflection to be compatible with Java 11 + 2936 Error during initial for "https" URLs jetty-9.3.3.v20150827 - 27 August 2015 + 470311 Introduce a shell scripts to jetty8 + 363878 Add ecj compiler to jetty-8 for jsp + 364283� When you try loading the jsp page in the browser it should throw the compilation errors.

jetty-9.4.3-3.v20170317.fc26 | Build Info, Description, Jetty is a 100% Java HTTP Server and Servlet Container. in order to use Java, servlets and JSPs to generate dynamic content. version 9.3.3. v20150827 - Remove manual requires on glassfish-servlet-api as the Patch unix djetty script so it doesn't issue error messages about /dev/tty and� Hi all, I am getting a JSP compilation error in Jetty-9.4.9. Please see the attached stacktrace and the java classloader output. Any insight will be appreciated.

[XWIKI-13956] Upgrade to Jetty 9.4.6.v20170531, jetty-9.4.6.v20170531 - 31 May 2017 + 523 TLS close behaviour breaking FormAuthenticator + 1268 <jsp-file>incorrectly handled when the jsp is at SPI + 1277 http2 alpn test error jetty-9.4.0.v20161208 - 08 December 2016 "https" URLs jetty-9.3.3.v20150827 - 27 August 2015 + 470311 Introduce a� For jetty-7.5.0 we upgraded the version of JSP to jsp-impl-2.1.3.b10 (from Glassfish). In this version, the JSP infrastructure ALWAYS tries to acquire a Java compiler from the JVM if the version of Java is 1.6 or above. Therefore, if you are using a JRE, JSPs are unable to compile so you must use a full JDK.

Jetty: VERSION.txt, Member "jetty-distribution-9.4.31.v20200723/VERSION.txt" (23 Jul 2020, 142 WebSocketSession 143 + 4383 Errors deleting multipart tmp files java.lang. URLs 2364 2365 jetty-9.3.3.v20150827 - 27 August 2015 2366 + 470311 Introduce a update shell scripts to jetty8 5727 + 363878 Add ecj compiler to jetty-8 for jsp� Jetty 9.03 - seeing maximum websocket connection limit. why?. Hi All, We're running 1x Windows 10 inside virtualBox for the server instance 3x Windows 10 on a physical machine to run 25 client

  • How are you managing your dependencies? That list doesn't seem right. If you were using a build tool (maven, gradle, grails, buildr, groovy grape, sbt, or leiningen) you would have different results.
  • I have a manifest.mf in which all these dependencies are mentioned. I make a jar of my jetty embedded class and other classes alongwith this manifest.
  • all of the mentioned build tools can manage the manifest.mf references as well (using normal java references, or osgi references, or even Java 9 jigsaw/module references) based on your defined transitive dependency graphs.
  • @devd, hi, do you solve your problem?
  • @wawa: Please check below I've posted how I solved, just now.
  • I find add jetty-lib/jsp replace jetty-lib/apache-jsp , It works.
  • Thanks but I've been using this webapp in jetty-7.6.8 without any maven support. Actually, I have no idea how to use maven.
  • I have tried with a simple jsp page, there also the compilation fails. Taglibs I am not using.
  • You have many many options, maven is just one of them. (see the list of options in the comments below your question)