Bob Paulin created KARAF-6988:
---------------------------------

             Summary: Error installing json-flattener with wrap command
                 Key: KARAF-6988
                 URL: https://issues.apache.org/jira/browse/KARAF-6988
             Project: Karaf
          Issue Type: Bug
    Affects Versions: 4.2.10
         Environment: OpenJdk 11

Windows 10
            Reporter: Bob Paulin


I'm running Karaf 4.2.10 and I'm upgrading to Camel 3.7.0 with the camel-etcd 
component.  It appears during this installation I was getting an error related 
to one of the bundle installs which I was able to narrow down to the 
json-flattener 0.9.0 jar [1].

The error I get is as follows
{code:java}
karaf@root()> bundle:install 
wrap:mvn:com.github.wnameless.json/json-flattener/0.9.0
java.lang.ArrayIndexOutOfBoundsException: Index 19 out of bounds for length 19
        at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:576)
        at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:494)
        at aQute.bnd.osgi.Clazz.parseClassFileWithCollector(Clazz.java:483)
        at aQute.bnd.osgi.Clazz.parseClassFile(Clazz.java:473)
        at aQute.bnd.osgi.Analyzer.analyzeJar(Analyzer.java:2177)
        at aQute.bnd.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:2083)
        at aQute.bnd.osgi.Analyzer.analyze(Analyzer.java:138)
        at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:616)
        at org.ops4j.pax.swissbox.bnd.BndUtils.createBundle(BndUtils.java:161)
        at 
org.ops4j.pax.url.wrap.internal.Connection.getInputStream(Connection.java:83)
        at 
org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:525)
        at 
org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
        at 
org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:77)
        at 
org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:878)
        at 
org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:550)
        at 
org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:153)
        at 
org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:277)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3009)
        at 
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
        at org.apache.karaf.bundle.command.Install.execute(Install.java:84)
        at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
        at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
        at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Bundle ID: 344
{code}
The bundle appears to spin up with headers and I've not observed any issues.  
Appears it may be related to the JDK version since I did not have this on camel 
2.23.x which appears to use the 0.6.0 version of the json-flattener.  The 
biggest difference between the 0.6.0 and 0.9.0 appears to be the version of 
Java they are compiled with (8 and 11 respectively).  It appears the version of 
bndutils used by the wrap command may not like some of the things in java 11 
during class parsing [2].

 

Could this require a newer version of bndtools in karaf?

 

[1][https://github.com/apache/camel-karaf/blob/44656474197bef444de9ba6c39185fc37b0af7ff/platforms/karaf/features/src/main/resources/features.xml#L1003]

 

[2] 
https://github.com/bndtools/bnd/blob/fa5ff5a48ac36333fd27ec53693f832d4120fa26/biz.aQute.bndlib/src/aQute/bnd/osgi/Clazz.java#L576



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to