On Sat, 2016-08-06 at 11:43 -0400, Bill Burke wrote:
I've implemented a Keycloak provider deployer and it works
great. I
re-implemented the JPA User Storage SPI example. The provider is now
a
@Stateful EJB and EntityManager access is all managed by
@PersistenceContext. The example now looks really simple and
elegant
rather than the crap I mentioned before. Would not have worked
without
the JTA integration I did (see previous email). Things left to do:
Do I need to do something special to get the CDI container bootstrapped
in a deployment? I'm deploying a jar which contains CDI annotated
classes and a beans.xml (though the beans.xml should not be necessary)
and yet I get:
Caused by: java.lang.ClassNotFoundException: javax.enterprise.inject.spi.CDI from [Module
"deployment.envestnet-auth-full.jar:main" from Se
rvice Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
If I add a dependency on javaee.api to my MANIFEST.MF the class not
found goes away, but instead I get:
Caused by: java.lang.IllegalStateException: Singleton not set for STATIC_INSTANCE =>
[]
at
org.jboss.weld.bootstrap.api.helpers.RegistrySingletonProvider$RegistrySingleton.get(RegistrySingletonProvider.java:28)
at org.jboss.weld.Container.instance(Container.java:55)
at org.jboss.as.weld.WeldProvider.getCDI(WeldProvider.java:61)
at javax.enterprise.inject.spi.CDI.current(CDI.java:60)
...
Both can be triggered at the users page by clicking 'View all users'.
This is a UserFederationProvider I'm trying to convert to a deployment
so I can use JPA & CDI. I'm reusing code from another project which is
CDI based, so rewriting logic to be EJB based as in your user-storage-
jpa example would not be ideal.
--
Harold Campbell <hcamp(a)muerte.net>
"Stupidity, like virtue, is its own reward"
-- William E. Davidsen