| https://gist.github.com/scottmarlow/651a1d5762a84b2da6ce shows the WildFly call stack that detects the portable extension. I understand why I am getting the exception and am pleased to see that the portable extension is looked for. Next step will be to introduce a separate portable extension class. I'm thinking that our approach here should be something like: 1. Change org.hibernate.jpa.event.internal.jpa.BeanManagerListenerFactory to hand off a initialization task to the CDI portable extension factory. 2. If the CDI portable extension is called as expected, during the AfterDeploymentValidation event notification, the handed off initialization task will be executed. 3. If the CDI portable extension is not called as expected, when the entity listener use is attempted, we will throw an error. One thing that I don't really understand is whether all CDI environments will detect the CDI portable extension in Hibernate. If there are some CDI environments that do not properly detect the portable extension, an alternative to #3 could be to initialize the entity listener on first use, instead of throwing an error. |