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

ClassFinder logs lots of warnings when the maven repository path contains "infinispan"

XMLWordPrintable

      ClassFinder.infinispanClasses() tries to find all Infinispan classes by iterating through the classpath entries and adding classes from each entry that contains infinispan in the path or has a sub-sub-...directory called infinispan.

      This doesn't work if the Maven repository path contains infinispan, as it happens on the CI agents, and all the classpath entries are included. When trying to parse a class that doesn't start with org., ClassFinder then throws this exception:

      08:15:47,413 WARN  (TestNG:[]) [ClassFinder] From jar path com/github/benmanes/caffeine/base/UnsafeAccess.class could not load class null
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      	at java.lang.String.substring(String.java:1960) ~[?:1.8.0_141]
      	at org.infinispan.commons.util.ClassFinder.toClassName(ClassFinder.java:183) ~[infinispan-commons.jar:9.1.1-SNAPSHOT]
      	at org.infinispan.commons.util.ClassFinder.findClassesOnPath(ClassFinder.java:144) [infinispan-commons.jar:9.1.1-SNAPSHOT]
      	at org.infinispan.commons.util.ClassFinder.infinispanClasses(ClassFinder.java:90) [infinispan-commons.jar:9.1.1-SNAPSHOT]
      	at org.infinispan.commons.util.ClassFinder.infinispanClasses(ClassFinder.java:72) [infinispan-commons.jar:9.1.1-SNAPSHOT]
      	at org.infinispan.util.ClassFinderTest.testInfinispanClassesNonEmpty(ClassFinderTest.java:11) [test-classes/:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_141]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_141]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_141]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_141]
      	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) [testng-6.8.8.jar:?]
      	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) [testng-6.8.8.jar:?]
      	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) [testng-6.8.8.jar:?]
      	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) [testng-6.8.8.jar:?]
      	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) [testng-6.8.8.jar:?]
      	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) [testng-6.8.8.jar:?]
      	at org.testng.TestRunner.privateRun(TestRunner.java:767) [testng-6.8.8.jar:?]
      	at org.testng.TestRunner.run(TestRunner.java:617) [testng-6.8.8.jar:?]
      	at org.testng.SuiteRunner.runTest(SuiteRunner.java:348) [testng-6.8.8.jar:?]
      	at org.testng.SuiteRunner.access$000(SuiteRunner.java:38) [testng-6.8.8.jar:?]
      	at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:382) [testng-6.8.8.jar:?]
      	at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64) [testng-6.8.8.jar:?]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_141]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_141]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_141]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]
      

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: