Skip to main content

Sun PE 9: Bad version number in .class file

3 replies [Last post]
hugop92
Offline
Joined: 2004-11-22

Hi,

When running the Sun Java System Application Server PE 9 under Eclipse, I have the exception:
java.lang.UnsupportedClassVersionError: Bad version number in .class file

Versions:
- Eclipse 3.2.0
- J2EE Standard Tools 1.5.0
- Web Standard Tools 1.5.0
- Sun Java System Application Server Platform Edition 9.0
- JRE 1.5.0_07 (using the Sun App. Server's JRE and jars doesn't help)
- Glassfish Eclipse Plugin 0.3
- Repeatable source: the Hello2 example from the Java EE 5 Tuorial

By the way, the Glassfish Eclipse Plugin has no installer as stated in the instructions.

Hugo.

---------------------------
Stack trace:

java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1955)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:945)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1411)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1275)
org.apache.jasper.compiler.Validator$ValidateVisitor$1MapperELVisitor.visit(Validator.java:1620)
org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:135)
org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:206)
org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:273)
org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:66)
org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:206)
org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1659)
org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1261)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1037)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:820)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1469)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2244)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2294)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1469)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2244)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2294)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1469)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2244)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2294)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1469)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2244)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2294)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1469)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2244)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2294)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2300)
org.apache.jasper.compiler.Node$Root.accept(Node.java:468)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2244)
org.apache.jasper.compiler.Validator.validate(Validator.java:1754)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:235)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:526)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:507)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:530)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:409)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:317)
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hugop92
Offline
Joined: 2004-11-22

Changing the Project Java Facet to 5 solved the problem.

weizheng
Offline
Joined: 2006-08-01

Hi Hugo,

Can you share how you change the Project Facet to 5? I don't see the Project Facet of 5 and the only option available is 1.2/1.3/1.4.

I'm using Eclipse 3.2 and WTP1.5 with GlassFishPlugin0.3 on Windows system.

Thanks,
Wei

weizheng
Offline
Joined: 2006-08-01

Sorry, I realized that you mentioned Java Facet (Java SE 5) and I'm looking for Java EE 5 in Enterprise Project Facet and EJB Project Facet. These are not available in current WTP1.5