Java 无法从Jboss7中运行的webservice客户端调用webservice方法

Java 无法从Jboss7中运行的webservice客户端调用webservice方法,java,web-services,wsdl,jboss7.x,Java,Web Services,Wsdl,Jboss7.x,我很难在JBoss7.3.0中运行一些代码,请参阅下面的版本,以调用JBoss中未运行的web服务。我得到如下所示的错误 我几乎在任何地方都在寻找解决方案,所以任何舵手都会非常感激 我使用JBOSS_HOME\bin\wsconsumer.bat工具生成了@WebServiceClient java类。我使用的技术是将URL和QName对象传递给@WebServiceClient类的构造函数。我可以看到,代码能够使用http://地址从URL读取wsdl,但正如您在下面的异常中所看到的,它无法看

我很难在JBoss7.3.0中运行一些代码,请参阅下面的版本,以调用JBoss中未运行的web服务。我得到如下所示的错误

我几乎在任何地方都在寻找解决方案,所以任何舵手都会非常感激

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

我已经通过运行一个独立的java应用程序来验证代码是否在JBoss之外工作,该应用程序可以执行相同的操作,并且可以连接到webservice,调用该方法并读取响应

我也注意到了一些有趣的事情,如果我关闭Web服务,然后更改代码以从本地存储在fileyetem URL of file://而不是http://上的wsdl副本读取wsdl,那么会产生相同的错误,这对我来说很奇怪,几乎就好像JBoss不允许建立到webservice的传出连接一样。当webservice正在运行并且代码被还原为使用http URL时,JBoss似乎能够读取wsdl。日志显示web方法已从wsdl读取,但未连接到webservice

版本:

JBoss:EAP6.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

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

有关注释扫描的更多信息,请参见我前面的问题:
我发现了问题所在。JBoss7只扫描部署的EAR中类中的注释。我使用JBOSS_HOME\bin\wsconsome.bat为wsdl生成了java类,并将.class文件放入一个jar中,该jar放在ear引用的模块中。当我从modules目录中删除jar并将其放入ear中的lib目录时,这就解决了这个问题

有关注释扫描的更多信息,请参见我前面的问题:

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

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

您还可以向模块中添加配置,以便jboss按照此处的指定扫描模块中的注释。您还可以向模块中添加配置,以便jboss根据需要扫描模块中的注释此处指定