org.apache.cxf.BusException:找不到名称空间http://schemas.xmlsoap.org/soap/http/的DestinationFactory

时间:2010-12-01 10:19:32

标签: jboss cxf jboss5.x jbossws

在wsdl文件中,我有以下一行:

当我部署webapplication(在JBOSS 5.1.0上)并尝试访问wsdl时,我得到以下异常:

org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http/.
 org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:115)
 org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85)
 org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
 org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:118)
 org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
 org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
 org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
 org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
 org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:597)
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413)
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
 java.security.AccessController.doPrivileged(Native Method)
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
 org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
 org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
 org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
 org.jboss.wsf.stack.cxf.CXFServletExt.loadAdditionalConfigExt(CXFServletExt.java:124)
 org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:101)
 org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:78)
 org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:73)
 org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
 org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 se.marakanda.jboss.LoginContextValve.invoke(LoginContextValve.java:44)
 org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 java.lang.Thread.run(Thread.java:619)

任何人都知道如何解决这个问题?

4 个答案:

答案 0 :(得分:6)

我遇到了同样的问题。并没有谷歌的东西是有道理的。在我的情况下,我发现我在spring上下文文件中缺少以下内容:

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

答案 1 :(得分:1)

如果您正在运行cxf 3.x但在类路径中有cxf 2.x jar,则可能会发生这种情况。找到你的罐子版本:

for fn in cxf*.jar; do echo $fn; unzip -p $fn *pom.xml | grep "<version>" | head -1; done;

答案 2 :(得分:0)

您是否正在进行wsdl首次开发并在WebService.wsdlLocation批注中指定wsdlLocation?

“http://schemas.xmlsoap.org/soap/http/”将与wsdl2java和很多东西一起使用。但是如果你使用wsdlLocation进行wsdl首次部署,那么它可能很挑剔而不像最后的额外斜杠。所以在你的wsdl中使用transport =“http://schemas.xmlsoap.org/soap/http”(最后没有斜线)。

答案 3 :(得分:0)

请添加

    <dependency>
       <groupId>org.apache.cxf</groupId>
       <artifactId>cxf-rt-transports-http</artifactId>
       <version>2.7.1</version>
    </dependency>

search maven