users@glassfish.java.net

Re: [SOLVED] Conflicting library with guava

From: Richard Kolb <rjdkolb_at_openrap.org>
Date: Thu, 19 Jan 2012 10:58:59 +0200

Hi Chris

On 19 January 2012 10:37, Chris Oman <COman_at_ext-inc.com> wrote:

> After doing some more testing (deploying each library independently), I
> found that the issue is not guava, but rather slf4j.
>
> Finding that, I did some more digging and found that a bug has already
> been filed http://java.net/jira/browse/GLASSFISH-16964 and resolved in
> 3.1.2.
>

Very nice, thanks for posting :)

regards
Richard.



>
>
>
>
> On Jan 19, 2012, at 2:27 AM, Chris Oman wrote:
>
> I need help trying to resolve what appears to be a conflict with a Google
> library that is built into Weld.
>
> I have an OSGi bundle, with the following classpath specified in the
> manifest file.
>
> Bundle-ClassPath: .,lib/commons-fileupload-1.2.2.jar,lib/portlet-api
> -1.0.jar,lib/opencsv-2.3.jar,lib/bonecp-0.7.1.RELEASE.jar, \
> lib/guava-11.0.jar,lib/slf4j-api-1.6.4.jar,lib/slf4j-log4j12-1.6.4.jar
>
> When deploying the bundle, I get the following stacktrace after
> approximately 1 minute from the time of deployment.
>
> [#|2012-01-19T02:20:52.879-0500|WARNING|glassfish3.1.1|org.glassfish.osgijavaeebase|_ThreadID=20;_ThreadName=Thread-3;|Failed
> to deploy bundle com.ext_inc.tools.audit [269]
> org.glassfish.osgijavaeebase.DeploymentException: Deployment of
> com.ext_inc.tools.audit [269] failed because of following reason: Failed
> while deploying bundle com.ext_inc.tools.audit [269] :
> java.lang.RuntimeException: Failed to deploy bundle [
> com.ext_inc.tools.audit [269] ], root cause: Exception while loading the app
> at
> org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:125)
> at
> org.glassfish.osgijavaeebase.OSGiContainer.deploy(OSGiContainer.java:154)
> at
> org.glassfish.osgijavaeebase.JavaEEExtender.deploy(JavaEEExtender.java:107)
> at
> org.glassfish.osgijavaeebase.JavaEEExtender.access$200(JavaEEExtender.java:61)
> at
> org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:151)
> at
> org.glassfish.osgijavaeebase.JavaEEExtender$HybridBundleTrackerCustomizer$1.call(JavaEEExtender.java:148)
> at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:680)
> Caused by: java.lang.RuntimeException: Failed to deploy bundle [
> com.ext_inc.tools.audit [269] ], root cause: Exception while loading the app
> at
> org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:196)
> at
> org.glassfish.osgijavaeebase.OSGiDeploymentRequest.execute(OSGiDeploymentRequest.java:118)
> at
> org.glassfish.osgijavaeebase.AbstractOSGiDeployer.deploy(AbstractOSGiDeployer.java:121)
> ... 10 more
> Caused by: org.glassfish.deployment.common.DeploymentException:
> java.lang.ArrayIndexOutOfBoundsException: 3
> at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:172)
> at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
> at
> org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:270)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
> at
> com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
> at
> org.glassfish.osgijavaeebase.OSGiDeploymentRequest.deploy(OSGiDeploymentRequest.java:183)
> ... 12 more
> Caused by: com.google.common.collect.ComputationException:
> java.lang.ArrayIndexOutOfBoundsException: 3
> at
> com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:218)
> at
> com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
> at
> com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
> at
> org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:183)
> at
> org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:146)
> at
> org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:124)
> at
> org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:54)
> at
> org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:42)
> at
> com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
> at
> com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
> at
> com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
> at
> org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:183)
> at
> org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:146)
> at
> org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:124)
> at
> org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:54)
> at
> org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:42)
> at
> com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
> at
> com.google.common.collect.ComputingConcurrentHashMap.apply(ComputingConcurrentHashMap.java:100)
> at
> com.google.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:515)
> at
> org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:183)
> at
> org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:96)
> at
> org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:133)
> at
> org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:192)
> at
> org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:370)
> at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:170)
> ... 17 more
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 3
> at
> org.jboss.weld.introspector.jlr.WeldConstructorImpl.<init>(WeldConstructorImpl.java:113)
> at
> org.jboss.weld.introspector.jlr.WeldConstructorImpl.of(WeldConstructorImpl.java:70)
> at
> org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:228)
> at
> org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:124)
> at
> org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:54)
> at
> org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:42)
> at
> com.google.common.collect.ComputingConcurrentHashMap.compute(ComputingConcurrentHashMap.java:206)
> ... 41 more
> |#]
>
>
> I have tried deploying guava, slf4j, and bonecp as their own bundles,
> since they have been packaged for OSGi, but having guava as a standalone
> problem causes immense amounts of problems with Weld.
>
> I have tried inlining the classes into my project instead of having them
> on the Bundle-ClassPath but that has also not helped.
>
> Any ideas are welcome at this point.
>
> Thanks,
> Chris
>
>
>
> Chris Oman
> Lead Developer - Interfaces
> EXTENSION, INC.
> Email: COman_at_ext-inc.com
> Office: 260-797-0200
> General: 877-207-3753
> OpenTheRedBox.com
>
>
>
>
> Chris Oman
> Lead Developer - Interfaces
> EXTENSION, INC.
> Email: COman_at_ext-inc.com
> Office: 260-797-0200
> General: 877-207-3753
> OpenTheRedBox.com
>
>