无法从Jboss 7中运行的Web服务客户端调用webservice方法

时间:2014-06-06 16:56:51

标签: java web-services wsdl jboss7.x

我无法在JBoss 7.3.0中运行一些代码(请参阅下面的版本)来调用未在JBoss中运行的Web服务。我收到错误,如下所示。

我已经在各地寻找解决方案,所以任何操纵者都会受到高度赞赏。

我使用JBOSS_HOME \ bin \ wsconsume.bat工具生成了@WebServiceClient java类。我使用的技术是将URL和QName对象传递给@WebServiceClient类的构造函数。我可以看到代码能够从URL读取wsdl(使用http://地址),但正如您在下面的例外中所看到的,它无法看到方法。

我已经验证了代码在JBoss之外工作,运行一个独立的Java应用程序来执行相同的操作,它可以连接到webservice,调用方法并读取响应。

我注意到了一些有趣的事情,如果我关闭了webservice,然后更改代码,从filesyetem本地存储的wsdl副本中读取wsdl(文件的URL:/而不是http://),然后产生了同样的错误,这对我来说似乎很奇怪,几乎就像JBoss不允许进行到web服务的传出连接一样。当webservice正在运行(并且代码被还原为使用http URL)时,看起来JBoss能够读取wsdl(日志记录显示已经从wsdl读取了web方法)但是没有连接到webservice。

版本:

JBoss:EAP 6.2.0.GA(基于AS 7.3.0构建) Java:1.6.0_45

此处显示例外情况:

    13:14:02,451 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) Creating Service {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}FR_MXWOWS from WSDL: file:/Dimensions/NIW_DEV/niw/ext/src/main/resources/wsdl/MockMaximoService.wsdl
    13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}UpdateFR_MXWO.
    13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}CreateFR_MXWO.
    13:14:02,541 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}DeleteFR_MXWO.
    13:14:02,551 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}SyncFR_MXWO.
    13:14:02,551 WARNING [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) No method was found for the WSDL operation {http://www.ibm.com/maximo/wsdl/FR_MXWOWS}QueryFR_MXWO.
    13:14:03,203 DEBUG [com.amtsybex.dts.core.brp.ExtendedRuleClassLoader] (Thread-4 (HornetQ-client-global-threads-1486295624)) findClass:[com.amtsybex.dts.niw.rules.DummyRule$$anonfun$execute$5]
    13:14:03,203 INFO  [com.amtsybex.dts.niw.rules.DummyRule] (Thread-4 (HornetQ-client-global-threads-1486295624)) got the port
    13:14:03,203 ERROR [com.amtsybex.dts.ejb3.BRPBean] (Thread-4 (HornetQ-client-global-threads-1486295624)) Failed while processing file:[182] exception:[com.amtsybex.dts.core.DtsInternalException: javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method createFRMXWO.]; handing off to component error handler
    13:14:03,213 INFO  [com.amtsybex.dts.core.jms.BackoffComponentErrorHandler] (Thread-4 (HornetQ-client-global-threads-1486295624)) Error type:[com.amtsybex.dts.core.DtsInternalException] will be consumed
    13:14:03,213 ERROR [com.amtsybex.dts.core.jms.BackoffComponentErrorHandler] (Thread-4 (HornetQ-client-global-threads-1486295624)) Consuming exception: com.amtsybex.dts.core.DtsInternalException: javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method createFRMXWO.
        at com.amtsybex.dts.core.brp.ScalaBrpService.executeRules(ScalaBrpService.java:86) [marketflow-api-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        at com.amtsybex.dts.core.brp.AbstractBrpComponent.executeRules(AbstractBrpComponent.java:30) [marketflow-api-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        at com.amtsybex.dts.ejb3.BRPBean.processFile(BRPBean.java:50) [marketflow-ejb30-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        at com.amtsybex.dts.ejb3.AbstractDtsMessageDrivenBean.doDtsProcessing(AbstractDtsMessageDrivenBean.java:160) [marketflow-ejb30-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        at com.amtsybex.dts.ejb3.AbstractDtsMessageDrivenBean.onMessage(AbstractDtsMessageDrivenBean.java:99) [marketflow-ejb30-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_45]
        at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_45]
        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:250) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:341) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:238) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:203) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at javax.jms.MessageListener$$$view19.onMessage(Unknown Source) [jboss-jms-api_1.1_spec-1.0.1.Final-redhat-2.jar:1.0.1.Final-redhat-2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_45]
        at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_45]
        at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:140) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
        at com.sun.proxy.$Proxy23.onMessage(Unknown Source)
        at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:328)
        at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1117)
        at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:57)
        at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1252)
        at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:107)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]
    Caused by: javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method createFRMXWO.
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
        at com.sun.proxy.$Proxy57.createFRMXWO(Unknown Source)
        at com.amtsybex.dts.niw.rules.DummyRule.execute(DummyRule.scala:54)
        at com.amtsybex.dts.core.brp.ScalaBrpService.executeRules(ScalaBrpService.java:102) [marketflow-api-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        at com.amtsybex.dts.core.brp.ScalaBrpService.executeRules(ScalaBrpService.java:53) [marketflow-api-JBOSS_PORT.1.1.jar:JBOSS_PORT.1.1]
        ... 65 more

2 个答案:

答案 0 :(得分:5)

我发现了问题所在。 JBoss7仅扫描已部署耳内的类中的注释。我已经为wsdl生成了java类(使用JBOSS_HOME \ bin \ wsconsome.bat)并将.class文件放入一个jar中,我放在一个耳朵引用的模块中。当我从模块目录中删除jar并将其放入耳内的lib目录时,这解决了这个问题。

有关注释扫描的更多信息,请参阅我之前的一个问题: spring @PostConstruct not firing in JBoss7

答案 1 :(得分:1)

我从JaxWsProxyFactoryBean注册serviceClass实例化服务接口。 在WildFly 10中,我必须为javax.annotation.api添加依赖项(以识别注释)和javax.jws.api(以识别@WebService)。