Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » ClassFormatException in Java11 while compiling JSP pages
ClassFormatException in Java11 while compiling JSP pages [message #1871373] Mon, 23 September 2024 14:13 Go to next message
Eclipse UserFriend
Stacktrace:
MESSAGE:Compilation error
org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:298)[44:org.apache.jasper:5.5.17.v200706111724]
at org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:197)[44:org.apache.jasper:5.5.17.v200706111724]
at org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:169)[44:org.apache.jasper:5.5.17.v200706111724]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)[44:org.apache.jasper:5.5.17.v200706111724]
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178)[44:org.apache.jasper:5.5.17.v200706111724]
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:415)[44:org.apache.jasper:5.5.17.v200706111724]
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:469)[44:org.apache.jasper:5.5.17.v200706111724]
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:333)[44:org.apache.jasper:5.5.17.v200706111724]
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:402)[44:org.apache.jasper:5.5.17.v200706111724]


Java: Java 11.0.24
Tomcat 9.0.89

We are getting the issue when compiling JSP java files
Re: ClassFormatException in Java11 while compiling JSP pages [message #1871376 is a reply to message #1871373] Mon, 23 September 2024 15:04 Go to previous messageGo to next message
Eclipse UserFriend
Tomcat seems to have released a 9.0.95 in just the past few months; it may do a better job of indicating which .class file it's not happy reading. Regardless, one of the classes required to compile your JSP
is represented by an invalid .class file somewhere in your application.
Re: ClassFormatException in Java11 while compiling JSP pages [message #1871394 is a reply to message #1871376] Mon, 23 September 2024 16:12 Go to previous messageGo to next message
Eclipse UserFriend
There is prey weird behaviour that we are observing. When we import a class in JSP that does not have any string + operations, it is working fine. But when the imported class contains these operations, it is failing. For example:


Working class files:

public class App {
public string getName(){
String name = "test**";
return name;
}
}
public class App {
public string getName(){
String name = "test**";
return "test".concat(name);
}
}

Non-working class file:

public class App {
public string getName(){
String name = "test**";
return name + "fail";
}
}

Unable to figure out what's causing this behaviour.
Re: ClassFormatException in Java11 while compiling JSP pages [message #1871403 is a reply to message #1871394] Mon, 23 September 2024 16:55 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure what's wrong but here's some very general information that may or may not be helpful:
- If you're using Eclipse 2024-09, please note that JDT dropped support for compiling for Java versions earlier than 8: https://eclipse.dev/eclipse/news/4.33/jdt.php#removed-support-for-java7-and-below
- The lines in your stack trace suggest that you're using a very old version of Jasper ("5.5.17.v200706111724").
Re: ClassFormatException in Java11 while compiling JSP pages [message #1871439 is a reply to message #1871376] Tue, 24 September 2024 18:04 Go to previous message
Eclipse UserFriend
We could not find any newer version of Jasper ("5.5.17.v200706111724") hence had to use it. Also I missed to mention that our application is OSGI based.
Previous Topic:"Java 23 Support for Eclipse 2024-09 (4.33)" install fail
Next Topic:Multi-Release Jar problems
Goto Forum:
  


Current Time: Sun Feb 09 17:18:19 GMT 2025

Powered by FUDForum. Page generated in 0.04033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top