Jboss 7.1.1最终无法创建Web服务客户端

时间:2014-02-27 01:38:11

标签: spring web-services maven jboss7.x

我使用带有工件maven-jaxws-tools-plugin和目标wsconsume的maven创建了一个ws客户端。

一旦我尝试启动客户端,我就会出现以下错误。

03:25:03,928 ERROR [org.quartz.core.JobRunShell] (quartzScheduler_Worker-1) Job DEFAULT.rcdLogTrackerJobDetail threw an unhandled Exception: : java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
        at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120)
        at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54)
        at org.jboss.wsf.stack.cxf.client.ProviderImpl.setValidThreadDefaultBus(ProviderImpl.java:213)
        at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:140)
        at javax.xml.ws.Service.<init>(Service.java:57) [jboss-jaxws-api_2.2_spec-2.0.0.Final.jar:2.0.0.Final]
       .....
        at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) [spring-context-support-3.1.2.RELEASE.jar:3.1.2.RELEASE]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:223) [quartz-1.8.6.jar:]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) [quartz-1.8.6.jar:]
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @4f2c61fe (roots: /opt/extcomp/jboss-as-7.1.1.Final/modules)]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
        ... 14 more

03:25:03,949 ERROR [org.quartz.core.ErrorLogger] (quartzScheduler_Worker-1) Job (DEFAULT.rcdLogTrackerJobDetail threw an exception.: org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:234) [quartz-1.8.6.jar:]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) [quartz-1.8.6.jar:]
Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/BeansException
        at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120)
        at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54)
        at org.jboss.wsf.stack.cxf.client.ProviderImpl.setValidThreadDefaultBus(ProviderImpl.java:213)
        at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:140)
        at javax.xml.ws.Service.<init>(Service.java:57) [jboss-jaxws-api_2.2_spec-2.0.0.Final.jar:2.0.0.Final]
       .....
        at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) [spring-context-support-3.1.2.RELEASE.jar:3.1.2.RELEASE]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:223) [quartz-1.8.6.jar:]
        ... 1 more
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.BeansException from [Module "org.apache.cxf:main" from local module loader @4f2c61fe (roots: /opt/extcomp/jboss-as-7.1.1.Final/modules)]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
        ... 14 more

我做了一些搜索,看到有一个JBoss 7.1.1的错误,可以通过做一些手动的东西来修复;创建一个新模块并将其添加到apache cxf模块等。

我做了所有这些事情。但无法让它发挥作用。

有人可以帮助我,如果我做错了什么。

顺便说一下;由于客户端是使用wsconsume创建的,我还尝试将模块依赖项(由我创建的spring模块)添加到jboss cxf的东西中。但没有奏效。

4 个答案:

答案 0 :(得分:3)

我想我发现了这个问题。这是我手动创建的弹簧模块上的拼写错误

我不确定是否需要将此视为答案,但问题是错字。

我遵循的解决方案是。

<德尔> http://blog.brunoborges.com.br/2012/06/jboss-711-and-cxf-ws-client.html

当然,您需要在遵循上述指南的同时使用正确的jar版本。

答案 1 :(得分:3)

@Olgum指出的 post 非常好并帮助我。但是,module.xml的链接已被破坏。因此,为了将来保留它,我将在下面发布解决方案。

  1. 在jboss-as-7.1.1-Final文件夹([JBOSS_HOME])上,创建此路径:modules/org/springframework/spring/main
  2. 在新创建的文件夹
  3. 中创建module.xml文件(如下)
  4. 下载并将jar文件放入同一文件夹(jar列表在module.xml中)
  5. 打开此文件[JBOSS_HOME]/modules/org/apache/cxf/main/module.xml
  6. 在此文件的末尾,请确保您具有此模块依赖关系<module name="org.springframework.spring" />
  7. Spring module.xml内容:

    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.1" name="org.springframework.spring">
        <resources>
            <resource-root path="spring-aop-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-asm-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-beans-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-context-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-context-support-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-core-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-expression-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-jdbc-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-orm-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-oxm-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-tx-3.1.4.RELEASE.jar"/>
            <resource-root path="spring-web-3.1.4.RELEASE.jar"/>
        </resources>
        <dependencies>
            <module name="javax.api"/>
            <module name="javax.jms.api"/>
            <module name="javax.annotation.api"/>
            <module name="javax.servlet.api"/>
            <module name="org.apache.commons.logging"/>
            <module name="org.jboss.vfs"/>
        </dependencies>
    </module>
    

答案 2 :(得分:0)

在实例化Web服务客户端时遇到了同样的错误,但我无法更改JBoss模块(公司环境)。这个问题花了我的一天,但我最终通过在SELECT PUB.oa_inthed.intid, PUB.oa_inthed.adcode As Address_Code, PUB.oa_intnom."due-date" As Commitment_Due_Date, PUB.oa_inthed.company As Company, PUB.oa_intnom.costcentre As Cost_Code, PUB.oa_inthed.currency As Currency, PUB.oa_inthed.description As Description, PUB.oa_inthed.docdate As Document_Date, PUB.oa_inthed."doc-id" As Document_Type, PUB.oa_intnom.expensecode As Expense_Code, PUB.oa_inthed.posted As "Posted?", PUB.oa_inthed.srcaccount As Source_Account, PUB.oa_inthed.docval As Value_Cur, PUB.oa_inthed.period As Period, PUB.oa_inthed.stat As Status FROM PUB.oa_inthed INNER JOIN PUB.oa_intnom ON PUB.oa_intnom.intid = PUB.oa_inthed.intid INNER JOIN PUB.oa_intextra ON PUB.oa_intextra.intid = PUB.oa_intnom.intid INNER JOIN ( SELECT PUB.oa_inthed.intid FROM PUB.oa_inthed GROUP BY PUB.oa_inthed.intid ) AS _aa ON PUB.oa_inthed.intid = _aa.PUB.oa_inthed.intid WHERE PUB.oa_inthed.company = 01 AND PUB.oa_inthed.intid = 'XM618197%' AND PUB.oa_intextra.rectype = 'REQHEAD' 版本2.7.4中添加依赖项来解决它。

cxf-rt-frontend-jaxws

希望它有所帮助。

答案 3 :(得分:0)

Julian的解决方案使我朝着正确的方向前进,但是仍然缺少依赖关系,通过查看此解决方案可以解决这些依赖关系:

Apache CXF Exception: java.lang.RuntimeException: Could not find conduit initiator for address

因此,我在pom中添加了以下内容:

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http-jetty</artifactId>
        <version>${cxf.version}</version>
    </dependency>