[infinispan-issues] [JBoss JIRA] (ISPN-5092) CDI fails when both remote and embedded uber-jar are present

Vojtech Juranek (JIRA) issues at jboss.org
Wed Dec 17 17:16:29 EST 2014


    [ https://issues.jboss.org/browse/ISPN-5092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028470#comment-13028470 ] 

Vojtech Juranek commented on ISPN-5092:
---------------------------------------

After fixing NPE, it fails with following error, as both uber-jars contains same extension
{noformat}
org.jboss.weld.exceptions.DeploymentException: Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [InfinispanExtension] with qualifiers [@Default] at injection point [[parameter 1] of [method] @Inject public org.infinispan.jcache.annotation.InjectedCacheResolver.inject(InfinispanExtension, BeanManager)]. Possible dependencies [[Extension [class org.infinispan.cdi.InfinispanExtension] with qualifiers [@Default]; jar:file/maven/repository/org/infinispan/infinispan-remote/7.1.0-SNAPSHOT/infinispan-remote-7.1.0-SNAPSHOT.jar!/META-INF/services/javax.enterprise.inject.spi.Extension at 1[org.infinispan.cdi.InfinispanExtension at 1c6415e2], Extension [class org.infinispan.cdi.InfinispanExtension] with qualifiers [@Default]; jar:file:/maven/repository/org/infinispan/infinispan-embedded/7.1.0-SNAPSHOT/infinispan-embedded-7.1.0-SNAPSHOT.jar!/META-INF/services/javax.enterprise.inject.spi.Extension at 1[org.infinispan.cdi.InfinispanExtension at 3dd9dd68]]]
        at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:314)
        at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
        at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
        at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
        at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
        at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
        at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
        at org.jboss.weld.bootstrap.api.helpers.ForwardingBootstrap.validateBeans(ForwardingBootstrap.java:85)
        at org.jboss.weld.environment.se.Weld.initialize(Weld.java:134)
        at org.infinispan.all.remote.RemoteCacheCDITest.loadBean(RemoteCacheCDITest.java:28)
{noformat}

> CDI fails when both remote and embedded uber-jar are present
> ------------------------------------------------------------
>
>                 Key: ISPN-5092
>                 URL: https://issues.jboss.org/browse/ISPN-5092
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Build process, CDI Integration
>            Reporter: Vojtech Juranek
>
> When both uber-jars {{infinispan-remote}} and {{infinispan-embedded}} (e.g. for {{RemoteCacheStore}}), CDI fails with
> {noformat}
> org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
> Exception 0 :
> java.lang.NullPointerException
>         at org.infinispan.cdi.util.defaultbean.DefaultBeanExtension.afterBeanDiscovery(DefaultBeanExtension.java:345)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267)
>         at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
>         at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
>         at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263)
>         at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:170)
>         at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:51)
>         at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:154)
>         at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:245)
>         at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:233)
>         at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:213)
>         at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:75)
>         at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:46)
>         at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:42)
>         at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:359)
>         at org.jboss.weld.bootstrap.api.helpers.ForwardingBootstrap.deployBeans(ForwardingBootstrap.java:70)
>         at org.jboss.weld.environment.se.Weld.initialize(Weld.java:133)
>         at org.infinispan.all.remote.RemoteCDIDefaultCacheTest.loadBean(RemoteCDIDefaultCacheTest.java:26)
> {noformat}
> It's prpbably because CDI stuff is included in both jar and {{exclude}} in {{pom.xml}} doesn't work for uber-jars



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the infinispan-issues mailing list