2011-12-23 6 views
0

私は複数SLF4Jバインディングの警告開始エラーハンドラNoSuchMethodErrorを取得していますを使用して、複数のSLF4Jバインディングの警告とエラー起動ハンドラとNoSuchMethodErrorを取得していますV私はJAX-WS

JAX-WSを使い始めると、このビジネスはすべて表示されました。私の同僚の

一つは、同じエラーを得たが、彼は瓶(JCLオーバーSLF4J-1.5.8)を取り除いた後には、今彼のために

結構ですしかし、私は私のために働いていない、同じ試みました。

クラスパス1.slf4j-api-1.6.1.jar 2. slf4j-log4j12-1.6.1.jarと3.slf4j-simple-1.5.8に次のjarファイルを1つずつ削除しようとしました。 .jarしかし効果はありません。

Jettyを実行する前にmavenをクリーンアップしようとしたときに、ビルドエラーが表示され、(xmlsec-1.4.4.jar)を削除できなくなりましたが、手動でこの.jarを削除しました。ここで

は、コンソール出力です:

 2011-12-23 08:44:55.765:INFO::jetty-6.1.26 
    SLF4J: Class path contains multiple SLF4J bindings. 
    SLF4J: Found binding in [jar:file:/C:/My_workspace/my_portal   /MyPortal/trunk/MyPortalWebApp/src/main/webapp/WEB-INF/lib/slf4j-  log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/C:/My_workspace/MyPortal/trunk/MyPortalWebApp/src/main/webapp/WEB-INF/lib/slf4j-simple-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
2011-12-23 08:44:57.140:INFO:/MyPortalWebApp:Initializing Spring root WebApplicationContext 
2011-12-23 08:44:57.140:WARN::failed [email protected] {/MyPortalWebApp,C:\My_workspace\MyPortal\trunk\MyPortalWebApp\src\main\webapp}: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V 
2011-12-23 08:44:57.140:WARN::Error starting handlers 
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V 
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159) 
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187) 
at org.springframework.web.context.ContextLoaderListener.contextInitialized  (ContextLoaderListener.java:47) 
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549) 
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) 
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282) 
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518) 
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) 
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) 
at org.mortbay.jetty.Server.doStart(Server.java:224) 
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) 
at runjettyrun.Bootstrap.main(Bootstrap.java:82) 

私が順列の多くを試してみましたいくつかの入力を与えるが、桟橋を実行したときに(上記のように)同じ出力を取得してください。

答えて

0

エラーメッセージに従って、クラスパス(src/main/webapp/WEB-INF/lib/slf4j-simple-1.5.8.jar)にまだslf4j-simple-1.5.8.jarがあります。どのツール(Ant、Maven)をビルドプロセスに使用していますか?

1

Mavenには、slf4j-apiとslf4j-log4jまたはslf4j-loggingのバージョンが自動的に含まれています。彼らは次のように入力して含まれている理由を見つけることができます:あなたは桟橋を使っているので

mvn dependency:tree -Dincludes=org.slf4j 

を、それはまた、突堤アプリでコンテナのクラスパスに含めていることかもしれません。あなたのWebアプリケーションのコンテキストファイルに(それは突堤6歳以上の場合)次の行を追加してみてください:

<Set name="parentLoaderPriority">false</Set> 

それはあなたのWebアプリケーションのものよりも低い優先順位であることをコンテナのjarファイルとリソースを設定する必要があります。

0

SLF4Jさloaded.Tryの互換性のないバージョンこの

 
-In eclipse, open the pom.xml file. 
-select the Dependency Hierarchy tab at the bottom. 
-In the search filter, type the name "slf4j" and see all the dependencies that depend on slf4j for logging. 

によって引き起こされるようですが、あなたが複数回を見つけた場合、あなたはそれぞれの依存関係に

 

    &ltexclusions> 
     &ltexclusion> 
     &ltartifactId>[artifactId]</artifactId> 
     &ltgroupId>[groupId]</groupId> 
     </exclusion> 
    </exclusions> 

をこれを書いてそれを除外することができそうです
関連する問題