JaxWS ClassCastException on JBoss

前端 未结 3 954
野趣味
野趣味 2021-01-22 23:08

I\'m using JBoss 5.1.0.GA (for JDK6), and jaxws 2.2.6. When I invoke the webservice, I get the following exception:

java.util.ServiceConfigurationError: j

相关标签:
3条回答
  • 2021-01-22 23:38

    I faced the same issue. I am running JBoss 5.1 EAP along with JDK 1.6_22.

    I did things slightly different. I combined the solution by Carlo plus this solution.

    I created an endorsed folder under $JBOSS_HOME/server//lib/endorsed. I then copied over streambuffer.jar, stax-ex.jar, policy.jar, jaxws-rt.jar, jaxws-api.jar, jaxb-impl.jar, jaxb-api.jar and gmbal-api-only.jar.

    I left the $JBOSS_HOME/lib/endorsed alone.

    Doing this, I was able to get it to work it all to work

    0 讨论(0)
  • 2021-01-22 23:42

    I had the same problem on JBoss 5.1 EAP Instead of putting jar files into JBOSS application server it is more robust when you alter class loading logic by isolating WAR with Overriding Server Classes (http://www.jboss.org/community/wiki/classloadingconfiguration) In my case I have 3 environments. With this solution I can move war file from one JBOSS instance to another and it will still work.

    I resolved this problem by: Adding this to jboss-web.xml:

    <class-loading java2ClassLoadingCompliance="false">
        <loader-repository>
            com.example:archive=unique-archive-name
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
    </class-loading>
    

    ...

    and by adding requierd jars into war (jaxb-api.jar, jaxb-impl.jar, jaxws-api.jar, jaxws-rt.jar)

    0 讨论(0)
  • 2021-01-22 23:43

    Finally, I've managed to solve my problem: I put jaxws-rt.jar in $JBOSS_HOME/lib/endorsed.

    EDIT
    I had the same problem on JBoss 5.1 EAP, and to solve it, the steps are a little different: in $JBOSS_HOME/lib/endorsed I removed the old jaxb-api.jar, then copied

    • jaxb-api.jar
    • jaxb-impl.jar
    • jaxws-api.jar
    • jaxws-rt.jar

    from the latest jaxws-ri package, and eventually it worked.

    0 讨论(0)
提交回复
热议问题