包含Axis2_1.5的WAR包在WAS7上部署时报错FileUploadException

启动war包时,错误如下:

[11-2-2519:08:24:639CST]00000021WarBasedAxisCEorg.apache.axis2.deployment.WarBasedAxisConfigurator<init>org.apache.commons.fileupload.FileUploadException

org.apache.axis2.deployment.DeploymentException:org.apache.commons.fileupload.FileUploadException

atorg.apache.axis2.deployment.AxisConfigBuilder.processMessageBuilders(AxisConfigBuilder.java:741)

atorg.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:202)

atorg.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:641)

atorg.apache.axis2.deployment.WarBasedAxisConfigurator.<init>(WarBasedAxisConfigurator.java:157)

atorg.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:519)

atorg.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:437)

atcom.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)

atcom.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:165)

atcom.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1588)

atcom.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)

atcom.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:936)

atcom.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:857)

atcom.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:538)

atcom.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:360)

atcom.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:292)

atcom.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:99)

atcom.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:167)

atcom.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:722)

atcom.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:607)

atcom.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)

atcom.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1162)

atcom.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1313)

atcom.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:611)

atcom.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1312)

atcom.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4189)

atcom.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4367)

atcom.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1317)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2089)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437)

atcom.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:644)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:613)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1215)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atsun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atsun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)

atjavax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1085)

atjavax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:966)

atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)

atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)

atcom.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1313)

atcom.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)

atcom.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1206)

atcom.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)

atcom.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)

atcom.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:286)

atcom.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:502)

atcom.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

atcom.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

atcom.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

atcom.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

atcom.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)

atcom.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)

atcom.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)

atcom.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

Causedby:java.lang.NoClassDefFoundError:org.apache.commons.fileupload.FileUploadException

atjava.lang.J9VMInternals.verifyImpl(NativeMethod)

atjava.lang.J9VMInternals.verify(J9VMInternals.java:72)

atjava.lang.J9VMInternals.initialize(J9VMInternals.java:134)

atjava.lang.J9VMInternals.newInstanceImpl(NativeMethod)

atjava.lang.Class.newInstance(Class.java:1325)

atorg.apache.axis2.deployment.DescriptionBuilder.processMessageBuilders(DescriptionBuilder.java:230)

atorg.apache.axis2.deployment.AxisConfigBuilder.processMessageBuilders(AxisConfigBuilder.java:738)

...66more

Causedby:java.lang.ClassNotFoundException:org.apache.commons.fileupload.FileUploadException

atjava.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:76)

atorg.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)

atorg.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)

atorg.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)

atjava.lang.ClassLoader.loadClass(ClassLoader.java:609)

...73more

解决方法如下:

1.删除IBM\WebSphere\AppServer\plugins\org.apache.axis2.jar,然后重新启动WAS的服务(包括Server,Node,DM)

2.修改类加载顺序

应用程序-》应用程序类型-》WebSphere企业应用程序-》test_war-》管理模块-》test-》类转入器顺序(修改成“类已装入并且是先使用本地类装入器(父类最后)”)

3.使用共享库

将以下文件添加到共享库,然后设置类加载顺序:

应用程序-》应用程序类型-》WebSphere企业应用程序-》teset_war-》类装入和更新检测-》类已装入并且是先使用本地类装入器(父类最后)

${TEST_LIB}/axis2-adb-1.5.jar

${TEST_LIB}/axis2-adb-codegen-1.5.jar

${TEST_LIB}/axis2-ant-plugin-1.5.jar

${TEST_LIB}/axis2-clustering-1.5.jar

${TEST_LIB}/axis2-codegen-1.5.jar

${TEST_LIB}/axis2-corba-1.5.jar

${TEST_LIB}/axis2-fastinfoset-1.5.jar

${TEST_LIB}/axis2-java2wsdl-1.5.jar

${TEST_LIB}/axis2-jaxbri-1.5.jar

${TEST_LIB}/axis2-jaxws-1.5.jar

${TEST_LIB}/axis2-jibx-1.5.jar

${TEST_LIB}/axis2-json-1.5.jar

${TEST_LIB}/axis2-kernel-1.5.jar

${TEST_LIB}/axis2-metadata-1.5.jar

${TEST_LIB}/axis2-mtompolicy-1.5.jar

${TEST_LIB}/axis2-saaj-1.5.jar

${TEST_LIB}/axis2-spring-1.5.jar

${TEST_LIB}/axis2-transport-http-1.5.jar

${TEST_LIB}/axis2-transport-local-1.5.jar

${TEST_LIB}/axis2-xmlbeans-1.5.jar

${TEST_LIB}/commons-httpclient-3.1.jar

${TEST_LIB}/commons-fileupload-1.2.jar

${TEST_LIB}/woden-api-1.0M8.jar

${TEST_LIB}/commons-io-1.4.jar

${TEST_LIB}/addressing-1.5.jar

${TEST_LIB}/httpcore-4.0.jar

${TEST_LIB}/commons-codec-1.3.jar

第二种方法只对单纯的WebService程序有效,如果使用JNDI方式访问数据库会报如下错误(修改类加载顺序引发):

[11-3-714:22:54:148CST]0000002bContextLoaderEorg.springframework.web.context.ContextLoaderinitWebApplicationContextContextinitializationfailed

org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'flightDynamicService'definedinServletContextresource[/WEB-INF/conf/applicationContext.xml]:Cannotresolvereferencetobean'flightDynamicDao'whilesettingbeanproperty'flightDynamicDao';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'flightDynamicDao'definedinServletContextresource[/WEB-INF/conf/dataAccessContext.xml]:Cannotresolvereferencetobean'sqlMapClient'whilesettingbeanproperty'sqlMapClient';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sqlMapClient'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Cannotresolvereferencetobean'dataSourceAngel'whilesettingbeanproperty'dataSource';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'dataSourceAngel'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Invocationofinitmethodfailed;nestedexceptionisjavax.naming.NoInitialContextException:Cannotinstantiateclass:com.ibm.websphere.naming.WsnInitialContextFactory[Rootexceptionisjava.lang.ClassCastException:com.ibm.websphere.naming.WsnInitialContextFactoryincompatiblewithjavax.naming.spi.InitialContextFactory]

Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'flightDynamicDao'definedinServletContextresource[/WEB-INF/conf/dataAccessContext.xml]:Cannotresolvereferencetobean'sqlMapClient'whilesettingbeanproperty'sqlMapClient';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sqlMapClient'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Cannotresolvereferencetobean'dataSourceAngel'whilesettingbeanproperty'dataSource';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'dataSourceAngel'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Invocationofinitmethodfailed;nestedexceptionisjavax.naming.NoInitialContextException:Cannotinstantiateclass:com.ibm.websphere.naming.WsnInitialContextFactory[Rootexceptionisjava.lang.ClassCastException:com.ibm.websphere.naming.WsnInitialContextFactoryincompatiblewithjavax.naming.spi.InitialContextFactory]

Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'sqlMapClient'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Cannotresolvereferencetobean'dataSourceAngel'whilesettingbeanproperty'dataSource';nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'dataSourceAngel'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Invocationofinitmethodfailed;nestedexceptionisjavax.naming.NoInitialContextException:Cannotinstantiateclass:com.ibm.websphere.naming.WsnInitialContextFactory[Rootexceptionisjava.lang.ClassCastException:com.ibm.websphere.naming.WsnInitialContextFactoryincompatiblewithjavax.naming.spi.InitialContextFactory]

Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'dataSourceAngel'definedinServletContextresource[/WEB-INF/conf/dataSourceContext.xml]:Invocationofinitmethodfailed;nestedexceptionisjavax.naming.NoInitialContextException:Cannotinstantiateclass:com.ibm.websphere.naming.WsnInitialContextFactory[Rootexceptionisjava.lang.ClassCastException:com.ibm.websphere.naming.WsnInitialContextFactoryincompatiblewithjavax.naming.spi.InitialContextFactory]

Causedby:javax.naming.NoInitialContextException:Cannotinstantiateclass:com.ibm.websphere.naming.WsnInitialContextFactory.Rootexceptionisjava.lang.ClassCastException:com.ibm.websphere.naming.WsnInitialContextFactoryincompatiblewithjavax.naming.spi.InitialContextFactory

atjavax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)

atjavax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)

atjavax.naming.InitialContext.init(InitialContext.java:226)

atjavax.naming.InitialContext.<init>(InitialContext.java:202)

atorg.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:106)

atorg.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:84)

atorg.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)

atorg.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:147)

atorg.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:90)

atorg.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:101)

atorg.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:164)

atorg.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:151)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)

atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)

atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)

atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:248)

atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:950)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:740)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:417)

atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)

atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)

atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:248)

atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:950)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:740)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:417)

atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)

atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)

atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:248)

atorg.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:950)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:740)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:417)

atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)

atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)

atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)

atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)

atorg.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)

atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)

atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)

atorg.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)

atjavax.servlet.GenericServlet.init(GenericServlet.java:241)

atcom.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)

atcom.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:165)

atcom.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1588)

atcom.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)

atcom.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:605)

atcom.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:360)

atcom.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:292)

atcom.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:99)

atcom.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:167)

atcom.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:722)

atcom.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:607)

atcom.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)

atcom.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1162)

atcom.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1313)

atcom.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:611)

atcom.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1312)

atcom.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4189)

atcom.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4367)

atcom.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1317)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2089)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437)

atcom.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:644)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:613)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1215)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atsun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atsun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)

atjavax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1085)

atjavax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:966)

atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)

atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)

atcom.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1313)

atcom.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)

atcom.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1206)

atcom.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)

atcom.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)

atcom.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:286)

atcom.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:502)

atcom.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

atcom.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

atcom.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

atcom.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

atcom.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)

atcom.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)

atcom.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)

atcom.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

去掉war包中的jndi.jar,可以解决上面问题,但是报另外一个错误:

[11-3-714:42:18:914CST]0000002bContextLoaderEorg.springframework.web.context.ContextLoaderinitWebApplicationContextContextinitializationfailed

org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'newappDbService'definedinServletContextresource[/WEB-INF/conf/applicationContext.xml]:Instantiationofbeanfailed;nestedexceptionisorg.springframework.beans.BeanInstantiationException:Couldnotinstantiatebeanclass[com.travelsky.angel.hub.service.impl.NewappDbService]:Constructorthrewexception;nestedexceptionisjava.lang.ExceptionInInitializerError

Causedby:org.springframework.beans.BeanInstantiationException:Couldnotinstantiatebeanclass[com.travelsky.angel.hub.service.impl.NewappDbService]:Constructorthrewexception;nestedexceptionisjava.lang.ExceptionInInitializerError

Causedby:java.lang.ExceptionInInitializerError

atjava.lang.J9VMInternals.initialize(J9VMInternals.java:222)

atcom.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:258)

atcom.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)

atcom.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)

atcom.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:188)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atjavax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)

atjavax.xml.bind.ContextFinder.find(ContextFinder.java:286)

atjavax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)

atjavax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)

atjavax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)

atcom.travelsky.angel.hub.msghandle.MsgHandleFacade.<clinit>(MsgHandleFacade.java:69)

atjava.lang.J9VMInternals.initializeImpl(NativeMethod)

atjava.lang.J9VMInternals.initialize(J9VMInternals.java:200)

atcom.travelsky.angel.hub.service.impl.NewappDbService.<init>(NewappDbService.java:60)

atsun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)

atsun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:45)

atsun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)

atjava.lang.reflect.Constructor.newInstance(Constructor.java:515)

atorg.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:84)

atorg.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:60)

atorg.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:52)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:640)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:626)

atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:381)

atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)

atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)

atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)

atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)

atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)

atorg.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)

atorg.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)

atorg.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)

atorg.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)

atjavax.servlet.GenericServlet.init(GenericServlet.java:241)

atcom.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)

atcom.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:165)

atcom.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1588)

atcom.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)

atcom.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:605)

atcom.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:360)

atcom.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:292)

atcom.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:99)

atcom.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:167)

atcom.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:722)

atcom.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:607)

atcom.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)

atcom.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1162)

atcom.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1313)

atcom.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:611)

atcom.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1312)

atcom.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4189)

atcom.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4367)

atcom.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1317)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2089)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437)

atcom.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:644)

atcom.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:613)

atcom.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1215)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atsun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)

atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)

atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)

atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

atjava.lang.reflect.Method.invoke(Method.java:599)

atsun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)

atjavax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1085)

atjavax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:966)

atcom.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)

atcom.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)

atcom.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1313)

atcom.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)

atcom.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1206)

atcom.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)

atcom.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)

atcom.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:286)

atcom.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:502)

atcom.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

atcom.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

atcom.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

atcom.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

atcom.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)

atcom.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)

atcom.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)

atcom.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

Causedby:java.lang.ClassCastException:org.apache.xerces.jaxp.datatype.DatatypeFactoryImplincompatiblewithjavax.xml.datatype.DatatypeFactory

atjavax.xml.datatype.DatatypeFactory.newInstance(UnknownSource)

atcom.sun.xml.bind.DatatypeConverterImpl.<clinit>(DatatypeConverterImpl.java:783)

atjava.lang.J9VMInternals.initializeImpl(NativeMethod)

atjava.lang.J9VMInternals.initialize(J9VMInternals.java:200)

...97more

以上问题暂时没有好的解决方法,据说在WAS7.0.0.17版本中解决,该版本发布时间预计2011年5月16日(参考如下链接)

http://www-01.ibm.com/support/docview.wss?uid=swg1PM27213

http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg27004980#ver70

相关推荐