eclipse-archived / concierge

Eclipse Concierge™ project
https://www.eclipse.org/concierge/
Eclipse Public License 1.0
33 stars 22 forks source link

ArrayIndexOutOfBoundsException #57

Open hsynkrtl opened 6 years ago

hsynkrtl commented 6 years ago

While making the first steps with concierge, i stepped over this issue.

My bundles are in start order

-install ThirdPartyBndShaded.jar

-istart gemini-blueprint-core.jar
-istart gemini-blueprint-io.jar
-istart gemini-blueprint-extender.jar

The shaded jar is a lot of third party stuff shaded together with a valid osgi manifest auto generated with bnd. It includes also the springframework. Where the "SpringProperties" try to access an resource out of the class path. But that resource didn't exist. Which leads to the following error.

Jun 13, 2018 3:47:18 PM org.eclipse.gemini.blueprint.extender.internal.boot.ChainActivator <init>
INFORMATION: Blueprint API detected; enabling Blueprint Container functionality
Jun 13, 2018 3:47:18 PM org.eclipse.gemini.blueprint.extender.internal.activator.LoggingActivator start
INFORMATION: Starting [org.eclipse.gemini.blueprint.extender] bundle v.[3.0.0.M01]
Exception in thread "main" org.osgi.framework.BundleException: Error starting bundle [org.eclipse.gemini.blueprint.extender-3.0.0.M01]
        at org.eclipse.concierge.BundleImpl.activate0(BundleImpl.java:600)
        at org.eclipse.concierge.BundleImpl.activate(BundleImpl.java:552)
        at org.eclipse.concierge.BundleImpl.start(BundleImpl.java:506)
        at org.eclipse.concierge.BundleImpl.start(BundleImpl.java:444)
        at org.eclipse.concierge.compat.service.XargsFileLauncher.processXargsInputStream(XargsFileLauncher.java:183)
        at org.eclipse.concierge.compat.service.XargsFileLauncher.processXargsFile(XargsFileLauncher.java:83)
        at org.eclipse.concierge.Concierge.doMain(Concierge.java:606)
        at org.eclipse.concierge.Concierge.main(Concierge.java:525)
Caused by: java.lang.ExceptionInInitializerError
        at org.springframework.beans.CachedIntrospectionResults.<clinit>(CachedIntrospectionResults.java:98)
        at org.eclipse.gemini.blueprint.extender.internal.activator.JavaBeansCacheActivator.initJavaBeansCache(JavaBeansCacheActivator.java:62)
        at org.eclipse.gemini.blueprint.extender.internal.activator.JavaBeansCacheActivator.start(JavaBeansCacheActivator.java:44)
        at org.eclipse.gemini.blueprint.extender.internal.boot.ChainActivator.start(ChainActivator.java:93)
        at org.eclipse.concierge.BundleImpl.activate0(BundleImpl.java:575)
        ... 7 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at org.eclipse.concierge.RFC1960Filter.stringCompare(RFC1960Filter.java:623)
        at org.eclipse.concierge.BundleImpl$Revision$BundleClassLoader.findResource1(BundleImpl.java:2774)
        at org.eclipse.concierge.BundleImpl$Revision$BundleClassLoader.findResource0(BundleImpl.java:2687)
        at org.eclipse.concierge.BundleImpl$Revision$BundleClassLoader.findResource(BundleImpl.java:2543)
        at org.eclipse.concierge.BundleImpl$Revision$BundleClassLoader.getResource(BundleImpl.java:2519)
        at org.springframework.core.SpringProperties.<clinit>(SpringProperties.java:61)
        ... 12 more

I just added an empty matching resource to the classpath and the problem is gone away.

I would love to provide a patch, but as i mentioned these are my first steps, so i can't actually. Hope someone can solve that issue.

JochenHiller commented 6 years ago

Hi @hsynkrtl thanks for sharing the problem. Which version (or snapshot) did you use for testing? We fixed one issue with listResources, which might be in same area. See https://github.com/eclipse/concierge/pull/55/files

Can you share your environment (JAR files, xargs file), or break it down to a smaller test case?

hsynkrtl commented 6 years ago

Hi Jochen,

i found that issue in the latest download release and verified it with a local build of the master branch.

I also build a Test bundle which trys to load a not existing resource with the classloaders gerResource method, but the error didn't occur in this case.

I also tested the gemini and shaded bundle where the error occured with apache felix, but felix started the bundles without any error.

Sorry i can't deliver more detailed information.

rellermeyer commented 6 years ago

Hi Hüseyin,

I have an idea where the problem is coming from and just committed an attempted fix. Could you please test it and let me know if it works?

Thanks,

Jan.