2012-02-01 148 views
0

我已经为Web服务创建了一个轴客户端。我作为jar导出并包含在shared/app文件夹中,以便它可供所有portlet应用程序使用。问题是,当我的portlet项目尝试初始化客户端时,我得到以下异常:Axis客户端jar是6.1共享应用程序

ERROR [org.springframework.web.portlet.DispatcherPortlet] - Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'portalStatisticsTransactionDelegateProxy' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.uig.portal.ws.statistics.service.PortalStatisticsTransactionDelegateProxy]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient (initialization failure) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 
    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.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:653) 
    at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:370) 
    at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:293) 
    at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:93) 
    at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:162) 
    at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:673) 
    at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:626) 
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335) 
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551) 
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1274) 
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1138) 
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569) 
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:817) 
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:921) 
    at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2124) 
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342) 
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497) 
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.uig.portal.ws.statistics.service.PortalStatisticsTransactionDelegateProxy]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient (initialization failure) 
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141) 
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958) 
    ... 30 more 
Caused by: java.lang.NoClassDefFoundError: org.apache.axis.client.AxisClient (initialization failure) 
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:134) 
    at org.apache.axis.client.Service.getAxisClient(Service.java:104) 
    at org.apache.axis.client.Service.<init>(Service.java:113) 
    at com.uig.portal.ws.statistics.service.PortalStatisticsTransactionServiceLocator.<init>(PortalStatisticsTransactionServiceLocator.java:12) 
    at com.uig.portal.ws.statistics.service.PortalStatisticsTransactionDelegateProxy._initPortalStatisticsTransactionDelegateProxy(PortalStatisticsTransactionDelegateProxy.java:18) 
    at com.uig.portal.ws.statistics.service.PortalStatisticsTransactionDelegateProxy.<init>(PortalStatisticsTransactionDelegateProxy.java:8) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:522) 
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) 
    ... 32 more 

任何想法?我试着从我的portlet项目中引用轴心瓶,但那不起作用。

+0

“(初始化失败)”表示JVM已将类标记为坏,因为类初始化失败。在某处显示“at ... AxisClient。”堆栈帧的日志中应该有一个较早的错误,这是此异常的原因。那个例外说什么? – 2012-02-01 20:22:39

+0

我添加了完整的堆栈跟踪。有任何想法吗? – Carlos 2012-02-02 13:37:22

+0

不,这是NoClassDefFoundError的完整堆栈跟踪。应该有另一个错误(某处)显示堆栈跟踪,其中包含“at ... AxisClient。”(对不起,我以前的评论错误地说“client”而不是“clinit”)。 – 2012-02-02 15:21:53

回答

0

我认为你的客户端jar会干扰标准的websphere库。它导致服务器类加载器层次结构中存在两个不同版本的相同类。您的应用程序类加载器可能会选择错误的版本。

我建议从共享/应用程序中删除jar,并配置共享库。然后,将共享库与应用程序关联起来。你可以在was infocenter找到更多的细节。