Repository custom implementation + repository configuration CDI beans are not resolved in Weblogic 12c [DATACMNS-617] #1080
Comments
Gonçalo Marques commented I have sent a pull request that fixes the issue. Basically we will fallback to the Bean Manager fetched though JNDI if the extension provided Bean Manager fails to resolve custom repository beans. The same applies to an eventual custom repository configuration, ie. an application provided CdiRepositoryConfiguration implementation |
Gonçalo Marques commented Oliver, I have updated the pull request in order to be fully compliant with I've struggled a little bit with Cheers, |
Jens Schauder commented I'm closing this for the following reasons:
|
Gonçalo Marques opened DATACMNS-617 and commented
In the environment described above, each CDI module (library containing a beans.xml descriptor) will have its own
BeanManager
instance.Apparently, all CDI extensions will have a shared (and distinct from the modules described above)
BeanManager
. I currently have 3 extensions deployed - Spring Data, Apache DeltaSpike and a custom made CDI extension - and I confirmed that they all share the sameBeanManager
instance that is distinct from theBeanManager
instances that are assigned to each module. The extension'sBeanManager
instances are the ones that are injected into the extension listeners (e.g.void afterBeanDiscovery()
).Since
org.springframework.data.repository.cdi.CdiRepositoryBean
is holding a reference to theBeanManager
that was injected into the extension, when it later tries to resolve an eventual custom repository implementation bean using this sameBeanManager
, theBeanManager
will not be able to resolve the custom implementation bean because it is loaded by anotherBeanManager
(the one that is assigned to the module (or JAR) where the custom implementation bean resides).This is also valid for the custom configuration
org.springframework.data.repository.cdi.CdiRepositoryConfiguration
implementation. TheCdiRepositoryBean
will not be able to resolve an eventualCdiRepositoryConfiguration
implementation because of the same reason.Note that this affects the environment described at the beginning of the issue. I have tested it in another container - with a much more recent version of Weld - and the issue does not occur, but Weblogic 12c is a widely used application server. I'm attaching a sample project that demonstrates the issue.
In order to reproduce the problem just access the servlet
http://[host]:[port]/[context-path]/test
Affects: 1.9.1 (Evans SR1), 1.10 M1 (Fowler)
Attachments:
Referenced from: pull request #109
The text was updated successfully, but these errors were encountered: