Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1177

java.lang.IllegalArgumentException attempting to create Logger for HotRod Client when building Infinispan from sources

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Critical Critical
    • None
    • 5.0.0.CR4
    • Core
    • None
    • Hide

      This single line HotRod Client app fails (worked with 4.2.1.FINAL):

      final CacheContainer cacheContainer = new RemoteCacheManager("localhost", 11222);

      with:

      Caused by: java.lang.IllegalArgumentException: Invalid logger interface org.infinispan.client.hotrod.logging.Log (implementation not found)
      at org.jboss.logging.Logger.getMessageLogger(Logger.java:2254)
      at org.jboss.logging.Logger.getMessageLogger(Logger.java:2215)
      at org.infinispan.util.logging.LogFactory.getLog(LogFactory.java:55)
      at org.infinispan.client.hotrod.RemoteCacheManager.<clinit>(RemoteCacheManager.java:148)
      ... 1 more

      Show
      This single line HotRod Client app fails (worked with 4.2.1.FINAL): final CacheContainer cacheContainer = new RemoteCacheManager("localhost", 11222); with: Caused by: java.lang.IllegalArgumentException: Invalid logger interface org.infinispan.client.hotrod.logging.Log (implementation not found) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2254) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2215) at org.infinispan.util.logging.LogFactory.getLog(LogFactory.java:55) at org.infinispan.client.hotrod.RemoteCacheManager.<clinit>(RemoteCacheManager.java:148) ... 1 more
    • Workaround Exists
    • Hide

      Use Maven 3.x

      Show
      Use Maven 3.x

      Changes to 5.0.0 (CR4, in my case) related to logging break my app. I use slf4j for logging and route commons-logging, log4j, and java.util.logging to slf4j to route to Logback.

            [ISPN-1177] java.lang.IllegalArgumentException attempting to create Logger for HotRod Client when building Infinispan from sources

            @Dan, the only reason I can think you're getting that is cos:

            • Intellij compiles to Maven output folders.
            • mvn install finds the classes and so does not compile and as a result does not do annotation processing.

            Basically, annotation processing is not happening for some reason. Btw, see the dev list for instructions on setting up the annotation processor from the IDE and hence avoid the need to run it from mvn command line.

            Tbh, I never do a mvn install alone, I always do a clean before that. In fact, the two mvn commands are used are:

            • When I want to skip the testsuite:
              mvn -Dmaven.test.skip.exec=true -P-extras clean install
            • When I want to run testsuite:
              mvn -Dmaven.test.failure.ignore -P-extras clean install

            Clearly, I have these two options aliased and limit to those.

            Galder Zamarreño added a comment - @Dan, the only reason I can think you're getting that is cos: Intellij compiles to Maven output folders. mvn install finds the classes and so does not compile and as a result does not do annotation processing. Basically, annotation processing is not happening for some reason. Btw, see the dev list for instructions on setting up the annotation processor from the IDE and hence avoid the need to run it from mvn command line. Tbh, I never do a mvn install alone, I always do a clean before that. In fact, the two mvn commands are used are: When I want to skip the testsuite: mvn -Dmaven.test.skip.exec= true -P-extras clean install When I want to run testsuite: mvn -Dmaven.test.failure.ignore -P-extras clean install Clearly, I have these two options aliased and limit to those.

            @Galder, I just tried again with Maven 3 and mvn clean + compile with IntelliJ + mvn install gave me this:

            [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3-JBOSS:test (default-test) on project infinispan-core: null; nested exception is java.lang.ExceptionInInitializerError: null: Invalid logger interface org.infinispan.util.logging.Log (implementation not found) -> [Help 1]

            I don't have any opinion on Maven 3 vs Maven 2, I think we specify the plugin versions in the parent pom anyway so it shouldn't make a big difference.

            Dan Berindei (Inactive) added a comment - @Galder, I just tried again with Maven 3 and mvn clean + compile with IntelliJ + mvn install gave me this: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3-JBOSS:test (default-test) on project infinispan-core: null; nested exception is java.lang.ExceptionInInitializerError: null: Invalid logger interface org.infinispan.util.logging.Log (implementation not found) -> [Help 1] I don't have any opinion on Maven 3 vs Maven 2, I think we specify the plugin versions in the parent pom anyway so it shouldn't make a big difference.

            Btw, shouldn't just force Maven 3 for the build? We no longer need to have Infinispan working w/ old AS/EAP 4.x builds which might have had issues with M3. WDYT?

            Galder Zamarreño added a comment - Btw, shouldn't just force Maven 3 for the build? We no longer need to have Infinispan working w/ old AS/EAP 4.x builds which might have had issues with M3. WDYT?

            @Dan, since the addition of JBoss Logging, I did have to enable annotation processing in IntelliJ, but didn't need to do anything special, just click the box and it worked...

            Galder Zamarreño added a comment - @Dan, since the addition of JBoss Logging, I did have to enable annotation processing in IntelliJ, but didn't need to do anything special, just click the box and it worked...

            As mentioned in the e-mail thread (but repeated here for posterity) it's possible I was resolving against a local project in Eclipse without having APT turned on. In any case I was able to use released artifacts that had the class once the fix to ISPN-1148 was released.

            Jeff Ramsdale (Inactive) added a comment - As mentioned in the e-mail thread (but repeated here for posterity) it's possible I was resolving against a local project in Eclipse without having APT turned on. In any case I was able to use released artifacts that had the class once the fix to ISPN-1148 was released.

            I'm building Infinispan with Maven 2.2.1 on Fedora 14 and it works fine.

            I do get the error from time to time when I build from IntelliJ, because the IntelliJ compiler doesn't do annotation processing (or at least I haven't been able to configure it properly).

            Then when you run 'mvn install' maven sees that the class is up to date and doesn't run annotation processing either. Running 'mvn clean install' usually sorts everything out.

            Dan Berindei (Inactive) added a comment - I'm building Infinispan with Maven 2.2.1 on Fedora 14 and it works fine. I do get the error from time to time when I build from IntelliJ, because the IntelliJ compiler doesn't do annotation processing (or at least I haven't been able to configure it properly). Then when you run 'mvn install' maven sees that the class is up to date and doesn't run annotation processing either. Running 'mvn clean install' usually sorts everything out.

            Posted https://issues.jboss.org/browse/JBLOGGING-65 to address logging issue revealed by this problem.

            Jeff Ramsdale (Inactive) added a comment - Posted https://issues.jboss.org/browse/JBLOGGING-65 to address logging issue revealed by this problem.

            See workaround

            Manik Surtani (Inactive) added a comment - See workaround

            That seemed to do it--build worked with Maven 3. I would suggest someone else do the experiment to verify my findings? If someone else can show the same thing I can post a Jira ticket, or they can.

            Jeff Ramsdale (Inactive) added a comment - That seemed to do it--build worked with Maven 3. I would suggest someone else do the experiment to verify my findings? If someone else can show the same thing I can post a Jira ticket, or they can.

            Jeff, in theory, it should work fine with 2.2.1 though I currently use 3.0.3 cos it's faster. Can you give Maven 3.0.3 a try and see if it works for you? Maybe we have to up the Maven req for building Infinispan.

            To help your debugging, I normally build with:

            mvn -Dmaven.test.skip.exec=true -P-extras clean install

            Then, if I want to limit the build to particular projects, I add -pl at the end such as:

            mvn -Dmaven.test.skip.exec=true -P-extras clean install -pl core,server/core,server/hotrod,client/hotrod-client

            Btw, I'll be away for a fair few days from tomorrow onwards, so maybe you can ping other Infinispan devs on IRC.

            Galder Zamarreño added a comment - Jeff, in theory, it should work fine with 2.2.1 though I currently use 3.0.3 cos it's faster. Can you give Maven 3.0.3 a try and see if it works for you? Maybe we have to up the Maven req for building Infinispan. To help your debugging, I normally build with: mvn -Dmaven.test.skip.exec= true -P-extras clean install Then, if I want to limit the build to particular projects, I add -pl at the end such as: mvn -Dmaven.test.skip.exec= true -P-extras clean install -pl core,server/core,server/hotrod,client/hotrod-client Btw, I'll be away for a fair few days from tomorrow onwards, so maybe you can ping other Infinispan devs on IRC.

            I was looking for you on IRC yesterday but should have commented here. I have no local changes, so the only variable I can think of is my Maven version. I'm using 2.2.1, but I also have Maven 3.0.3. Is there a Maven 3 dependency?

            Jeff Ramsdale (Inactive) added a comment - I was looking for you on IRC yesterday but should have commented here. I have no local changes, so the only variable I can think of is my Maven version. I'm using 2.2.1, but I also have Maven 3.0.3. Is there a Maven 3 dependency?

            @Jeff, I'm closing this for the moment, since it appears to be more of an issue of how you built Infinispan jars rather than a problem with one of the jars we ship. Feel free to re-open if you encounter this issue with a jar we built. If you built it yourself, it'd be interesting to find out why annotation processing didn't work in the build, cos that's creates the implementation that cannot be found.

            Galder Zamarreño added a comment - @Jeff, I'm closing this for the moment, since it appears to be more of an issue of how you built Infinispan jars rather than a problem with one of the jars we ship. Feel free to re-open if you encounter this issue with a jar we built. If you built it yourself, it'd be interesting to find out why annotation processing didn't work in the build, cos that's creates the implementation that cannot be found.

            Hmmm, I'm confused now, but it seems like you're getting this exception after you tried to build Infinispan from head?

            Caused by: java.lang.IllegalArgumentException: 
            Invalid logger interface org.infinispan.client.hotrod.logging.Log (implementation not found)

            That exception appears to mean that in your build, annotation processing did not happen, cos at build time, an implementation of org.infinispan.client.hotrod.logging.Log should have been generated. I don't know why this did not happen. Maybe you modified the pom files somehow? Maybe a JDK issue when building? What JDK do you use?

            I'd be more worried if the issue was found in a jar we publish.

            Galder Zamarreño added a comment - Hmmm, I'm confused now, but it seems like you're getting this exception after you tried to build Infinispan from head? Caused by: java.lang.IllegalArgumentException: Invalid logger interface org.infinispan.client.hotrod.logging.Log (implementation not found) That exception appears to mean that in your build, annotation processing did not happen, cos at build time, an implementation of org.infinispan.client.hotrod.logging.Log should have been generated. I don't know why this did not happen. Maybe you modified the pom files somehow? Maybe a JDK issue when building? What JDK do you use? I'd be more worried if the issue was found in a jar we publish.

            I have a simple class with a main method for testing. Currently I'm running with a launch configuration in Eclipse using m2eclipse to resolve my classpath based on my Maven pom.

            As it turns out I was blocked by https://issues.jboss.org/browse/ISPN-1148 in using CR4, So I built Infinispan from HEAD (29e3ef7df9cfc13a700b16d1a559196f33a3413d).

            My classpath contains the following (from mvn dependency:list):

            [INFO] The following files have been resolved:
            [INFO] cglib:cglib-nodep:jar:2.2:compile
            [INFO] ch.qos.logback:logback-classic:jar:0.9.28:compile
            [INFO] ch.qos.logback:logback-core:jar:0.9.28:compile
            [INFO] commons-pool:commons-pool:jar:1.5.4:compile
            [INFO] i18nlog:i18nlog:jar:1.0.10:compile
            [INFO] jline:jline:jar:0.9.94:compile
            [INFO] net.jini:jsk-dl:jar:2.1:compile
            [INFO] net.jini:jsk-lib:jar:2.1:compile
            [INFO] net.jini:jsk-platform:jar:2.1:compile
            [INFO] net.jini:start:jar:2.1:compile
            [INFO] net.jini.lookup:jmx-lookup:jar:2.1:compile
            [INFO] net.jini.lookup:serviceui:jar:2.1:compile
            [INFO] org.apache.commons:commons-compress:jar:1.0:compile
            [INFO] org.codehaus.groovy:groovy-all:jar:1.7.0:compile
            [INFO] org.infinispan:infinispan-client-hotrod:jar:5.0.0-SNAPSHOT:compile
            [INFO] org.infinispan:infinispan-core:jar:5.0.0-SNAPSHOT:compile
            [INFO] org.jboss.javaee:jboss-transaction-api:jar:1.0.1.GA:compile
            [INFO] org.jboss.logging:jboss-logging:jar:3.0.0.Beta5:compile
            [INFO] org.jboss.marshalling:jboss-marshalling:jar:1.3.0.CR9:compile
            [INFO] org.jboss.marshalling:jboss-marshalling-river:jar:1.3.0.CR9:compile
            [INFO] org.jgroups:jgroups:jar:2.12.0.Final:compile
            [INFO] org.rhq.helpers:rhq-pluginAnnotations:jar:3.0.1:compile
            [INFO] org.rioproject:boot:jar:4.3-SNAPSHOT:compile
            [INFO] org.rioproject:rio:jar:4.3-SNAPSHOT:compile
            [INFO] org.rioproject.substrates.riospan:hotrod-api:jar:1.0.0-SNAPSHOT:compile
            [INFO] org.rioproject.substrates.riospan:hotrod-proxy:jar:1.0.0-SNAPSHOT:compile
            [INFO] org.rioproject.substrates.riospan:riospan-api:jar:1.0.0-SNAPSHOT:compile
            [INFO] org.rioproject.substrates.riospan:riospan-core:jar:1.0.0-SNAPSHOT:compile
            [INFO] org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
            [INFO] org.slf4j:jul-to-slf4j:jar:1.6.1:compile
            [INFO] org.slf4j:log4j-over-slf4j:jar:1.6.1:compile
            [INFO] org.slf4j:slf4j-api:jar:1.6.1:compile

            Jeff Ramsdale (Inactive) added a comment - I have a simple class with a main method for testing. Currently I'm running with a launch configuration in Eclipse using m2eclipse to resolve my classpath based on my Maven pom. As it turns out I was blocked by https://issues.jboss.org/browse/ISPN-1148 in using CR4, So I built Infinispan from HEAD (29e3ef7df9cfc13a700b16d1a559196f33a3413d). My classpath contains the following (from mvn dependency:list): [INFO] The following files have been resolved: [INFO] cglib:cglib-nodep:jar:2.2:compile [INFO] ch.qos.logback:logback-classic:jar:0.9.28:compile [INFO] ch.qos.logback:logback-core:jar:0.9.28:compile [INFO] commons-pool:commons-pool:jar:1.5.4:compile [INFO] i18nlog:i18nlog:jar:1.0.10:compile [INFO] jline:jline:jar:0.9.94:compile [INFO] net.jini:jsk-dl:jar:2.1:compile [INFO] net.jini:jsk-lib:jar:2.1:compile [INFO] net.jini:jsk-platform:jar:2.1:compile [INFO] net.jini:start:jar:2.1:compile [INFO] net.jini.lookup:jmx-lookup:jar:2.1:compile [INFO] net.jini.lookup:serviceui:jar:2.1:compile [INFO] org.apache.commons:commons-compress:jar:1.0:compile [INFO] org.codehaus.groovy:groovy-all:jar:1.7.0:compile [INFO] org.infinispan:infinispan-client-hotrod:jar:5.0.0-SNAPSHOT:compile [INFO] org.infinispan:infinispan-core:jar:5.0.0-SNAPSHOT:compile [INFO] org.jboss.javaee:jboss-transaction-api:jar:1.0.1.GA:compile [INFO] org.jboss.logging:jboss-logging:jar:3.0.0.Beta5:compile [INFO] org.jboss.marshalling:jboss-marshalling:jar:1.3.0.CR9:compile [INFO] org.jboss.marshalling:jboss-marshalling-river:jar:1.3.0.CR9:compile [INFO] org.jgroups:jgroups:jar:2.12.0.Final:compile [INFO] org.rhq.helpers:rhq-pluginAnnotations:jar:3.0.1:compile [INFO] org.rioproject:boot:jar:4.3-SNAPSHOT:compile [INFO] org.rioproject:rio:jar:4.3-SNAPSHOT:compile [INFO] org.rioproject.substrates.riospan:hotrod-api:jar:1.0.0-SNAPSHOT:compile [INFO] org.rioproject.substrates.riospan:hotrod-proxy:jar:1.0.0-SNAPSHOT:compile [INFO] org.rioproject.substrates.riospan:riospan-api:jar:1.0.0-SNAPSHOT:compile [INFO] org.rioproject.substrates.riospan:riospan-core:jar:1.0.0-SNAPSHOT:compile [INFO] org.slf4j:jcl-over-slf4j:jar:1.6.1:compile [INFO] org.slf4j:jul-to-slf4j:jar:1.6.1:compile [INFO] org.slf4j:log4j-over-slf4j:jar:1.6.1:compile [INFO] org.slf4j:slf4j-api:jar:1.6.1:compile

            Jeff, how are you running this code? Where did you get the jar from? And what's the classpath of the execution?

            Galder Zamarreño added a comment - Jeff, how are you running this code? Where did you get the jar from? And what's the classpath of the execution?

              rh-ee-galder Galder Zamarreño
              jramsdale Jeff Ramsdale (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: