4 Replies Latest reply on May 3, 2013 10:37 PM by wolfch

    java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log

    Hanspeter Gisler Newbie

      If I try to use Weld


       <dependencyManagement>
            <dependencies>
               <dependency>
                  <groupId>org.jboss.weld</groupId>
                  <artifactId>weld-core-bom</artifactId>
                  <version>1.1.4.Final</version>
                  <scope>import</scope>
                  <type>pom</type>
               </dependency>
      
               ...
               
            </dependencies>
         </dependencyManagement>
      
         <dependencies>
            <dependency>
               <groupId>org.jboss.weld.se</groupId>
               <artifactId>weld-se-core</artifactId>
               <scope>test</scope>
            </dependency>
              
            ...
      
         </dependencies>
      



      together with slf4j in a version greater than/equal to 1.6


               <dependency>
                  <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-log4j12</artifactId>
                  <!-- <version>1.5.11</version> -->
                  <version>1.6.2</version>
               </dependency>
            
               <dependency>
                  <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-api</artifactId>
                  <!-- <version>1.5.11</version> -->
                  <version>1.6.2</version>
               </dependency>
      
      



      then I get the following error:


      Caused by: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
           at org.slf4j.cal10n.LocLogger.info(LocLogger.java:122)
           at org.jboss.weld.bootstrap.WeldBootstrap.<clinit>(WeldBootstrap.java:198)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
           at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
           at java.lang.Class.newInstance0(Class.java:372)
           at java.lang.Class.newInstance(Class.java:325)
           at org.jboss.weld.environment.se.Weld.initialize(Weld.java:69)
      



      any ideas on how to solve this, if I would like to keep working with slf4j greater than 1.6?


      Thanks for any help!