web-dev-qa-db-ja.com

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

tomcat7でプロジェクトを実行しようとしています。 jax ws mavenプラグインによるWebサービスのwsdlファイルの生成(および成功により生成された)を参照しましたが、ブラウザでwsdlファイルを表示しようとしましたが、結果は表示されませんでした。

私はTomcat7サーバーでプロジェクトを実行しようとしましたが、このエラーが表示され、この問題の解決策はありませんでした:

août 06, 2013 12:08:09 PM org.Apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments   was not found on the Java.library.path: C:\Program   Files\Java\jdk1.7.0_21\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program   Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Program   Files\MiKTeX 2.9\miktex\bin;%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2010a\runtime\win32;C:\Program Files\MATLAB\R2010a\bin;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Orant\bin;C:\Centrun;C:\LHS\BSCS_iX_R2_Demo;C:\LHS\BSCS_iX_R2_Demo\bin\win32;C:\LHS\BSCS_iX_R2_Demo\3pp\win32;C:\LHS\BSCS_iX_R2_Demo\TAO1.3aP12_WinXP\ACE_wrappers\bin;C:\LHS\BSCS_iX_R2_Demo\TAO1.3aP12_WinXP\ACE_wrappers\lib;C:\LHS\BSCS_iX_R2_Demo\jdk1.5.0_06\bin;C:\Program Files\Apache-maven-3.1.0\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Users\sayed\Desktop\Eclipse\eclipse;;.
 août 06, 2013 12:08:09 PM org.Apache.Tomcat.util.digester.SetPropertiesRule begin
 WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to    'org.Eclipse.jst.j2ee.server:BSCSwebservices' did not find a matching property.
août 06, 2013 12:08:09 PM org.Apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["http-bio-8080"]
 août 06, 2013 12:08:09 PM org.Apache.coyote.AbstractProtocol init
 INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
 août 06, 2013 12:08:09 PM org.Apache.catalina.startup.Catalina load
INFO: Initialization processed in 1005 ms
août 06, 2013 12:08:09 PM org.Apache.catalina.core.StandardService startInternal
INFO: Démarrage du service Catalina
août 06, 2013 12:08:09 PM org.Apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
août 06, 2013 12:08:10 PM org.Apache.catalina.loader.WebappClassLoader validateJarFile
INFO:      validateJarFile(C:\Users\sayed\workspace\.metadata\.plugins\org.Eclipse.wst.server.core\tmp1\wtpwebapps\BSCSwebservices\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:   javax/servlet/Servlet.class
 log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
 log4j:WARN Please initialize the log4j system properly.
 log4j:WARN See http://logging.Apache.org/log4j/1.2/faq.html#noconfig for more info.
août 06, 2013 12:08:13 PM org.Apache.catalina.core.ApplicationContext log
INFO: Loading Spring root WebApplicationContext
août 06, 2013 12:08:14 PM org.Apache.catalina.core.ApplicationContext log
 SEVERE: StandardWrapper.Throwable
Java.lang.NoClassDefFoundError: com/Sun/istack/localization/Localizable
at Java.lang.ClassLoader.defineClass1(Native Method)
at Java.lang.ClassLoader.defineClass(ClassLoader.Java:791)
at Java.security.SecureClassLoader.defineClass(SecureClassLoader.Java:142)
at org.Apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.Java:2895)
at org.Apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.Java:1173)
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1681)
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1559)
at com.Sun.xml.ws.transport.http.servlet.WSSpringServlet.init(WSSpringServlet.Java:48)
at org.Apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.Java:1280)
at org.Apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.Java:1193)
at org.Apache.catalina.core.StandardWrapper.load(StandardWrapper.Java:1088)
at org.Apache.catalina.core.StandardContext.loadOnStartup(StandardContext.Java:5176)
at org.Apache.catalina.core.StandardContext.startInternal(StandardContext.Java:5460)
at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:150)
at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1559)
at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1549)
at Java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.Java:334)
at Java.util.concurrent.FutureTask.run(FutureTask.Java:166)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1145)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:615)
at Java.lang.Thread.run(Thread.Java:722)
  Caused by: Java.lang.ClassNotFoundException: com.Sun.istack.localization.Localizable
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1714)
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1559)
... 21 more

 août 06, 2013 12:08:14 PM org.Apache.catalina.core.StandardContext loadOnStartup
 SEVERE: La servlet /BSCSwebservices a généré une exception "load()"
 Java.lang.ClassNotFoundException: com.Sun.istack.localization.Localizable
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1714)
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1559)
at Java.lang.ClassLoader.defineClass1(Native Method)
at Java.lang.ClassLoader.defineClass(ClassLoader.Java:791)
at Java.security.SecureClassLoader.defineClass(SecureClassLoader.Java:142)
at org.Apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.Java:2895)
at org.Apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.Java:1173)
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1681)
at org.Apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.Java:1559)
at com.Sun.xml.ws.transport.http.servlet.WSSpringServlet.init(WSSpringServlet.Java:48)
at org.Apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.Java:1280)
at org.Apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.Java:1193)
at org.Apache.catalina.core.StandardWrapper.load(StandardWrapper.Java:1088)
at org.Apache.catalina.core.StandardContext.loadOnStartup(StandardContext.Java:5176)
at org.Apache.catalina.core.StandardContext.startInternal(StandardContext.Java:5460)
at org.Apache.catalina.util.LifecycleBase.start(LifecycleBase.Java:150)
at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1559)
at org.Apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.Java:1549)
at Java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.Java:334)
at Java.util.concurrent.FutureTask.run(FutureTask.Java:166)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1145)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:615)
at Java.lang.Thread.run(Thread.Java:722)

提案、解決策...ありがとう

14
Sayed Jabnoun

このクラスcom.Sun.istack.localization.Localizableが来るjarを追加します。

同じことがjaxb-core-2.2.X and jaxb-impl-2.2.X.にも存在するため

これらのjarをserver/libに追加するか、warファイルにバンドルしてみてください。

ありがとう

19
saurav

私は時間前にmaven depsを変更して解決しました:

<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>
7

Tomcatで実行されるSoap Webサービスを構築しようとすると、多くの問題に直面します。そのために、多くのMaven依存関係が必要になりました。私のために働いた構成は次のとおりです:

<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>

これらによってMavenの依存関係を置き換えてから、もう一度試してください。これがあなたにも役立つことを願っています

よろしく

3

com.Sun.istack.localization.Localizable.classはjaxb-core-2.2.11.jar

Webアプリケーションを適切に実行するには、pom.xml
<dependency> <groupId>com.Sun.xml.ws</groupId> <artifactId>jaxws-rt</artifactId> <version>2.2.8</version> </dependency>
これはweb.xml
<listener> <listener-class> com.Sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener>

次に、<%Tomcat_HOME%>/endorsed(持っていない場合は作成します)ライブラリー:

  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
2
lyy