8 Replies Latest reply on Nov 9, 2004 1:16 AM by kyayu

    DII  client complains about serializer

    ilays

      Well its a very simple Ejb endpoint - serializing a simple pojo
      running a DII client that get this exception:
      i tried changing the serializer to the org.jboss.... instead of the apache
      one , but it didn't help...

      java.io.IOException: No serializer found for class com.alon.objects.Customer in registry org.apache.axis.encoding.TypeMappingImpl@17b1d64


      here by is the wsdd , wsdl, and SEI

      im really stuck here please help...

      wsdd:

      <deployment
       xmlns='http://xml.apache.org/axis/wsdd/'
       xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
       xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
       xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
       xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
      
      <service name='CustomerEchoService' style='document' use='literal' provider='Handler'>
      
       <parameter name='webservice-identifier' value='echoBean.jar#ServicePort' />
       <parameter name='handlerClass' value='org.jboss.webservice.server.InvokerProviderEJB' />
      
       <operation name='echoCustomer' qname='ns1:echoCustomer' returnQName='ns2:echoCustomerResponse' returnType='ns2:echoCustomerResponse' xmlns:ns1='http://com.alon/service' xmlns:ns2='http://com.alon/service/types' >
       <parameter name='parameters' qname='ns2:echoCustomer' mode='IN' type='ns2:echoCustomer' xmlns:ns2='http://com.alon/service/types' />
       </operation>
      
       <typeMapping
       qname='ns2:echoCustomer' xmlns:ns2='http://com.alon/service/types'
       type='java:com.alon.objects.Customer'
       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
       encodingStyle=''>
       </typeMapping>
      
      
      
       <typeMapping
       qname='ns2:echoCustomerResponse' xmlns:ns2='http://com.alon/service/types'
       type='java:com.alon.objects.Customer'
       serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
       deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
       encodingStyle=''>
       </typeMapping>
      
      
      </service>
      </deployment>



      wsdl:


      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="CustomerEchoService" targetNamespace="http://com.alon/service" xmlns:tns="http://com.alon/service" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://com.alon/service/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
       <types>
       <schema targetNamespace="http://com.alon/service/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://com.alon/service/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <complexType name="echoCustomer">
       <sequence>
       <element name="Customer_1" nillable="true" type="tns:Customer"/></sequence></complexType>
       <complexType name="Customer">
       <sequence>
       <element name="last" nillable="true" type="string"/>
       <element name="name" nillable="true" type="string"/></sequence></complexType>
       <complexType name="echoCustomerResponse">
       <sequence>
       <element name="result" nillable="true" type="tns:Customer"/></sequence></complexType>
       <element name="echoCustomer" type="tns:echoCustomer"/>
       <element name="echoCustomerResponse" type="tns:echoCustomerResponse"/></schema>
       </types>
       <message name="repeaterEndpoint_echoCustomer">
       <part name="parameters" element="ns2:echoCustomer"/>
       </message>
       <message name="repeaterEndpoint_echoCustomerResponse">
       <part name="result" element="ns2:echoCustomerResponse"/>
       </message>
       <portType name="repeaterEndpoint">
       <operation name="echoCustomer">
       <input message="tns:repeaterEndpoint_echoCustomer"/>
       <output message="tns:repeaterEndpoint_echoCustomerResponse"/>
       </operation>
       </portType>
       <binding name="repeaterEndpointBinding" type="tns:repeaterEndpoint">
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="echoCustomer">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       </binding>
       <service name="CustomerEchoService">
       <port name="repeaterEndpointPort" binding="tns:repeaterEndpointBinding">
       <soap:address location="http://localhost:8080/echoBean/CustomerEchoService"/>
       </port>
       </service>
      </definitions>


      SEI


      package com.alon.beans;
      
      import com.alon.objects.Customer;
      
      
      
      /**
       * @author Administrator
       *
       * TODO To change the template for this generated type comment go to
       * Window - Preferences - Java - Code Style - Code Templates
       */
      public interface repeaterEndpoint extends java.rmi.Remote {
      
       public Customer echoCustomer(Customer cust)throws java.rmi.RemoteException;
      }



      and the DII client:

      private static String WSDL_LOC = "http://localhost:8080/echoBean/CustomerEchoService?wsdl";
       private static String NAMESPACE = "http://com.alon/service";
       private static QName SERVICE_NAME= new QName(NAMESPACE,"CustomerEchoService");
      
       public static void main(String[] args) {
       try{
      
       ServiceFactory factory = ServiceFactory.newInstance();
       Service service = factory.createService(new URL(WSDL_LOC),SERVICE_NAME);
       Call call = (Call)service.createCall(new QName(NAMESPACE,"repeaterEndpointPort"),"echoCustomer");
       Customer c = new Customer("test","client");
       call.invoke(new Object[]{c});
      



        • 1. Re:  DII  client complains about serializer
          thomas.diesler

          The JAXRPC DII API is agnostic about ws4ee artifacts like the jaxrpc-mapping.xml.

          If you must use DII, try

          org.jboss.webservice.client.ServiceFactoryImpl factory = (org.jboss.webservice.client.ServiceFactoryImpl)ServiceFactory.newInstance();
          service.createService(wsdlLocation, mappingLocation, ws4eeMetaData, serviceName, portName)
          


          • 2. Re:  DII  client complains about serializer
            kyayu

            org.jboss.webservice.client.ServiceFactoryImpl factory = (org.jboss.webservice.client.ServiceFactoryImpl)ServiceFactory.newInstance();
            service.createService(wsdlLocation, mappingLocation, ws4eeMetaData, serviceName, portName)

            i try this , but get the result:

            [java] Load client configuration error : java.lang.IllegalArgumentException : hostname can't be null

            i don't give any null value.
            thanks for any reply.

            • 3. Re:  DII  client complains about serializer
              thomas.diesler

              Can you show us the stack trace?

              • 4. Re:  DII  client complains about serializer
                kyayu

                i upgrape my jboss to jboss4.0.1rc1, the problem is solved now, thanks to you kindly help.

                • 5. Re:  DII  client complains about serializer
                  thomas.diesler

                  UR welcome

                  • 6. Re:  DII  client complains about serializer
                    kyayu

                    Here i'm coming again, i got an another serializer problem. when i use java.util.Vector as a bean member type, i got the result below, my question is , is it unsupport in jbossWS ?

                    org.apache.axis.AxisFault: No serializer found for class java.util.Vector$1 in registry org.apache.axis.encoding.TypeMappingImpl@21f46a
                    at org.apache.axis.AxisFault.makeFault(AxisFault.java:138)
                    at org.apache.axis.MessagePart.writeTo(MessagePart.java:280)
                    at org.apache.axis.MessagePart.getAsString(MessagePart.java:565)
                    at org.apache.axis.MessagePart.getAsBytes(MessagePart.java:419)
                    at org.apache.axis.Message.getContentType(Message.java:473)
                    at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:1027)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
                    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
                    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoin

                    • 7. Re:  DII  client complains about serializer
                      kyayu

                      and another problem i encounter

                      i overloading three methods

                      getByCriteria(java.lang.Object identity, java.lang.String transactionId, java.lang.String databaseServiceName, java.lang.String tableName, CriteriaTO criteriaTO, int from, int count) ;

                      getByCriteria(java.lang.Object identity, java.lang.String transactionId, java.lang.String databaseServiceName, java.lang.String masterTableName, java.util.HashMap parameterMap, boolean isSingleModel, CriteriaTO criteriaTO, int from, int count)

                      getByCriteria(java.lang.Object identity, java.lang.String transactionId, java.lang.String databaseServiceName, java.lang.String tableName, java.lang.String[] columns, CriteriaTO criteriaTO, int from, int count)

                      jbossWS can't get the right method for me, but i check the wsdl and mapping file they do a great job. i show some snippet code

                      <java-method-name>getByCriteria</java-method-name>
                      <wsdl-operation>getByCriteria</wsdl-operation>

                      <java-method-name>getByCriteria</java-method-name>
                      <wsdl-operation>getByCriteria2</wsdl-operation>

                      <java-method-name>getByCriteria</java-method-name>
                      <wsdl-operation>getByCriteria3</wsdl-operation>

                      when i used a DII to call the getByCriteria3 signature method, i think there are bugs, i cut the error message:
                      [java] 2004-11-09 13:19:26,824 ERROR org.jboss.webservice.client.PortProxy[
                      WT-EventQueue-0] - Port error
                      [java] AxisFault
                      [java] faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.genera
                      Exception
                      [java] faultSubcode:
                      [java] faultString: Error invoking operation:
                      [java] javax.xml.rpc.JAXRPCException: Number of parameters passed in (8) do
                      sn't match the number of IN/INOUT parameters (9) from the addParameter() calls
                      [java] faultActor:
                      [java] faultNode:
                      [java] faultDetail:

                      [java] org.apache.axis.AxisFault: Error invoking operation:
                      [java] javax.xml.rpc.JAXRPCException: Number of parameters passed in (8) do
                      sn't match the number of IN/INOUT parameters (9) from the addParameter() calls
                      [java] at org.apache.axis.client.Call.invokeInternal(Call.java:1989)
                      [java] at org.apache.axis.client.Call.invoke(Call.java:1909)
                      [java] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:175

                      [java] at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy
                      java:373)
                      [java] at $Proxy3.getByCriteria(Unknown Source)
                      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
                      orImpl.java:39)
                      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
                      odAccessorImpl.java:25)
                      [java] at java.lang.reflect.Method.invoke(Method.java:324)
                      [java] at org.jboss.webservice.client.PortProxy.invoke(PortProxy.java:9
                      )
                      [java] at $Proxy3.getByCriteria(Unknown Source)
                      [java] at com.walsin.delegate.TableHandlerDelegate.getByCriteria(Unknow
                      Source)
                      [java] at com.walsin.ui.component.ComponentFactory.retrieveComboBoxItem
                      FromDataBase(Unknown Source)
                      [java] at com.walsin.ui.component.ComponentFactory.retrieveComboBoxItem
                      (Unknown Source)
                      [java] at com.walsin.ui.component.ComponentFactory.getComponentsByKey(U
                      known Source)
                      [java] at com.walsin.ui.component.ComponentFactory.getComponentsByKey(U
                      known Source)
                      [java] at com.walsin.ui.component.ComponentFactory.getComponentsByKey(U
                      known Source)
                      [java] at com.walsin.ui.component.WalsinJCriteriaPanel.jbInit(Unknown S
                      urce)
                      [java] at com.walsin.ui.component.WalsinJCriteriaPanel.(Unknown S
                      urce)
                      [java] at com.walsin.ui.jstock.stkc.STKC01PM.jbInit(Unknown Source)
                      [java] at com.walsin.ui.jstock.stkc.STKC01PM.(Unknown Source)
                      [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
                      Method)
                      [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
                      nstructorAccessorImpl.java:39)
                      [java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
                      gatingConstructorAccessorImpl.java:27)
                      [java] at java.lang.reflect.Constructor.newInstance(Constructor.java:27
                      )
                      [java] at com.walsin.ui.jstock.JStockPortal.executeCommand(Unknown Sour
                      e)
                      [java] at com.walsin.ui.jstock.JStockPortal.access$600(Unknown Source)
                      [java] at com.walsin.ui.jstock.JStockPortal$6.mouseClicked(Unknown Sour
                      e)
                      [java] at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster
                      java:212)
                      [java] at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster
                      java:211)
                      [java] at java.awt.Component.processMouseEvent(Component.java:5103)
                      [java] at java.awt.Component.processEvent(Component.java:4897)
                      [java] at java.awt.Container.processEvent(Container.java:1569)
                      [java] at java.awt.Component.dispatchEventImpl(Component.java:3615)
                      [java] at java.awt.Container.dispatchEventImpl(Container.java:1627)
                      [java] at java.awt.Component.dispatchEvent(Component.java:3477)
                      [java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.j
                      va:3483)
                      [java] at java.awt.LightweightDispatcher.processMouseEvent(Container.ja
                      a:3207)
                      [java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3
                      28)
                      [java] at java.awt.Container.dispatchEventImpl(Container.java:1613)
                      [java] at java.awt.Window.dispatchEventImpl(Window.java:1606)
                      [java] at java.awt.Component.dispatchEvent(Component.java:3477)
                      [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
                      [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
                      patchThread.java:201)
                      [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
                      tchThread.java:151)
                      [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
                      va:145)
                      [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
                      va:137)
                      [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:100


                      • 8. Re:  DII  client complains about serializer
                        kyayu

                        BTW i found the caused of java.util.vector problem:

                        method in java bean can't return Enumeration object, that' all. what a trick.