java.lang.NoClassDefFoundError: com/sun/istack/localization/Localizable?

前端 未结 4 1239
谎友^
谎友^ 2020-12-15 18:45

i try to run my project by tomcat7. afer the generation of the wsdl file of my webservices by jax ws maven plugin (and it generated by success) but tried to view the wsdl fi

相关标签:
4条回答
  • 2020-12-15 18:55

    com.sun.istack.localization.Localizable.class is definitly in jaxb-core-2.2.11.jar

    For runing properly your web apllication, you need to add on your pom.xml:
    <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-rt</artifactId> <version>2.2.8</version> </dependency>
    This is for your listner declared on your web.xml:
    <listener> <listener-class> com.sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener>

    Then, under <%TOMCAT_HOME%>/endorsed (create it if you don't have it) the librairies:

    1. jaxb-impl-2.2.11.jar
    2. jaxb-core-2.2.11.jar
    3. jaxb-api-2.2.3.jar
    4. stax-api-1.0-2.jar
    5. activation-1.1.jar
    6. jaxws-api-2.2.3.jar
    7. saaj-api-1.3.2.jar
    8. javax.annotation-3.1-b35.jar
    9. jsr181-api-1.0-MR1.jar
    0 讨论(0)
  • 2020-12-15 19:04

    Add the jar from where this class com.sun.istack.localization.Localizable is coming .

    As the same is present in jaxb-core-2.2.X and jaxb-impl-2.2.X.

    Try adding those jars in your server/lib or bundle them with the war file.

    Thanks

    0 讨论(0)
  • 2020-12-15 19:09

    I solved time ago changing maven deps with:

    <dependency>
        <groupId>com.sun.xml.ws</groupId>
        <artifactId>jaxws-rt</artifactId>
        <version>version</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.istack</groupId>
                <artifactId>istack-commons-runtime</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    
    0 讨论(0)
  • 2020-12-15 19:12

    I have face many issues when trying to build a Soap web service running on Tomcat, and for that I've needed many maven dependencies. The configuration that have worked for me is the following:

    <dependencies>
        <!-- jax-ws maven dependency -->
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.2.8</version>
        </dependency>
        <!-- servlet provided by tomcat -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-core -->
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-core</artifactId>
            <version>2.2.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.sun.xml.stream.buffer/streambuffer -->
        <dependency>
            <groupId>com.sun.xml.stream.buffer</groupId>
            <artifactId>streambuffer</artifactId>
            <version>1.5.3</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-impl -->
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.2.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.sun.xml.ws/policy -->
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>policy</artifactId>
            <version>2.3.1</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.glassfish.gmbal/gmbal-api-only -->
        <dependency>
            <groupId>org.glassfish.gmbal</groupId>
            <artifactId>gmbal-api-only</artifactId>
            <version>3.2.0-b003</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.glassfish.ha/ha-api -->
        <dependency>
            <groupId>org.glassfish.ha</groupId>
            <artifactId>ha-api</artifactId>
            <version>3.1.9</version>
        </dependency>
    </dependencies>
    

    Replace your maven dependencies by these and then make a new try. I hope this works for you too

    Regards

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