• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

org.xml.sax.SAXException: Bad types

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a problem in running my Client.
It gives me
org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class myex.example)
at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:311)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
at org.apache.axis.client.Call.invoke(Call.java:2272)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at myex.Client.callGetWS(Client.java:187)
at myex.Client.main(Client.java:301)
Problem in main: ; nested exception is:
org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class myex.example)
My webservice returns an array of bean (example[]).
Thanks
Bustcrak
[ November 04, 2003: Message edited by: Bustcrack ]
[ November 04, 2003: Message edited by: Bustcrak ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Bustcrak",
First of all, please read the naming policy and change your display name accordingly.
Second, point a browser to the Axis User's Guide and look for "Encoding Your Beans".
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All/Elilory Delpunti,

I know it's been a while since this message was posted, but just wondering if you came up with any solution for the problem you had with the SAXExcepiton
I get the exception as something similar
org.xml.sax.SAXException: Invalid element
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:260)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:725)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
at org.apache.axis.client.Call.invoke(Call.java:2234)
at org.apache.axis.client.Call.invoke(Call.java:2133)
at org.apache.axis.client.Call.invoke(Call.java:1656)
at SoapBindingStub.retrieveCase(SoapBindingStub.java:1292)
I would appreciate any reply to this post.
Thanks.
Divya
[ March 29, 2004: Message edited by: divya madala ]
 
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
I came accross the same problem, it was quite some time back, but I think this could happen when the bean you are trying to serialize, has a setter method but not a getter method or vice versa.
this could also happen if you are trying to use the classes generated by WSDL2Java. because the bean classes that are generated also contain the typemappings in it.
This is actually not necessary.
other wise it would be good if you could also put some source code to analyse the issue.
hope this helps
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
When I was getting this exception, the mapping between my Java Beans to XML wasnt there.I edited the server-config.wsdd file (in Axis) for the proper mappings & then it started working fine.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vedhas

How do I edit server-config.wsdd file. Because I am having the same exception and was just wondering, if this could help me.

Thank You !!
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Khushi Panesar:
Hi Vedhas
How do I edit server-config.wsdd file. Because I am having the same exception and was just wondering, if this could help me.
Thank You !!



Well there is two option,
Either use the axis adminclient + specific wsdd for a given service.
Or edit the servlet-config.wsdd directly, to edit it directly you should know some basics about wsdd tags.
For examples to deploy a service called OrderProcessor which uses a bean called Order in its SOAPrequest, you will add the tags like


As you can see the code above, try to run all the samples that comes with Axis package, then you can master around ;)
[ May 27, 2005: Message edited by: Balaji Loganathan ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Loganathan,
Its really a great help that you had done to Khushi Panesar, I guess. I am also on the same page of Khushi. As in our project we have to access the third party Web Service, and they are using Axis. We were given set of classes that are implemented using WSDL2Java. Now the problem is I have developed a simulator which works as my Client Web Service in local environment. Everything working fine but while receiving response, Client code throws the following error.
----------------------------------------------------------------------

- Exception:
org.xml.sax.SAXException: Invalid element in com.echostar.www.api.create.version.two._ScrubAddressResponse - Address
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:255)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1140)
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:2448)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at org.openuri.www.Wscreateapiv2SoapStub.scrubAddress(Wscreateapiv2SoapStub.java:950)
at com.echostar.apiv2.Client.scrubAddress(Client.java:449)
at com.echostar.apiv2.Client.main(Client.java:152)
---------------------------------------------------------------------
Response Schema:

|-- LineOne
|-- LineTwo
|-- Address--- |-- City
| |-- State
ScrubAddressResponse--| |-- Zip
|
|
|-- AddressValidFlag
---------------------------------------------------------------------
Where Address is a User definedd class and AddressValidFlag is boolean type. while accessing primative type its not showing any errors.

Could you please help me.
Thanks and Regards,

V.V.Nagesh Akula.
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic