You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jay Glanville <Ja...@naturalconvergence.com> on 2005/02/28 22:02:50 UTC

"no serializer found" when using custom serializer problems

Hello all 

I'm trying to write my own serializer/deserializer.  So, on that
education path, I'm taking rather small steps.  I've got a small bean
(one attribute), a test service (that uses that bean), a rather simple
serializer (that extends SimpleSerializer) and a rather simple
serializer factory (that mimics SimpleSerializerFactory).

The problem is that when I call a method on my service, I get a "no
serializer found" error.  Why is this?  What am I missing here?

I'm using Axis 1.2rc2 as an web service embedded into my web
application.

The service's definition inside my server-config.wsdd is:
    <service name="test" provider="java:RPC" style="rpc">
        <document>
            testing of service functionality
        </document>
        <parameter name="className"
value="com.nci.slt.epi.admin.test.TestService"/>
        <parameter name="allowedMethods" value="*"/>
        <typeMapping qname="ns:Obj"
            xmlns:ns="http://test.admin.epi.slt.nci.com"
            languageSpecificType="java:com.nci.slt.epi.admin.test.Obj"
            serializer="com.nci.slt.epi.admin.test.ObjSerializerFactory"
 
deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
    </service>


I'm calling my service through a URL like this:
http://jglanville01/webadmin/services/test?method=getObjs
And am getting the following response:
    AXIS error

    Sorry, something seems to have gone wrong... here are the details:

    Fault - ; nested exception is: 
	java.io.IOException: No serializer found for class
com.nci.slt.epi.admin.test.Obj in registry
org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl@7cf883

    AxisFault
     faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: java.io.IOException: No serializer found for class
com.nci.slt.epi.admin.test.Obj in registry
org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl@7cf883
     faultActor: 
     faultNode: 
     faultDetail: 
	{http://xml.apache.org/axis/}hostname:JGLANVILLE01



Now, I know that my serializer factory is being called (placed a
breakpoint in the factory's constructor) and that none of the
serializer's methods are being called.


I've attached my service's implementation (TestService.java), my bean
(Obj.java), my serializer (ObjSerializer.java) and my serializer factory
(ObjSerializerFactory.java).

All help would be appreciated.

Thanks

 
---
Jay Glanville

Re: "no serializer found" when using custom serializer problems

Posted by Airline Pedestal <ai...@yahoo.com>.

I think your encodingStyle should be
set to empty string ("").


--- Jay Glanville
<Ja...@naturalconvergence.com> wrote:

> Hello all 
> 
> I'm trying to write my own serializer/deserializer. 
> So, on that
> education path, I'm taking rather small steps.  I've
> got a small bean
> (one attribute), a test service (that uses that
> bean), a rather simple
> serializer (that extends SimpleSerializer) and a
> rather simple
> serializer factory (that mimics
> SimpleSerializerFactory).
> 
> The problem is that when I call a method on my
> service, I get a "no
> serializer found" error.  Why is this?  What am I
> missing here?
> 
> I'm using Axis 1.2rc2 as an web service embedded
> into my web
> application.
> 
> The service's definition inside my
> server-config.wsdd is:
>     <service name="test" provider="java:RPC"
> style="rpc">
>         <document>
>             testing of service functionality
>         </document>
>         <parameter name="className"
> value="com.nci.slt.epi.admin.test.TestService"/>
>         <parameter name="allowedMethods" value="*"/>
>         <typeMapping qname="ns:Obj"
>            
> xmlns:ns="http://test.admin.epi.slt.nci.com"
>            
>
languageSpecificType="java:com.nci.slt.epi.admin.test.Obj"
>            
>
serializer="com.nci.slt.epi.admin.test.ObjSerializerFactory"
>  
>
deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
>            
>
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
>     </service>
> 
> 
> I'm calling my service through a URL like this:
>
http://jglanville01/webadmin/services/test?method=getObjs
> And am getting the following response:
>     AXIS error
> 
>     Sorry, something seems to have gone wrong...
> here are the details:
> 
>     Fault - ; nested exception is: 
> 	java.io.IOException: No serializer found for class
> com.nci.slt.epi.admin.test.Obj in registry
>
org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl@7cf883
> 
>     AxisFault
>      faultCode:
>
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>      faultSubcode: 
>      faultString: java.io.IOException: No serializer
> found for class
> com.nci.slt.epi.admin.test.Obj in registry
>
org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl@7cf883
>      faultActor: 
>      faultNode: 
>      faultDetail: 
> 	{http://xml.apache.org/axis/}hostname:JGLANVILLE01
> 
> 
> 
> Now, I know that my serializer factory is being
> called (placed a
> breakpoint in the factory's constructor) and that
> none of the
> serializer's methods are being called.
> 
> 
> I've attached my service's implementation
> (TestService.java), my bean
> (Obj.java), my serializer (ObjSerializer.java) and
> my serializer factory
> (ObjSerializerFactory.java).
> 
> All help would be appreciated.
> 
> Thanks
> 
>  
> ---
> Jay Glanville
> 

> ATTACHMENT part 2 application/octet-stream
name=Obj.java


> ATTACHMENT part 3 application/octet-stream
name=ObjSerializer.java


> ATTACHMENT part 4 application/octet-stream
name=ObjSerializerFactory.java


> ATTACHMENT part 5 application/octet-stream
name=TestService.java




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

Re: Poor performance with Axis 1.2 client vs Apache Soap 2.3.1

Posted by Airline Pedestal <ai...@yahoo.com>.
I've been doing some performance comparations
simular to the ones in the below forwarded email.
Although, I'm comparing AXIS 1.1 vs AXIS 1.2RC3.

I'm seeing noticably slower perforamce with
AXIS 1.2RC3.  I thought it was suppose to be
faster.   My server uses AXIS 1.1 in all my
tests but this shouldn't matter.   The client
I've tried with both.    I'm seeing numbers indicating
AXIS 1.2RC3 is 25% slower than AXIS 1.1.

It must be the custom deserialization that
I'm doing.  That's always been the slow down
for my client (and server).   But I was hoping
that AXIS 1.2RC3 would improve this.

Any ideas or thoughts....



Thanks,

A


List:       axis-user
Subject:    Re: Poor performance with Axis 1.2 client
vs Apache Soap 2.3.1
From:       Bernard LUPIN <beal6226 () yahoo ! fr>
Date:       2004-11-15 9:35:14
Message-ID: <20041115093514.49257.qmail () web26403 !
mail ! ukl ! yahoo ! com>
[Download message RAW]

Thank you for your suggestion. The client and server
are not on the same machine. I can't modify the server
side, just query it with soap or axis. I tried 3 ways
to connect :

- IP address in URL constructor : 15230 ms
- logical name, using /etc/hosts : 15180 ms
- bad logical name : 13256 ms to get the
UnknownHostException.

So it doesn't solve the problem, the difference
between soap and axis client is still enormous.
Regards,
Bernard

 --- Vy Ho <st...@drexel.edu> a �crit : 
> 
> How about try to add the server's ip/address to the
> client machine's 
> host file. Event if it's the same machine, add
> localhost in anyway. 
> Please let me know if that solves the initial delay.
> 
> Bernard LUPIN wrote:
> 
> > Hi all,
> > 
> > I'm writing a client that will query web services
> > already developped with Apache Soap 2.3.1.
> > I tested two versions of my client, one with
Apache
> > Soap 2.3.1 and one with Axis 1.2RC1.
> > The return values are good with both clients, but
> the
> > execution time is 3 seconds with Soap 2.3.1, and
15
> > seconds with Axis 1.2, so it is five times longer
!
> > 
> > My two questions are :
> > - Is it a good practice to use Axis to query an
> apache
> > Soap 2.3.1 service ?
> > - Is something wrong in my client ?
> > 
> > Here is the code of my Axis client. If necessary,
I
> > can publish the code of my Apache soap client.
> > 
> > public class ClientSoapV2 {
> > public static void main(String[] args) {
> > long debut = System.currentTimeMillis();
> > long fin;
> > try {
> > URL url;
> > url = new
> > URL("http://my_host:8080/soap/servlet/rpcrouter");
> > Service service = new Service();
> > Call call    = (Call) service.createCall();
> > call.setUsername("web_user");
> > call.setPassword("web_password");
> > call.setTargetEndpointAddress(url);
> > call.setOperationName( new
> > QName("urn:ReturnServicesSoap", "listCard") );
> > call.addParameter("filter", XMLType.XSD_STRING,
> > ParameterMode.IN);
> > call.addParameter("nbLignes",
> XMLType.XSD_STRING,
> > ParameterMode.IN);
> > 
> 
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING
> > );
> > String ret = (String) call.invoke( new Object[]
> {
> > "code=90", "10" } );
> > fin = System.currentTimeMillis();
> > System.out.println("Resul : \n" + ret);
> > } catch (Exception e) {
> > System.err.println(e.toString());
> > }
> > fin = System.currentTimeMillis();
> > System.out.println("Elapsed time:" +
> (fin-debut));
> > }
> > 
> > Thanks in advance !
> > Bernard
> > 
> > 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail