2013-07-17 117 views
2

在IBM WAS 6.1上部署Spring MVC應用程序時出現以下錯誤。Spring MVC | IBM Websphere Application Server |服務器啓動錯誤

[17/07/13 12:31:55:466 BST] 0000001a WebApp  E Exception caught while initializing context 
org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0': 
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: 
Could not instantiate bean class [org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter]: 
Constructor threw exception; nested exception is java.lang.ClassCastException: 
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl incompatible 
with javax.xml.transform.TransformerFactory 
      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:917) 
      at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:378) 
      at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:338) 
      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:395) 
      at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611) 
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1274) 
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1164) 
      at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:591) 
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:831) 
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:945) 
      at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2120) 
      at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:342) 
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551) 

同一應用程序工作正常在Tomcat + Eclipse的。但是,當我使用Rational Application Developer將它部署在IBM WAS 6.1上時,在服務器啓動期間出現此錯誤。

任何請幫我解決這個錯誤。

在此先感謝!

+0

看起來像WAS的庫與您的應用程序使用的庫不兼容。 – kgautron

+0

http://forum.springsource.org/showthread.php?139513-Problem-with-SpringWS-and-JBoss-AS6 – VirtualTroll

回答

3

這是一個類加載器的問題,看起來非常相似,XSLT ClassCastException in WebSphere when Spring tries to create an AnnotationMethodHandlerAdapter

所以要儘量設置的類加載器的政策PARENT_LAST並從您的應用程序中刪除對XML的API/Xerces的/ javax.xml罐子所有的依賴。

+0

我只是使用xalan.jar,如果我刪除這個,然後我開始獲得'供應商爲COM。未找到sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl'錯誤。 – whitecollar

+0

你是否直接在應用程序中使用xalan.jar中的類?如果是這樣,確保你正確地實例化所有東西(通過'TransformerFactory'等)。否則,你可以通過設置'javax.xml.transform.TransformerFactory'系統屬性來更改默認的'TransformerFactory'實現。 – Syon

+0

您知道如何在Websphere應用程序服務器中設置系統屬性javax.xml.transform.TransformerFactory,以及哪個實現與javax.xml.transform.TransformerFactory兼容 – whitecollar

相關問題