11

We have a legacy JavaEE application running on JBoss 6.1. When running JBoss6 with Java 1.8.0_92 we are getting the following error. Please help me resolve or give some hints on this error.

16:49:32,888 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/webSSO].[jsp]] Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 1 in the generated java file
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

Stacktrace:
        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) [:6.1.0.Final]
        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) [:6.1.0.Final]
        at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:446) [:6.1.0.Final]
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:362) [:6.1.0.Final]
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) [:6.1.0.Final]
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327) [:6.1.0.Final]
        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:607) [:6.1.0.Final]
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312) [:6.1.0.Final]
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.1.0.Final]
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.1.0.Final]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]

Note: It works fine upto (Java 1.8.0_77)

Kiran Mohan
  • 2,165
  • 5
  • 28
  • 52
  • Sounds like a security rule that's being applied. (I can't think of a good reason for a JSP to need access to anything that even depends on `ObjectInputStream`.) – chrylis -cautiouslyoptimistic- May 02 '16 at 12:16
  • 3
    I'm seeing this with JBoss 5.1 as well. Don't think it's a JBoss issue, but instead it's a jdk issue. – user1459641 May 13 '16 at 13:09
  • 4
    I'm having exactly the same issue with Tomcat 8 so it does not seem to be JBoss related – Toni Toni Chopper May 18 '16 at 14:15
  • 2
    Same issue with 1.8.0_91 now rolling back to 1.8.0_77 – Toni Toni Chopper May 18 '16 at 14:44
  • 2
    Seems related: https://bugzilla.redhat.com/show_bug.cgi?id=1336481 – mzjn May 18 '16 at 17:10
  • 1
    In a comment in the Red Hat issue, this vulnerability is mentioned: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3427, which is also in Oracle Critical Patch Update Advisory - April 2016: http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html. – mzjn May 20 '16 at 11:07
  • 1
    I am seeing the same problem with JDK_1.8.0_91, running Tomcat-7.0.70 on SLES 11 SP 3. Oddly enough, it seems to work on SLES 12, though. – Jeff Jul 27 '16 at 19:26

3 Answers3

1

As you can see red hat web site jdk 1.8 supports only jboss 6.3.3 and above.

cihan adil seven
  • 482
  • 1
  • 4
  • 18
  • 4
    OK, but why is there a problem with Java 1.8.0_91/92 but not with 1.8.0_77? They are both JDK 1.8. – mzjn Aug 18 '16 at 05:49
0

It works with the newer compiler if you compile your tomcat from source with it. You just have to download the source, and follow the few building instructions in BUILDING.txt.

  • 1
    So you just have to "compile your tomcat from source"? Please explain why this is the right solution. Why is there a problem with Java 1.8.0_91/92 but not with 1.8.0_77? – mzjn Aug 18 '16 at 05:25
0

I used latest version of tomcat i.e. Tomcat 9 and it solved the problem.

Kaushik Lele
  • 5,681
  • 9
  • 44
  • 68