Announcement Announcement Module
Collapse
No announcement yet.
Axis deserializer cannot be found Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Axis deserializer cannot be found

    Greetings.

    I've just spent several hours trying to solve the problem with not being able to deserialize an XML response on the client side.

    I successfully deployed an Axis service, and am able to invoke findSchoolByName method, which returns a valid XML message (I intercepted and verified it using TCPMonitor). However, the client throws the following error:
    org.xml.sax.SAXException: Deserializing parameter 'findSchoolByNameReturn': could not find deserializer for type {urn:dss.sww.com}School

    I followed the JPetStore example from Spring 1.2RC1. My client bean is declared as follows:
    <bean id="jaxRpcProxy" class="org.springframework.remoting.jaxrpc.JaxRpcP ortProxyFactoryBean">
    I also registered BeanMappingServicePostProcessor class, which implements JaxRpcServicePostProcessor, as the "servicePostProcessors" property of the client bean the same way it was done in JPetStore. The BeanMappingServicePostProcessor does kick in and register the type mappings, which can be seen from the stack trace at the end of this message.

    Please help me!

    Here is the XML response from the Axis service:

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <findSchoolByNameResponse xmlns="urn:dss.sww.com">
    <findSchoolByNameReturn>
    <name>Shkola</name>
    </findSchoolByNameReturn>
    </findSchoolByNameResponse>
    </soapenv:Body>
    </soapenv:Envelope>

    Below is the pertinent stack trace:

    Registered bean mapping for XMLType {urn:dss.sww.com}AModel with class com.sww.dss.domain.model.hibernate.AModel
    Registered bean mapping for XMLType {urn:dss.sww.com}School with class com.sww.dss.domain.model.hibernate.School
    2005-04-14 20:44:34,078: org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean,INFO,: Using JAX-RPC dynamic calls for JAX-RPC port [{urn:dss.sww.com}SchoolService]
    2005-04-14 20:44:34,250: org.springframework.aop.framework.DefaultAopProxyF actory,INFO,: CGLIB2 available: proxyTargetClass feature enabled
    Calling SchoolService 'jaxRpcProxy' with school name Shkola
    Using SchoolService: JAX-RPC proxy for port [SchoolService] of service [{urn:dss.sww.com}JaxRpcSchoolServiceService]
    2005-04-14 20:44:34,734: org.apache.axis.client.Call,ERROR,: Exception:
    org.xml.sax.SAXException: Deserializing parameter 'findSchoolByNameReturn': could not find deserializer for type {urn:dss.sww.com}School
    at org.apache.axis.message.RPCHandler.onStartChild(RP CHandler.java:273)
    at org.apache.axis.encoding.DeserializationContext.st artElement(DeserializationContext.java:1031)
    at org.apache.axis.message.SAX2EventRecorder.replay(S AX2EventRecorder.java:165)
    at org.apache.axis.message.MessageElement.publishToHa ndler(MessageElement.java:1140)
    at org.apache.axis.message.RPCElement.deserialize(RPC Element.java:238)
    at org.apache.axis.message.RPCElement.getParams(RPCEl ement.java:386)
    at org.apache.axis.client.Call.invoke(Call.java:2402)
    at org.apache.axis.client.Call.invoke(Call.java:2301)
    at org.apache.axis.client.Call.invoke(Call.java:1758)
    at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.performJaxRpcCall(JaxRpcPortClientIn terceptor.java:492)
    at org.springframework.remoting.jaxrpc.JaxRpcPortClie ntInterceptor.invoke(JaxRpcPortClientInterceptor.j ava:451)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :144)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:174)
    at $Proxy0.findSchoolByName(Unknown Source)
    at com.sww.dss.service.client.SchoolServiceClient.inv okeSchoolServices(SchoolServiceClient.java:46)
    at com.sww.dss.service.client.SchoolServiceClient.mai n(SchoolServiceClient.java:74)

  • #2
    After several hours of trying I still can't get my Axis client to work with my web service unsing WRAPPED style. Once I switched to rpc/encoded it started working.

    Has anyone gotten an Axis client to work with a web service, which uses WRAPPED style?

    Do I need to register my type mappings differently if I use wrapped style?

    Thanks.

    Comment


    • #3
      I'm also having the same problem with JaxRpcPortProxyFactoryBean for web services that work with rpc/encoded, but don't for wrapped/literal. From looking at what Axis's WSDL2Java tool generates, the type mapping code for wrapped/literal is different than that of rpc/encoded. I'd also like to know what a JaxRpcServicePostProcessor would look like for a wrapped/literal Axis web service.

      Comment


      • #4
        Same here...

        I'm having the same problem... I've been bugging the Apache Axis people with it, but I'm thinking it might be a Spring problem.

        Mine was actually working with Spring 1.2-rc1 and Axis 1.1 on JDK1.4, but when I wanted to move up to JDK5 I had to also upgrade to Axis 1.2RC3. I've found and fixed a couple of bugs in their Call class, but now it comes down to type mappings.

        With "literal" the encodingStyle is nulled out by Axis, so it can't be used to loo up the type mappings registered by my proxy factory bean. The Axis binding stub does this for type conversion:

        Code:
        org.apache.axis.description.OperationDesc oper;
                oper = new org.apache.axis.description.OperationDesc&#40;&#41;;
                oper.setName&#40;"GetWeatherInfo"&#41;;
                oper.addParameter&#40;new javax.xml.namespace.QName&#40;"http&#58;//ejse.com/WeatherService/", "zipCode"&#41;, new javax.xml.namespace.QName&#40;"http&#58;//www.w3.org/2001/XMLSchema", "int"&#41;, int.class, org.apache.axis.description.ParameterDesc.IN, false, false&#41;;
                oper.setReturnType&#40;new javax.xml.namespace.QName&#40;"http&#58;//ejse.com/WeatherService/", "WeatherInfo"&#41;&#41;;
                oper.setReturnClass&#40;com.eplus.app.service.bind.weather.WeatherInfo.class&#41;;
                oper.setReturnQName&#40;new javax.xml.namespace.QName&#40;"http&#58;//ejse.com/WeatherService/", "GetWeatherInfoResult"&#41;&#41;;
                oper.setStyle&#40;org.apache.axis.constants.Style.WRAPPED&#41;;
                oper.setUse&#40;org.apache.axis.constants.Use.LITERAL&#41;;
                _operations&#91;0&#93; = oper;
        and later puts this OpertationDesc object into a new Call instance so the call knows explicitly the type conversion. This is different from the way Spring's example shows:

        Code:
        public class WeatherServiceJaxRpcProxyFactoryBean extends JaxRpcPortProxyFactoryBean &#123;
            protected void postProcessJaxRpcService&#40;Service service&#41; &#123;
                TypeMappingRegistry tmr = service.getTypeMappingRegistry&#40;&#41;;
                TypeMapping tm = tmr.createTypeMapping&#40;&#41;;
        
                registerMapping&#40;tm, "WeatherInfo", WeatherInfo.class&#41;;
                registerMapping&#40;tm, "ExtendedWeatherInfo", ExtendedWeatherInfo.class&#41;;
                registerMapping&#40;tm, "DayForecastInfo", DayForecastInfo.class&#41;;
                registerMapping&#40;tm, "NineDayForecastInfo", NineDayForecastInfo.class&#41;;
                registerMapping&#40;tm, "ForecastDays", ForecastDays.class&#41;;
                registerMapping&#40;tm, "IraqCities", IraqCities.class&#41;;
                tmr.register&#40;org.apache.axis.Constants.URI_SOAP11_ENC, tm&#41;;
            &#125;
        
            private void registerMapping&#40;TypeMapping tm, String name, Class clazz&#41; &#123;
                QName qname = new QName&#40;"http&#58;//ejse.com/WeatherService/",name&#41;;
        
                tm.register&#40;clazz,qname,
                        new BeanSerializerFactory&#40;clazz, qname&#41;,
                        new BeanDeserializerFactory&#40;clazz, qname&#41;&#41;;
            &#125;
        &#125;

        I'd really like to get this working, if anyone has any ideas...

        Comment


        • #5
          Re: Same here...

          Helloooo????!

          Can a maintainer of the Spring Remoting code maybe try out an example of using the Spring JaxRpcProxyFactoryBean using Axis 1.2RC3 and a "literal" web service type? Using JDK5 would be nice, but not required...

          Comment


          • #6
            Well, since no-one from Spring can bother...

            I got this working... Instead of this:

            tmr.register(org.apache.axis.Constants.URI_SOAP11_ ENC, tm);

            I used this for my literal-encoded web service:

            tmr.register("", tm);

            and it works.

            Comment


            • #7
              I have a few web service methods that work (of "literal" type). But I have one that has an array of beans as return type. When I call this method it executes successfully on the server side, then when the client is handling the response it throws this exception:

              Code:
              java.lang.ClassCastException&#58; java.util.ArrayList
              	at $Proxy0.loadBookmarkList&#40;Unknown Source&#41;
              	at sun.reflect.NativeMethodAccessorImpl.invoke0&#40;Native Method&#41;
              	at sun.reflect.NativeMethodAccessorImpl.invoke&#40;NativeMethodAccessorImpl.java&#58;39&#41;
              	at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;DelegatingMethodAccessorImpl.java&#58;25&#41;
              	at java.lang.reflect.Method.invoke&#40;Method.java&#58;585&#41;
              	at org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke&#40;RmiClientInterceptorUtils.java&#58;98&#41;
              	at org.springframework.remoting.rmi.RmiClientInterceptorUtils.invoke&#40;RmiClientInterceptorUtils.java&#58;71&#41;
              	at org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.invoke&#40;JaxRpcPortClientInterceptor.java&#58;442&#41;
              	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;144&#41;
              	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke&#40;JdkDynamicAopProxy.java&#58;174&#41;
              	at $Proxy1.loadBookmarkList&#40;Unknown Source&#41;
              	at com.myconnector.client.BkMethods.start&#40;BkMethods.java&#58;51&#41;
              Here's a snippet from typemapping code:
              Code:
              	public void postProcessJaxRpcService&#40;Service service&#41; &#123;
              		TypeMappingRegistry registry = service.getTypeMappingRegistry&#40;&#41;;
              		TypeMapping mapping = registry.createTypeMapping&#40;&#41;;
                      registerBeanMapping&#40;mapping, BookmarkDTO.class, "BookmarkDTO"&#41;;
                      registry.register&#40;"", mapping&#41;;
              	&#125;
              
              	protected void registerBeanMapping&#40;TypeMapping mapping, Class type, String name&#41; &#123;
              		QName xmlType = new QName&#40;this.typeNamespaceUri, name&#41;;
              		mapping.register&#40;type, xmlType,
              		    new BeanSerializerFactory&#40;type, xmlType&#41;,
              		    new BeanDeserializerFactory&#40;type, xmlType&#41;&#41;;		
              	&#125;
              The method I am calling is returning BookmarkDTO[]

              Has anyone got passing/returning array of beans (or a bean that has an array of beans in it) to work for doc/literal?

              For now, I am just using Axis generated proxy classes (which works). But using Spring's support so that I can just use my interface and beans already defined (without having to generate code) is a nice ideal.

              Comment


              • #8
                ClassCastException with JaxRpcProxyFactoryBean

                Hi,

                I am having similar problem, any solution will be very useful.

                Regards
                Manish

                Originally posted by nilesh
                I have a few web service methods that work (of "literal" type). But I have one that has an array of beans as return type. When I call this method it executes successfully on the server side, then when the client is handling the response it throws this exception:

                Code:
                java.lang.ClassCastException&#58; java.util.ArrayList
                	at $Proxy0.loadBookmarkList&#40;Unknown Source&#41;
                	at sun.reflect.NativeMethodAccessorImpl.invoke0&#40;Native Method&#41;
                	at sun.reflect.NativeMethodAccessorImpl.invoke&#40;NativeMethodAccessorImpl.java&#58;39&#41;
                	at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;DelegatingMethodAccessorImpl.java&#58;25&#41;
                	at java.lang.reflect.Method.invoke&#40;Method.java&#58;585&#41;
                	at org.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke&#40;RmiClientInterceptorUtils.java&#58;98&#41;
                	at org.springframework.remoting.rmi.RmiClientInterceptorUtils.invoke&#40;RmiClientInterceptorUtils.java&#58;71&#41;
                	at org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.invoke&#40;JaxRpcPortClientInterceptor.java&#58;442&#41;
                	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;144&#41;
                	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke&#40;JdkDynamicAopProxy.java&#58;174&#41;
                	at $Proxy1.loadBookmarkList&#40;Unknown Source&#41;
                	at com.myconnector.client.BkMethods.start&#40;BkMethods.java&#58;51&#41;
                Here's a snippet from typemapping code:
                Code:
                	public void postProcessJaxRpcService&#40;Service service&#41; &#123;
                		TypeMappingRegistry registry = service.getTypeMappingRegistry&#40;&#41;;
                		TypeMapping mapping = registry.createTypeMapping&#40;&#41;;
                        registerBeanMapping&#40;mapping, BookmarkDTO.class, "BookmarkDTO"&#41;;
                        registry.register&#40;"", mapping&#41;;
                	&#125;
                
                	protected void registerBeanMapping&#40;TypeMapping mapping, Class type, String name&#41; &#123;
                		QName xmlType = new QName&#40;this.typeNamespaceUri, name&#41;;
                		mapping.register&#40;type, xmlType,
                		    new BeanSerializerFactory&#40;type, xmlType&#41;,
                		    new BeanDeserializerFactory&#40;type, xmlType&#41;&#41;;		
                	&#125;
                The method I am calling is returning BookmarkDTO[]

                Has anyone got passing/returning array of beans (or a bean that has an array of beans in it) to work for doc/literal?

                For now, I am just using Axis generated proxy classes (which works). But using Spring's support so that I can just use my interface and beans already defined (without having to generate code) is a nice ideal.

                Comment


                • #9
                  Hello, everybody (please have a look at my stacktrace)
                  I have similar problems, the first thing I want to look at is how to change rpc/encoded, to wrapped/literal (or the opposite)?
                  Any help would be awesome!!
                  Cheers

                  Nicolas

                  Code:
                  org.xml.sax.SAXException: Deserializing parameter 'createUserReturn':  could not find deserializer for type {http://beans.soap.rpc.jira.atlassian.com}RemoteUser at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)
                          at org.apache.axis.encoding.DeserializationContext.startElement(Deserial
                  izationContext.java:1035)
                          at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
                  va:165)
                          at org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
                  t.java:1141)
                          at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
                          at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
                          at org.apache.axis.client.Call.invoke(Call.java:2467)
                          at org.apache.axis.client.Call.invoke(Call.java:2366)
                          at org.apache.axis.client.Call.invoke(Call.java:1812)
                  I have a class that extends JaxRpcPortProxyFactoryBean that contains those methods.

                  Code:
                    public void postProcessJaxRpcService(Service service) {
                          log.debug("TRACING postProcessJaxRpcService ----------------");
                          TypeMappingRegistry registry = service.getTypeMappingRegistry();
                          TypeMapping mapping = registry.createTypeMapping();
                          registerBeanMapping(mapping, RemoteUser.class, "RemoteUser");
                          registry.register(this.encodingStyleUri, mapping);
                      }
                  Code:
                      protected void registerBeanMapping(TypeMapping mapping, Class type, String name) {
                          QName xmlType = new QName(this.typeNamespaceUri, name);
                          mapping.register(type, xmlType,
                              new BeanSerializerFactory(type, xmlType),
                              new BeanDeserializerFactory(type, xmlType));
                      }

                  Comment


                  • #10
                    Ok, I think I fixed the issue. It was a namespace issue (and had nothing to do with Spring in the first place.

                    In my postProcessJaxRpcService method the "this.typeNamespaceUri" variable pointed to "http://localhost:8081/rcp/soap..." instead of "http://beans.soap.rpc.jira.atlassian.com" as required... ({http://beans.soap.rpc.jira.atlassian.com}RemoteUser)

                    Thanks

                    Nicolas

                    Comment


                    • #11
                      Same old -could not find deserializer problem

                      Hi All,
                      I have a axis webservice deployed with UserDefined Object as input parameter to one of the methods. I used wsdl2java to create proxy/stub files. The client is working fine having wsdl2java generated proxy/stub files in the Classpath. But, when try to invoke thru Spring jaxrpc client. i get the deserializer not found exception. Error is
                      could not find deserializer for type {http://www.txyz.com/cart/ws}Cart

                      I dont think there is a problem with the WSDL as its working fine with wsdl2java generated files..

                      I have created a custom class for mapping the POJO as below,

                      public class CartProxyFactoryBean extends JaxRpcPortProxyFactoryBean
                      {

                      protected void postProcessJaxRpcService(Service service)
                      {
                      TypeMappingRegistry registry = service.getTypeMappingRegistry();
                      TypeMapping mapping = registry.createTypeMapping();
                      registerBeanMapping(mapping, com.mydomain.cart.types.Cart.class, "Cart");
                      registry.register("http://schemas.xmlsoap.org/soap/encoding/", mapping);
                      }

                      protected void registerBeanMapping(TypeMapping mapping, Class type, String name)
                      {
                      QName qName = new QName("http://<<servername>>:7002/cart/CartService", name);
                      mapping.register(type, qName,
                      new BeanSerializerFactory(type, qName),
                      new BeanDeserializerFactory(type, qName));
                      }

                      }

                      Can anyone help in this regard? I am bugged with this Exception after trying for long time..

                      Thanks in Advance,,
                      sep.

                      Comment


                      • #12
                        Hi,

                        I'm also having a "Axis Deserializer cannot be found".

                        I was working with spring-1.2.7 and everything was fine.
                        Then I switch to spring-2.0RC4. Only this jar switching implied that my unit test on webservice query return a Deserializer not found.

                        Is there a known issue on the 2.0 branch ?
                        I don't see any relevant information in changelog nor in JIRA.

                        Any help will be appreciated.

                        Thanks

                        Steph

                        Comment


                        • #13
                          Sorry for this up.

                          I'm still searching by myself any good reason why my webservice client failed to find a deserializer when working with spring-2.0 branch (M4 for my last last attempt) as it work good with the 1.2 branch (1.2.8 currently in production), but I can't find any.

                          Does someone has any idea of what append?

                          I'd like to switch shortly to spring 2.0 branch, but I have to fix that point and I realy don't know what to do now.

                          Thanks for help

                          Steph

                          Comment


                          • #14
                            Spring 2 bug?

                            I have the same problem, when use spring-framework-2.0 i retrive a error during the call of my web service: "Deserializer cannot be found"
                            When switch with Spring-1.2.7 everything work fine.

                            I've try with the combination of Axis 1.3, Axis 1.4, Jdk 1.4, Jdk 1.5 on Tomcat 5.0.28

                            The problem is Spring 2, is bugged!





                            Originally posted by Proner View Post
                            Hi,

                            I'm also having a "Axis Deserializer cannot be found".

                            I was working with spring-1.2.7 and everything was fine.
                            Then I switch to spring-2.0RC4. Only this jar switching implied that my unit test on webservice query return a Deserializer not found.

                            Is there a known issue on the 2.0 branch ?
                            I don't see any relevant information in changelog nor in JIRA.

                            Any help will be appreciated.

                            Thanks

                            Steph

                            Comment


                            • #15
                              I alm also facing the same problem.... Could someone please tell us if this is indeed a Spring 2.0 bug and also if there is any known workaround?


                              BTJ

                              Comment

                              Working...
                              X