Avatar of numtech
numtech
 asked on

SOAP impl error in Java 6

Hello,
I am making a J2SE client which can communicate with J2EE Server using webservices.
but when running my client i have this error:
com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl cannot be cast to com.sun.xml.messaging.saaj.soap.MessageImpl

Open in new window


Apparently its a bug in SAAj-impl in java 6 (but i am using java7 with Java6 compatibility in my Eclipse) :
http://java.net/jira/browse/SAAJ-19

So i have change my pom.xml like this:
		<dependency>
			<groupId>com.sun.xml.rpc</groupId>
			<artifactId>jaxrpc-impl</artifactId>
			<version>1.1.3_01</version>
		</dependency>
		<dependency>
			<groupId>javax.activation</groupId>
			<artifactId>activation</artifactId>
			<version>1.1.1</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.messaging.saaj</groupId>
			<artifactId>saaj-impl</artifactId>
			<version>1.3</version>
		</dependency>

		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>1.4.1</version>
		</dependency>

Open in new window


But i doesn't solved the problem. Maybe the buged saaj-impl is still used.
How can i desactivate the wrong saaj-impl and forced to use saaj-impl 1.3?

thanks
Java EEWeb ComponentsWeb Languages and Standards

Avatar of undefined
Last Comment
numtech

8/22/2022 - Mon
sweetfa2

Copy the META-INF/services directory from saaj-impl.jar into your client jar file.
numtech

ASKER
I am using maven to build my Jar, so i am not sure i can make that. Thus, when i am running TestCase my jar is not yet build so it doesn't solved the entire problem
sweetfa2

In your maven project if you have a standard maven structure your will have a src/resources/main directory.

Add the META-INF directory at that point.  Your eclipse program will pick it up automagically.
Your help has saved me hundreds of hours of internet surfing.
fblack61
numtech

ASKER
Ok,
but in the first post you say "coy META-INF/services" but there is no services directory in the META-INF directory, only MANIFEST.MF file containing:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.5.0_05-b05 (Sun Microsystems Inc.)
Specification-Title: SOAP with Attachments API for Java
Specification-Version: 1.3
Implementation-Title: SAAJ Implementation
Implementation-Version: 1.3
Implementation-Vendor: Sun Microsystems Inc
Implementation-Vendor-Id: com.sun
Extension-Name: com.sun.xml.messaging.saaj
Class-Path: saaj-api.jar activation.jar

Open in new window

ASKER CERTIFIED SOLUTION
numtech

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
numtech

ASKER
Nobody solved the problem so i remove the problem instead of solving it