My spring application compiled with java 1.8 in local system where it's working fine without any issues, but when I deploy the application on the server where java-11 configured, giving an error message in server start-up
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem:
Failed to read candidate component class: URL
[jar:file:/app/apache-tomcat-9.0.46/webapps/planDeTravail/WEB-INF/lib/rna-1.20.jar!/com/DoRnaHistory.class];
nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file -
probably due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class];
nested exception is java.lang.IllegalArgumentException
Offending resource: class path resource [META-INF/spring/rna-spring-context.xml]; nested exception
is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably
due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class];
nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68
My spring application running in 3.2.16.RELEASE
Could anyone please help me to find the root cause and solution of the issue?
I changed my JRE version back to 8 when using <org.springframework.version>5.2.0.RELEASE</org.springframework.version>
In Intellij i also changed the app configuration to run with JRE 8.
Related
I am running a program on eclipse and I keep getting this error:
Unable to initialize main class com.logic.AddProduct
Caused by: java.lang.NoClassDefFoundError: org/hibernate/Session
Any explainations?
Hibernate JAR (hibernate-core i suppose) or onr of its dependencies is probably not in your runtime classpath.
I'm trying to deploy a WebSphere Liberty Application via Docker. I'm also using Apache Struts for the UI. When deploying on my local machine I have no problems, but when put on seemingly any other machine, it throws an error saying the struts2 filter cannot be loaded. Classes do not seem to be missing.
Why would this container work on one machine and not another?
Stack Trace:
[ERROR ] SRVE0321E: The [struts2] filter did not load during start up.
Filter [struts2]: could not be initialized
[ERROR ] SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: Filter [struts2]: could not be initialized
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5027)
at [internal classes]
Caused by: javax.servlet.ServletException: Filter [struts2]: could not be initialized
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:163)
... 1 more
Caused by: Unable to create SAX parser - Class: com.icl.saxon.aelfred.SAXParserFactoryImpl
File: SAXParserFactoryImpl.java
Method: newSAXParser
Line: 34 - com/icl/saxon/aelfred/SAXParserFactoryImpl.java:34:-1
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:149)
... 1 more
Caused by: Unable to create SAX parser - Class: com.icl.saxon.aelfred.SAXParserFactoryImpl
File: SAXParserFactoryImpl.java
Method: newSAXParser
Line: 34 - com/icl/saxon/aelfred/SAXParserFactoryImpl.java:34:-1
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:111)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
... 9 more
Caused by: javax.xml.parsers.ParserConfigurationException: AElfred parser is non-validating
at com.icl.saxon.aelfred.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:34)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:109)
... 10 more
Caused by: javax.xml.parsers.ParserConfigurationException: AElfred parser is non-validating
The struts2 requires to have a validating parser. Since this parser is non-validating it should be removed from the classpath.
The affected parser could be found in saxon.jar.
Thanks to Roman I was able to diagnose this problem more correctly as a saxon XML parser issue. I tried just replacing my JAR and this actually worked for a few tests but later broke.
This forum post ultimately solved the problem: http://grokbase.com/t/tomcat/users/031xc9jye7/i-cant-use-saxon-xml-parser-in-my-web-app-please-help
My web server (WebSphere Liberty) was trying to use Saxon as the XML parser, however Saxon is non-validating and thus this was failing, particularly in Docker where I was trying this.
To fix this I had to remove the file javax.xml.parsers.SAXParserFactory from the JAR and then the server ran correctly.
I downloaded the latest MySQL connector mysql-connector-java-5.1.37.zip from https://dev.mysql.com/downloads/connector/j/.
Tomcat is throwing "ASM ClassReader failed to parse class file - probably d
e to a new Java class file version that isn't supported yet:[]" while starting my webapp. I tried running with JDK 7 and 8. Search results indicate the error may occur if the jar was built for JDK 8, not with JDK 7 compile level.
Java 1.8 ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet
Is there another MySQL connector jar I should use? Other workarounds?
(The webapp also uses Spring 3.2.4)
C:/servers/apache-tomcat-7.0.65/lib/mysql-connector-java-5.1.37-bin.jar!/com/mysql/jdbc/JDBC42CallableStatement.class];
nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably d
e to a new Java class file version that isn't supported yet: URL [jar:file:/C:/servers/apache-tomcat-7.0.65/lib/mysql-c
nnector-java-5.1.37-bin.jar!/com/mysql/jdbc/JDBC42CallableStatement.class]; nested exception is java.lang.IllegalArgume
tException
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(Cl
ssPathScanningCandidateComponentProvider.java:290)
Switching to mysql-connector-java-5.0.8-bin.jar from the "Previous GA" section solved the issue.
https://dev.mysql.com/downloads/connector/j/5.0.html
I am trying to run Symbolic Java Path finder, howerver getting following error:
SEVERE JPF configuration error: class not found gov.nasa.jpf.symbc.SymbolicInstructionFactory by classloader: gov.nasa.jpf.JPFClassLoader#aa470b8
used within "vm.class" instantiation of class gov.nasa.jpf.jvm.JVM
SEVERE JPF terminated
I have problem with rmiregistry. I'm getting below error:
Cannot bind to URL [rmi://........]: javax.naming.NamingException [Root exception is java.rmi.UnexpectedException: undeclared checked exception; nested exception is:
java.lang.ClassNotFoundException: Could not find class (javax.management.remote.rmi.RMIServerImpl_Stub) at codebase ()]
I checked, class exist in the classpath.
I used java 1.6 on linux. I started rmiregistry 6667.
Has anyone met with this error?
class exist in the classpath.
In your JVM's classpath. It is also needed on the Registry's classpath, and the client's.