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 Daniel Hägg <da...@factum.se> on 2002/10/01 13:23:56 UTC

SAXException Bad types

Hi!
I have a web service with a WSDL that works fine with both
soap implementations in Microsoft .NET (ATL and ASP).
But I cannot get it to work with Axis 1.0 RC2.

Generated java code like this (see attached wsdl):

  java org.apache.axis.wsdl.WSDL2Java -p AxisClient.dab DabCtrlApi.wsdl

No problems.

Wrote a little app (java 1.4.0-02) that does this:

  DabCtrlApiLocator locator = new DabCtrlApiLocator();
  ApiPort cfgApi = locator.getApiPort();
  ArrayOfConfigurations arr = cfgApi.requestAllConfigurations();

The SOAP communications looks fine (see attachment).
But I get the following error when the response is deserialized:

2002-okt-01 13:00:54 org.apache.axis.client.Call invoke
ALLVARLIG: Exception:
org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class 
AxisClient.dab.ArrayOfConfigurations)
        at 
org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:285)
        at 
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:893)
        at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200)
        at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684)
        at 
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:241)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:265)
        at org.apache.axis.client.Call.invoke(Call.java:1871)
        at org.apache.axis.client.Call.invoke(Call.java:1777)
        at org.apache.axis.client.Call.invoke(Call.java:1315)
        at 
AxisClient.dab.ApiBindingStub.requestAllConfigurations(ApiBindingStub.java:123)
        at AxisClient.AxisClient.main(AxisClient.java:22)

BTW: "ALLVARLIG" is swedish and means "SERIOUS".
What is wrong?

 /
/ Daniel


Re: SAXException Bad types

Posted by Daniel Hägg <da...@factum.se>.
James Black wrote:

>You may want to rename crimson.jar to crimson.jar.old, but also look in java_home/jre/lib/ext and see what is there.  You will want to only refer to one xml parser.
>
I have tried renaming crimson.jar, but it did not help. I have also 
tried to remove the classpath to crimson,
and that gave me a NoClassDefFoundError org/w3c/dom/Node. This makes me 
believe
that there are no other xmlparser refered to. I found no jar files in 
jre/lib/ext that looked like xml parsers.
I also tried "downgrading" to java 1.3.1 and got the same result.

The error seems to be related to returning arrays from the server to the 
axis client.
The error does not occur if I pass simple types like int.

 /
/ Daniel



Re: SAXException Bad types

Posted by James Black <jb...@ieee.org>.
Daniel Hägg wrote:

> I have the following jars in my classpath.
>
> crimson-1.1.3\crimson.jar
> xml-axis-rc2\lib\axis.jar
> xml-axis-rc2\lib\jaxrpc.jar
> xml-axis-rc2\lib\saaj.jar
> xml-axis-rc2\lib\commons-logging.jar
> xml-axis-rc2\lib\commons-discovery.jar
> xml-axis-rc2\lib\wsdl4j.jar

  You may want to rename crimson.jar to crimson.jar.old, but also look in java_home/jre/lib/ext and see what is there.  You will want to only refer to one xml parser.
  I had spent a bit of time on Sunday night updating my jar files, and so when I had this problem I just copied all the jar files from one machine to another, and the problem went away.
  You may also want to undeploy your webservice, then remake the wsdd files and redeploy it, and see if that helps.

  Good luck.



Re: SAXException Bad types

Posted by Daniel Hägg <da...@factum.se>.
James Black wrote:

>This is where I went to.  The crimson.jar files I believe were old, but I am not certain. As I stated, updating my jar files helped me solve this problem.  I am moving away from using java web service package and just
>going to the apache jar files.
>
I have the following jars in my classpath.

crimson-1.1.3\crimson.jar
xml-axis-rc2\lib\axis.jar
xml-axis-rc2\lib\jaxrpc.jar
xml-axis-rc2\lib\saaj.jar
xml-axis-rc2\lib\commons-logging.jar
xml-axis-rc2\lib\commons-discovery.jar
xml-axis-rc2\lib\wsdl4j.jar

I have also tried xerces 2.0.0 and 2.2.0. Same result.
2002-okt-01 17:00:28 org.apache.axis.client.Call invoke
ALLVARLIG: Exception:
org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class 
AxisClient.dab.ArrayOfConfigurations)

 /
/ Daniel



Re: SAXException Bad types

Posted by James Black <jb...@ieee.org>.
Daniel Hägg wrote:

> Are you saying that some jar files in the jdk should be replaced with
> jar files from xerces ?
> What jars? What version of xerces?

  This is where I went to.  The crimson.jar files I believe were old, but I am not certain. As I stated, updating my jar files helped me solve this problem.  I am moving away from using java web service package and just
going to the apache jar files.


Re: SAXException Bad types

Posted by Daniel Hägg <da...@factum.se>.
James Black wrote:

>You may want to update your jar files. I had recently updated to using the xmlsecurity jar file and stopped using crimson, with the jdk1.4 distro, and started to use the updated jar files for xml from apache (xerces).
>  You may want to do the same thing, it should solve the problem.
>
Are you saying that some jar files in the jdk should be replaced with 
jar files from xerces ?
What jars? What version of xerces?

 /
/ Daniel



Re: SAXException Bad types

Posted by James Black <jb...@ieee.org>.
Daniel Hägg wrote:

> The SOAP communications looks fine (see attachment).
> But I get the following error when the response is deserialized:
>
> 2002-okt-01 13:00:54 org.apache.axis.client.Call invoke
> ALLVARLIG: Exception:
> org.xml.sax.SAXException: Bad types (class [Ljava.lang.Object; -> class
> AxisClient.dab.ArrayOfConfigurations)

  You may want to update your jar files. I had recently updated to using the xmlsecurity jar file and stopped using crimson, with the jdk1.4 distro, and started to use the updated jar files for xml from apache (xerces).
  You may want to do the same thing, it should solve the problem.


Re: SAXException Bad types

Posted by James Black <jb...@ieee.org>.
Daniel Hägg wrote:

> Hi!
> I have a web service with a WSDL that works fine with both
> soap implementations in Microsoft .NET (ATL and ASP).
> But I cannot get it to work with Axis 1.0 RC2.

  I am getting this to happen now also. I am currently testing to see if it was something I did, or not.

  All of my tests that I am running are passing now except for one where I get the same error message.