简体   繁体   中英

Cannot call webservice method from webservice client running in Jboss7

I am having trouble getting some code running in JBoss 7.3.0 (see version below) to call a web-service that is not running in JBoss. I get the error as shown below.

I have looked for solutions to this just about everywhere so any steers will be greatly appreciated.

I generated the @WebServiceClient java class using the the JBOSS_HOME\\bin\\wsconsume.bat tool. I am using the technique where I pass a URL and QName object to the constructor of the @WebServiceClient class. I can see that the code is able to read the wsdl from the URL (using an http:// address) but as you can see in the exception below, it is not able to see the methods.

I have verified that the code works outside of JBoss by running a standalone java app that does the same thing and it can connect to the webservice, call the method and read the response.

I noticed something interesting as well, if I shutdown the webservice, then change the code to read the wsdl from a copy of the wsdl stored locally on the filesyetem (URL of file:/ instead of http://) then the same error is produced, which seems very odd to me, almost as if JBoss is not allowing the outgoing connection to the webservice to be made. When the webservice is running (and the code is reverted to use the http URL) then it looks like JBoss is able to read the wsdl (the logging shows that the web methods have been read from the wsdl) but not connect to the webservice.

Versions:

JBoss: EAP 6.2.0.GA (built on AS 7.3.0) Java: 1.6.0_45

Exception is shown here:

    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

I found out what the problem was. JBoss7 only scans for annotations in classes within deployed ears. I had generated the java classes for the wsdl (using JBOSS_HOME\\bin\\wsconsome.bat) and put the .class files into a jar that I placed in a module which the ear referenced. When I removed the jar from the modules directory and put it into the lib directory within the ear, this fixed the problem.

See a previous question of mine for more on annotation scanning: spring @PostConstruct not firing in JBoss7

I instantiate the service interface from a JaxWsProxyFactoryBean with a registered serviceClass . In WildFly 10 I had to add dependencies for javax.annotation.api (to recognize annotations) and javax.jws.api (to recognize @WebService ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM