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 rp johns <rj...@vignette.com> on 2006/08/23 15:37:52 UTC

ClassCastException after upgrading to axis1.4

NT 2003
axis1.4 (java)

I've recently upgraded from axis1.2 to axis1.4. Everything compiled and
built fine, however I get a class cast exception . Here's a few lines
from the stacktrace:

Caused by: java.lang.ClassCastException: java.lang.String
    at
org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1389)
    at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148)

My first thought was that there was a jar incompatability between the
axis jars and xerces, and others. So, unsuccessful after fooling with a
lot of jar jumbling, I decided to look at the source code
(org.apache.axis.message.MessageElement) for clues and now I'm even more
puzzled because it's not obvious how a casting exception is even
possible. Here's the relevent piece of code :

    public SOAPElement addTextNode(String s) throws SOAPException {
        try {
            Text text = getOwnerDocument().createTextNode(s);

((org.apache.axis.message.Text)text).setParentElement(this);
<====Here's line 1389  where the exception occurs.
            return this;

I'm fairly new to the axis world so perhaps my inexperience is blocking
an obvious path to the solution. Whatever,  I'm at a loss and would
appreciate any clues or insights. I've included a full stackTrace below
in case it's helpful.

thanks

Full stackTrace here:
---------------------

AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

faultSubcode:

faultString: javax.xml.soap.SOAPException:
java.lang.ClassCastException: java.lang.String

faultActor:

faultNode:

faultDetail:


{http://xml.apache.org/axis/}stackTrace:javax.xml.soap.SOAPException:
java.lang.ClassCastException: java.lang.String

    at
org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1396)

    at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148)

    at org.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112)

    at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)

    at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Lorg.apache.xerces.xni.QName;Lorg.apache.xerces.xni.Augmentations;)V(Unknown 

Source)

    at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement()I(Unknown
Source)

    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z(Unknown 

Source)

    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z(Unknown 

Source)

    at org.apache.xerces.parsers.XML11Configuration.parse(Z)Z(Unknown
Source)

    at
org.apache.xerces.parsers.XML11Configuration.parse(Lorg.apache.xerces.xni.parser.XMLInputSource;)V(Unknown 

Source)

    at
org.apache.xerces.parsers.XMLParser.parse(Lorg.apache.xerces.xni.parser.XMLInputSource;)V(Unknown 

Source)

    at
org.apache.xerces.parsers.AbstractSAXParser.parse(Lorg.xml.sax.InputSource;)V(Unknown 

Source)

    at
javax.xml.parsers.SAXParser.parse(Lorg.xml.sax.InputSource;Lorg.xml.sax.helpers.DefaultHandler;)V(Unknown 

Source)

    at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)

    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)

    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)

    at
org.apache.axis.handlers.SimpleSessionHandler.doClient(SimpleSessionHandler.java:173)

    at
org.apache.axis.handlers.SimpleSessionHandler.invoke(SimpleSessionHandler.java:157)

    at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

    at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)

    at org.apache.axis.client.Call.invoke(Call.java:2767)

    at org.apache.axis.client.Call.invoke(Call.java:2443)

    at org.apache.axis.client.Call.invoke(Call.java:2366)

    at org.apache.axis.client.Call.invoke(Call.java:1812)

    at
com.redgroup.analyzer.agent.AnalysisAgentClient.executeAgentOperation(AnalysisAgentClient.java:234)

    at
com.redgroup.analyzer.client.agent.RemoteAgentContext.getResponse(RemoteAgentContext.java:135)

Caused by: java.lang.ClassCastException: java.lang.String

    at
org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1389)

    at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148)

    at org.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112)

    at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)

    at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Lorg.apache.xerces.xni.QName;Lorg.apache.xerces.xni.Augmentations;)V(Unknown 

Source)

    at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement()I(Unknown
Source)

    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z(Unknown 

Source)

    at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z(Unknown 

Source)

    at org.apache.xerces.parsers.XML11Configuration.parse(Z)Z(Unknown
Source)

    at
org.apache.xerces.parsers.XML11Configuration.parse(Lorg.apache.xerces.xni.parser.XMLInputSource;)V(Unknown 

Source)

    at
org.apache.xerces.parsers.XMLParser.parse(Lorg.apache.xerces.xni.parser.XMLInputSource;)V(Unknown 

Source)

    at
org.apache.xerces.parsers.AbstractSAXParser.parse(Lorg.xml.sax.InputSource;)V(Unknown 

Source)

    at
javax.xml.parsers.SAXParser.parse(Lorg.xml.sax.InputSource;Lorg.xml.sax.helpers.DefaultHandler;)V(Unknown 

Source)

    at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)

    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)

    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)

    at
org.apache.axis.handlers.SimpleSessionHandler.doClient(SimpleSessionHandler.java:173)

    at
org.apache.axis.handlers.SimpleSessionHandler.invoke(SimpleSessionHandler.java:157)

    at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

    at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)

    at org.apache.axis.client.Call.invoke(Call.java:2767)

    at org.apache.axis.client.Call.invoke(Call.java:2443)

    at org.apache.axis.client.Call.invoke(Call.java:2366)

    at org.apache.axis.client.Call.invoke(Call.java:1812)

-- 
rp johns
software factotum



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org