[infinispan-issues] [JBoss JIRA] (ISPN-5711) Component injection should deal with optional "provided" dependencies (i.e. javax.transaction)

Dan Berindei (Jira) issues at jboss.org
Wed Mar 25 17:34:36 EDT 2020


     [ https://issues.redhat.com/browse/ISPN-5711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Berindei closed ISPN-5711.
------------------------------
    Fix Version/s: 10.0.0.Beta4
       Resolution: Done


Fixed with ISPN-10137

> Component injection should deal with optional "provided" dependencies (i.e. javax.transaction)
> ----------------------------------------------------------------------------------------------
>
>                 Key: ISPN-5711
>                 URL: https://issues.redhat.com/browse/ISPN-5711
>             Project: Infinispan
>          Issue Type: Bug
>            Reporter: Tristan Tarrant
>            Assignee: Tristan Tarrant
>            Priority: Major
>             Fix For: 10.0.0.Beta4
>
>
> On initialization of the GlobalComponentRegistry, component injection attempts to resolve all classes for all methods in the declaration chain of all the components which might require injection.
> If we ever want to make some dependency truly optional (and "provided" at the maven dep level), we would need to ignore certain classes and inject nulls where necessary.
> Exception in thread "main" org.infinispan.commons.CacheException: Unable to construct a GlobalComponentRegistry!
> 	at org.infinispan.factories.GlobalComponentRegistry.<init>(GlobalComponentRegistry.java:136)
> 	at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:214)
> 	at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:134)
> 	at org.infinispan.tutorial.simple.map.InfinispanMap.main(InfinispanMap.java:10)
> Caused by: org.infinispan.commons.CacheException: Error injecting dependencies for component org.infinispan.notifications.cachemanagerlistener.CacheManagerNotifier
> 	at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:197)
> 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:156)
> 	at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:148)
> 	at org.infinispan.factories.GlobalComponentRegistry.<init>(GlobalComponentRegistry.java:114)
> 	... 3 more
> Caused by: java.lang.NoClassDefFoundError: javax/transaction/Transaction
> 	at java.lang.Class.getDeclaredMethods0(Native Method)
> 	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
> 	at java.lang.Class.getDeclaredMethod(Class.java:2128)
> 	at org.infinispan.commons.util.ReflectionUtil.findMethod(ReflectionUtil.java:98)
> 	at org.infinispan.factories.AbstractComponentRegistry$Component.buildInjectionMethodsList(AbstractComponentRegistry.java:826)
> 	at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:195)
> 	... 6 more
> Caused by: java.lang.ClassNotFoundException: javax.transaction.Transaction
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> 	... 12 more



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list