Closed GerbenRienk closed 4 years ago
Looking at a similar posting here, it looks like you might need to remove an old jar file from the lib directory: https://community.jaspersoft.com/wiki/javalangverifyerror-jasperreports-server-version-611-610
Remove castor-1.2.jar from the WEB-INF\lib directory of your appserver, restart the webapp.
will be solved by issue #197
Description: A fresh install on debian 10 results in an error when accessing the application
Server Setup: Tomcat Version Apache Tomcat/9.0.31 (Debian) JVM Version 11.0.8+10-post-Debian-1deb10u1 JVM Vendor Debian OS Name Linux OS Version 4.19.0 OS Architecture amd64 LibreClinica 1.0.0
Requirements: On a debian 10 server, follow https://libreclinica.org/documentation/install.html After putting the war in the webapps folder and editing the datainfo.properties the application can be started, as is shown in tomcat's list of applications. However as soon as the application is accessed it results in a 500-page.
Expected result: The login page should open
Actual result: Error page with:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'castorMarshaller' defined in ServletContext resource [/WEB-INF/pages-servlet.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: org/castor/xml/XMLConfiguration, method: newInstance signature: ()Lorg/castor/core/util/Configuration;) Incompatible argument to function
Workaround:
Additional context: The following configuration:
Tomcat Version Apache Tomcat/9.0.16 (Debian) JVM Version 11.0.6+10-post-Debian-1deb10u1 works fine. Since reliatec did experienced similar issues in the past there is definitely a need to check for duplicate class definitions.
The class org/castor/xml/XMLConfiguration is defined in castor-1.2.jar and in castor-xml-1.3.1.jar and so it is a valid fix to remove castor-1.2.jar.
Full errormessage: Type Exception Report
Message Servlet.init() for servlet [pages] threw exception
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: Servlet.init() for servlet [pages] threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:415) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:834) Root Cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'castorMarshaller' defined in ServletContext resource [/WEB-INF/pages-servlet.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: org/castor/xml/XMLConfiguration, method: newInstance signature: ()Lorg/castor/core/util/Configuration;) Incompatible argument to function org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:701) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:667) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:715) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:590) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:529) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:415) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:834) Root Cause
java.lang.VerifyError: (class: org/castor/xml/XMLConfiguration, method: newInstance signature: ()Lorg/castor/core/util/Configuration;) Incompatible argument to function org.castor.xml.AbstractInternalContext.(AbstractInternalContext.java:121)
org.exolab.castor.xml.XMLContext$1.(XMLContext.java:53)
org.exolab.castor.xml.XMLContext.(XMLContext.java:53)
org.springframework.oxm.castor.CastorMarshaller.createXMLContext(CastorMarshaller.java:484)
org.springframework.oxm.castor.CastorMarshaller.afterPropertiesSet(CastorMarshaller.java:461)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846)
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:701)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:667)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:715)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:590)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:529)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:169)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:415)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:834)
Note The full stack trace of the root cause is available in the server logs.