3 Replies Latest reply on Oct 6, 2011 3:51 PM by M Mudu

    Jboss AS6 unable to call webservices

    M Mudu Newbie

      Hi,

       

      I have just received a new WSDL file (https://sec.paymentexpress.com/WSV1/PXWS.asmx?WSDL), from DPS a payment gateway and I have created some Java files with it.  These files are then used by my application inside JBoss 6 to invoke the payment gateway and process transaction payments.

       

      I have downloaded Jaxws-ri-2.2.5 from http://jax-ws.java.net/2.2.5/ and used the jaxws-tools.jar to generate these java files using the wsimport ANT task.

       

      Every file I generated has the jaxws correct version:

       

      {code}

      /**

      * This class was generated by the JAX-WS RI.

      * JAX-WS RI 2.2.5-b01

      * Generated source version: 2.2

      *

      */

      {code}

       

      Here are some info about Java in the Jboss boot.log:

       

      {code}

      Java version: 1.6.0_26,Sun Microsystems Inc.

      Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

      Java VM: Java HotSpot(TM) 64-Bit Server VM 20.1-b02,Sun Microsystems Inc.

      OS-System: Linux 2.6.38-11-generic,amd64

      {code}

       

      When I try to make a dummy payment I get the error below?

       

      {code}

      2011-09-28 12:05:37,288 ERROR [com.mySite.amf.mySite] (ajp-127.0.0.1-8009-8) Fatal server error +

      : java.lang.reflect.UndeclaredThrowableException

                at $Proxy417.creditCardPayment(Unknown Source)          at com.mySite.amf.mySite.creditCardPayment(mySite.java:2308) [:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]

                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]

                at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:406) [:3.0.0.544]

                at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183) [:3.0.0.544]

                at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1417) [:3.0.0.544]

                at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:878) [:3.0.0.544]

                at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121) [:3.0.0.544]

                at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158) [:3.0.0.544]

                at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:49) [:3.0.0.544]

                at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67) [:3.0.0.544]

                at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146) [:3.0.0.544]

                at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:274) [:3.0.0.544]

                at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:377) [:3.0.0.544]

                at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]

                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]

                at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]

                at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]

                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]

                at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]

                at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:504) [:6.0.0.Final]

                at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:437) [:6.0.0.Final]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]

                at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

      Caused by: org.jboss.serial.exception.SerializationException: Could not create instance of com.ctc.wstx.io.WstxInputLocation - com.ctc.wstx.io.WstxInputLocation

                at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:342) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:239) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273) [:6.0.0.Final]

                at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82) [:6.0.0.Final]

                at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845) [:6.0.0.Final]

                at org.jboss.serial.io.MarshalledObjectForLocalCalls.get(MarshalledObjectForLocalCalls.java:60) [:6.0.0.Final]

                at org.jboss.ejb3.remoting.IsLocalInterceptor.marshallOrPass(IsLocalInterceptor.java:117) [:1.7.17]

                at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:96) [:1.7.17]

                at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:75) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) [:1.0.1.GA]

                at $Proxy410.invoke(Unknown Source)          at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11]

                ... 37 more

      Caused by: java.lang.InstantiationException: com.ctc.wstx.io.WstxInputLocation

                at java.lang.Class.newInstance0(Class.java:340) [:1.6.0_26]

                at java.lang.Class.newInstance(Class.java:308) [:1.6.0_26]

                at org.jboss.serial.classmetamodel.ClassMetaData.newInstance(ClassMetaData.java:334) [:6.0.0.Final]

                ... 81 more

       

      {code}

       

      The com.ctc.wstx.io.WstxInputLocation is a class in the woodstox.jar that came with JAX-WS RI 2.2.5. I understand the InstantiationException:

       

      Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated.  The instantiation can fail for a variety of reasons including but not limited to: 

      • the class object represents an abstract class, an interface, an array class, a primitive type, or void
      • the class has no nullary constructor

       

      but I do not know how to prevent this error from occurring.  The woodstox.jar is in myApp.ear file.

       

      Any suggestions?

       

      Thanks

       

      Max

        • 1. Re: Jboss AS6 unable to call webservices
          Jim Ma Apprentice

          If you don't have to use jaxws-ri-2.2.5 , you can try to use wsimport tool, jbossws-native implemeantion which shipped in JBoss6 to generate code and invoke this payment webservice.

          • 2. Re: Jboss AS6 unable to call webservices
            mbohnen Newbie

            Have you  checked whether you get the wsdl file? We got pretty much the same error:

             

            ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/jmx-console].[HtmlAdaptor]] Servlet.service() for servlet HtmlAdaptor threw exception: java.lang.InstantiationException: com.ctc.wstx.io.WstxInputLocation

                      at java.lang.Class.newInstance0(Class.java:340) [:1.6.0_20]

            ...

             

            and figured out (using wireshark) that the content length of the initial request to get the wsdl file was 0. It was turning us mad as we got the file using a browser but weren't able to get it programatically ...

             

            Regards

            M.

            • 3. Re: Jboss AS6 unable to call webservices
              M Mudu Newbie

              I have used the jbossws-native imlementation that comes with JBoss6 to generate the code and one of the generated files does not even compile.

               

              It turns out that we were sending the wrong username and password with each payment transaction.

               

              This issue is resolved.

               

              Thanks everyone.