PicketLink - NoClassDefFound: org/picketlink/idm/config/StoreConfiguration

467 views Asked by At

I'm beginning to migrate my Seam 2.3 app over to JavaEE 6, and as part of that will be using PicketLink 2.5.0 and PicketBox 5.0 for security, particularly the IDM component. I'm trying to make use of the JPA Identity Store, and have created my own entities with the appropriate annotations. However, when I attempt to add a user, I get the following exception:

java.lang.NoClassDefFoundError: org/picketlink/idm/config/StoreConfiguration

I've looked in the JAR files, and sure enough I don't see this object. I'm using PicketBox 5.0. Is this a known issue with this combination of PicketLink and PicketBox? Is there something I'm doing wrong? Is this object located in a different JAR? The code to create my user looks like this:

ConfigurationBuilder builder = new ConfigurationBuilder();
builder.identityManager().jpaStore();

PicketBoxConfiguration config = builder.build();
DefaultPicketBoxManager picketBoxManager = new DefaultPicketBoxManager(
        config);

picketBoxManager.start();

EntityManagerPropagationContext.set(this.entityManager);

IdentityManager idm = picketBoxManager.getIdentityManager();

    SimpleUser user = new SimpleUser("testuser");
    idm.add(user);
    System.out.println("User added");

UPDATE: A bit more info on my setup...

I have downloaded PicketLink 2.5.0beta6 and PicketBox 5.0.0. All the relevant JARs are maintained within my EAR file, which is deployed on JBoss EAP 6.1. When I run my code, I see the following Exception thrown:

java.lang.NoClassDefFoundError: org/picketlink/idm/config/StoreConfiguration
    org.picketbox.core.AbstractPicketBoxManager.doStart(AbstractPicketBoxManager.java:244)
    org.picketbox.core.AbstractPicketBoxLifeCycle.start(AbstractPicketBoxLifeCycle.java:53)
    net.test.services.TestEJB.doTest(TestEJB.java:42)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:601)
    org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
    org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
    org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
    org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
    org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
    org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374)
    org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:129)
    org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:137)
    org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:58)
    org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

...

JBWEB000071: root cause

java.lang.ClassNotFoundException: org.picketlink.idm.config.StoreConfiguration from [Module "deployment.TestApp-ear.ear:main" from Service Module Loader]
    org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196)
    org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444)
    org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432)
    org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374)
    org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119)
    org.picketbox.core.AbstractPicketBoxManager.doStart(AbstractPicketBoxManager.java:244)
    org.picketbox.core.AbstractPicketBoxLifeCycle.start(AbstractPicketBoxLifeCycle.java:53)
    net.test.services.TestEJB.doTest(TestEJB.java:42)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:601)
1

There are 1 answers

0
Shadowman On BEST ANSWER

I was able to locate documentation on the JBoss site that explained how to upgrade the PicketLink libraries within JBoss EAP 6.1. That solved everything.