JBoss AS 7.2无法确定实现类名称 [英] JBoss AS 7.2 Failed to determine implementation class name
问题描述
当我尝试从资源适配器内部调用基于WSDL的Web服务时,出现以下异常:
When I am trying to call a WSDL-based web service from inside a Resource Adapter, I get the following exception:
SEVERE [org.apache.cxf.BusFactory] (JmsMessageDispatcher#2) Failed to determine BusFactory implementation class name.: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
at java.lang.Class.asSubclass(Class.java:3126) [rt.jar:1.7.0_45]
at org.apache.cxf.BusFactory.getBusFactoryClass(BusFactory.java:333) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:260) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:247) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:99) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:193) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:182) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:166) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.frontend.ClientProxyFactoryBean.configureObject(ClientProxyFactoryBean.java:99) [cxf-rt-frontend-simple-2.5.9.jar:2.5.9]
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:131) [cxf-rt-frontend-simple-2.5.9.jar:2.5.9]
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:155) [cxf-rt-frontend-jaxws-2.5.9.jar:2.5.9]
在部署上述资源适配器期间,我收到此警告:
During deployment of said Resource Adapter, I get this warning:
WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'org.springframework.context.ApplicationContext,org.springframework.beans.BeansException' for service type 'org.apache.cxf.bus.factory'
我想就像他们说的那样:警告迟早会成为错误;)
I guess it is like they say: A warning DOES become an error sooner or later ;)
对于此问题的答案没有帮助,因为我添加了以下内容对我的pom.xml的依赖已经像这样:
The answer to this question didn't help, since I added the following dependency to my pom.xml already like so:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-api</artifactId>
<version>2.5.9</version>
</dependency>
资源适配器被部署为JCA连接器(.rar).
The Resource Adapter is deployed as a JCA Connector (.rar).
感谢您的帮助!
推荐答案
不要通过资源适配器交付Spring和CXF.将它们包括为模块依赖项.
Don't deliver Spring and CXF with your resource adapters. Include them as module dependency.
在您的RA项目中:
- pom.xml:使用CXF库提供的作用域
- 将META-INF/jboss-deployment-structure.xml添加到RAR存档中
META-INF/jboss-deployment-structure.xml
META-INF/jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="org.jboss.ws.cxf.jbossws-cxf-client" services="import" />
<module name="org.apache.cxf"> <!-- .impl removed -->
<imports>
<include path="META-INF" />
<include path="META-INF/cxf" />
</imports>
</module>
<module name="org.springframework.spring">
<imports>
<include path="META-INF" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
由于spring不是JBoss的一部分,因此必须将其部署为新模块.
As spring is not part of JBoss you have to deploy it as new module.
- 创建模块目录$ JBOSS_HOME/modules/org/springframework/spring/main/
- 添加module.xml
- 将module.xml中列出的JAR文件添加到目录中
module.xml
module.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.spring">
<resources>
<resource-root path="spring-aop-3.2.4.RELEASE.jar" />
<resource-root path="spring-beans-3.2.4.RELEASE.jar" />
<resource-root path="spring-context-3.2.4.RELEASE.jar" />
<resource-root path="spring-core-3.2.4.RELEASE.jar" />
<resource-root path="spring-expression-3.2.4.RELEASE.jar" />
<resource-root path="spring-web-3.2.4.RELEASE.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.servlet.api" />
<module name="javax.transaction.api" />
<module name="org.apache.commons.logging" />
</dependencies>
</module>
我不确定这是否是JBoss中根深蒂固的类加载错误.
I'm not sure if this is a class-loading bug deep down in JBoss or not.
这篇关于JBoss AS 7.2无法确定实现类名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!