Java应用程序日志错误

时间:2017-10-04 20:01:09

标签: java websphere

将EAR文件部署到服务器后,出现以下错误。     由于我是JAVA的新手,我无法弄清楚什么可以解决这个问题。 非常感谢任何帮助。

我也试过更改编译器版本,但这似乎也没有帮助。 此外,错误如下。

[2017-10-04 14:23:24,716] org.springframework.web.context.ContextLoader#initWebApplicationContext


ERROR: Context initialization failed    

       org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.sl.was.cashpayment.jms.JMSApplicationListener] for bean with name 'applicationListener' defined in ServletContext resource [/WEB-INF/classes/config/spring/applicationContext-jms.xml]: problem with class file or dependent class; nested exception is java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=com/sl/was/cashpayment/jms/JMSApplicationListener, offset=6
                at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1238)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
                at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1304)
                at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:870)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
                at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
                at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
                at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1732)
                at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:415)
                at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
                at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
                at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)
                at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
                at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
                at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1201)
                at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1390)
                at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
                at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:979)
                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:785)
                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1403)
                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2214)
                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:435)
                at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:378)
                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:126)
                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:653)
                at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5487)
                at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5613)
                at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:667)
                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:611)
                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1293)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                at java.lang.reflect.Method.invoke(Method.java:611)
                at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
                at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                at java.lang.reflect.Method.invoke(Method.java:611)
                at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
                at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1152)
                at java.security.AccessController.doPrivileged(AccessController.java:424)
                at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
                at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
                at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1146)
                at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:999)
                at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
                at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1350)
                at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
                at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1243)
                at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
                at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:247)
                at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:360)
                at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:602)
                at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1820)
                at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:558)
                at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:608)
                at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:985)
                at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1074)
                at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)

2 个答案:

答案 0 :(得分:1)

您的类是根据比运行服务器更高的Java版本编译的。 WebSphere 7.0和8.0(以及开箱即用的8.5)在Java 6上运行,因此我的猜测是您的类是使用Java 7或更高版本编译的。 Java是向后兼容的,但不能向前兼容 - 您不能在旧规范的JVM上运行新规范的类。

最简单的解决方案是使用Java 6重新编译类。或者,如果您正在运行WebSphere 8.5.5,则可以使用" managesdk"来切换服务器以在Java 8上运行。 WebSphere的bin目录中的脚本(假设您在服务器上安装了Java 8包)。

答案 1 :(得分:1)

我认为问题在于服务器在您编译的版本之前的Java版本上运行。 E.G用java7编译,服务器在java6上运行