0

After reading this article:

EAR & WAR Class Loader

and this artcle:

CXF JBOSS issue

I am quite certain that JBOSS 4.2.3 class loader is trying to find class ServiceDelegate21 inside lib/endorsed folder but it's somehow different from class inside my EAR file and hence throws a :

java.lang.ClassCastException: org.apache.cxf.jaxws.ServiceImpl cannot
be cast to javax.xml.ws.spi.ServiceDelegate21

Of-course everything works fine if I move the 2 jars form endorsed folder. But this is not an option.

I need to tell JBOSS 4.2.3 GA Class loader from my maven project, to look first inside my EAR and then lib/endorsed folder.

Any ideas?

[edit:]

Inside lib/endored: jboss-jaxws jboss-jaxws-ext

Inside my EAR, I believe the jar tha conflicts is

jaxws-rt-2.1.7.jar

but take a look at e full jar list of my project

enter image description here

enter image description here

enter image description here

enter image description here

Community
  • 1
  • 1
SoulMagnet
  • 173
  • 1
  • 4
  • 18

1 Answers1

1

I see that you are mixing a lot of jars here. You have jars in Maven dependency, then jars in build path separately under C:\eclipseHelios\lib

Could you please clean it up, and make sure that all the required jars are either in JRE lib or Maven dependency only. For ws jar, the maven config is

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.1.7</version>
</dependency>

Also, I see many duplicate version of jars. e.g. jaxws-api.2.1.jar as well in maven. The more is the duplicate, more is class version clash!

Please clean your library and try again.

Gyanendra Dwivedi
  • 5,511
  • 2
  • 27
  • 53
  • Looks like the solution is hidden in this artcle http://stackoverflow.com/questions/11677572/dealing-with-xerces-hell-in-java-maven there's a xml-apis jar tha I needed to remove from my maven dependencies – SoulMagnet Sep 16 '13 at 16:35