Jump to content

ClassCastException SAXParser for parsing my SOAP Response

- - - - -

  • Please log in to reply
2 replies to this topic

#1
PunkDudez

PunkDudez

    Newbie

  • Members
  • PipPip
  • 10 posts
Hi there

The error occurs when my web application wants to parse my SOAP Response.

Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl cannot be cast to javax.xml.parsers.SAXParser

	at com.sun.xml.messaging.saaj.util.ParserPool.get(ParserPool.java:84)

	at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:88)

	... 51 more


I have the idea something is wrong with my saaj-api-1.3.1 and saai-impl-1.3.4. Is this because of a missmatch of versions ? Or do I lack another jar file ? Or should I look somewhere else for the poblem ?

I deploy on a WebSphere 7.0.0.17.

Here a list of my classpath (PARENT_LAST setting)

activation-1.1.jar

ant-1.6.5.jar

antlr-2.7.6.jar

aopalliance-1.0.jar

asm-3.1.jar

aspectjrt-1.6.10.jar

aspectjweaver-1.6.10.jar

bonecp-0.6.5.jar

bonecp-spring-0.6.5.jar

bsh-2.0b4.jar

cglib-2.2.jar

cglib-nodep-2.2.jar

common-1.0-SNAPSHOT.jar

commons-beanutils-20030211.134440.jar

commons-collections-3.2.1.jar

commons-digester-2.0.jar

commons-fileupload-1.2.jar

commons-io-1.3.2.jar

commons-io-1.4.jar

commons-lang-2.6.jar

commons-logging-1.1.1.jar

compass-2.2.0.jar

dom4j-1.6.1.jar

ecj-3.5.1.jar

ehcache-core-2.3.2.jar

ehcache-terracotta-2.3.2.jar

freemarker-2.3.8.jar

generic-collections-4.01.jar

geronimo-jta_1.1_spec-1.1.1.jar

gmbal-api-only-3.0.0-b023.jar

google-collections-1.0.jar

guava-r07.jar

hibernate-annotations-3.5.1-Final.jar

hibernate-commons-annotations-3.2.0.Final.jar

hibernate-core-3.5.1-Final.jar

hibernate-entitymanager-3.5.1-Final.jar

hibernate-envers-3.5.1-Final.jar

hibernate-tools-3.2.0.ga.jar

hibernate-validator-4.0.2.GA.jar

intellij-annotations-1.0.jar

istack-commons-runtime-2.2.jar

javassist-3.9.0.GA.jar

jaxb-api-2.2.jar

jaxb-impl-2.1.12.jar

jaxws-api-2.2.1.jar

jaxws-rt-2.2.1.jar

jcl-over-slf4j-1.6.1.jar

jdom-1.0.jar

jetty-continuation-7.1.6.v20100715.jar

jetty-http-7.1.6.v20100715.jar

jetty-io-7.1.6.v20100715.jar

jetty-plus-7.1.6.v20100715.jar

jetty-security-7.1.6.v20100715.jar

jetty-server-7.1.6.v20100715.jar

jetty-servlet-7.1.6.v20100715.jar

jetty-util-7.1.6.v20100715.jar

jetty-webapp-7.1.6.v20100715.jar

jetty-xml-7.1.6.v20100715.jar

jsr181-api-1.0-MR1.jar

jsr250-api-1.0.jar

jsr311-api-1.1.1.jar

jta-1.1.jar

jtidy-r8-20060801.jar

log4j-1.2.16.jar

lucene-core-2.4.1.jar

mail-1.4.1.jar

management-api-3.0.0-b012.jar

mimepull-1.4.jar

mysql-connector-java-5.1.10.jar

ojdbc6-11.2.0.1.0.jar

opencsv-2.1.jar

oro-2.0.8.jar

policy-2.2.1.jar

referentialdata_api-1.0-20110602.200712-233.jar

resolver-20050927.jar

rome-0.9.jar

saaj-api-1.3.1.jar

saaj-impl-1.3.4.jar

serializer-2.7.1.jar

sitemesh-2.4.2.jar

slf4j-api-1.6.0-RC0.jar

slf4j-log4j12-1.6.1.jar

soap-stubs-1.0-20110602.201048-319.jar

spring-aop-3.1.0.M1.jar

spring-asm-3.1.0.M1.jar

spring-aspects-3.0.2.RELEASE.jar

spring-aspects-3.1.0.M1.jar

spring-beans-3.1.0.M1.jar

spring-context-3.1.0.M1.jar

spring-context-support-3.1.0.M1.jar

spring-core-3.1.0.M1.jar

spring-expression-3.1.0.M1.jar

spring-jdbc-3.1.0.M1.jar

spring-jms-3.0.1.RELEASE.jar

spring-orm-3.1.0.M1.jar

spring-oxm-3.1.0.M1.jar

spring-security-core-3.0.2.RELEASE.jar

spring-test-3.1.0.M1.jar

spring-tx-3.1.0.M1.jar

spring-web-3.1.0.M1.jar

spring-webmvc-3.1.0.M1.jar

spring-ws-core-2.0.0-M1.jar

spring-ws-security-2.0.0-M1.jar

spring-ws-support-2.0.0-M1.jar

spring-xml-2.0.0-M1.jar

stax-ex-1.2.jar

streambuffer-1.1.jar

tiles-api-2.2.2.jar

tiles-core-2.2.2.jar

tiles-el-2.2.2.jar

tiles-jsp-2.2.2.jar

tiles-servlet-2.2.2.jar

tiles-template-2.2.2.jar

txw2-20090102.jar

validation-api-1.0.0.GA.jar

velocity-1.6.2.jar

wsdl4j-1.6.1.jar

wss4j-1.5.8.jar

wstx-asl-3.2.1.jar

xalan-2.7.1.jar

xercesImpl-2.9.1.jar

xml-apis-1.3.04.jar

xmldsig-1.0.jar

xmlsec-1.4.3.jar

xmlsec-2.0.jar

xws-security-2.0-FCS.jar



#2
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
Could I see the code that results in the error? This exception was thrown somewhere, and it should be trivial to cast a subclass to a superclass typee.
Wow I changed my sig!

#3
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
I think that to rule out the possible cause of the version conflicts you can just check the war-file you create.
Create an exploded war-file from your project, open the war-file with some kind of rar/zip program like 7-zip. If there are 2 different javax.xml.parsers.SAXParser classes in there, there's likely a version conflict.

(You should be able to unpack the war-file), then unpack all jars in the lib-folder. Then you can CTRL+F through there.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users