1 Reply Latest reply on Aug 27, 2012 7:44 PM by James Livingston

    How Do You Make Deployment Classes Available to Server Modules - Example 2

    pugsherpa Newbie

      Similar to this post, how can I make our custom login module classes visible to the module org.picketbox:main?

       

      Here's the error (forgive typos):

      {code}

      ERROR [org.jboss.security.authentication.JbossCachedAuthenticationManager] Login failure: javax.security.auth.login.LoginException: unable to find LoginModule class: com.fishstore.security.jboss.HibernateLoginModule from [Module "org.picketbox:main" from local module loader @7ca522a6 (roots: /apps/jboss/modules)]]

           at javax.security.auth.login.LoginContext.invoke(LoginContext.java:808) [rt.jar:1.6.0_27]

           at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) [rt.jar:1.6.0_27]

           at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) [rt.jar:1.6.0_27]

           at java.security.AccessController.doPrivileged(Native Method)[rt.jar:1.6.0_27]

           at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)[rt.jar:1.6.0_27]

           at javax.security.auth.login.LoginContext.login(LoginContext.java:579)[rt.jar:1.6.0_27]

           at org.jboss.security.authentication.JbossCachedAuthenticationManager.defaultLogin(JbossCachedAuthenticationManager.java:449) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

           at org.jboss.security.authentication.JbossCachedAuthenticationManager.proceedWithJaasLogin(JbossCachedAuthenticationManager.java:383) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

           at org.jboss.security.authentication.JbossCachedAuthenticationManager.authenticate(JbossCachedAuthenticationManager.java:371) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

           at org.jboss.security.authentication.JbossCachedAuthenticationManager.isValid(JbossCachedAuthenticationManager.java:160) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final]

           at org.jboss.security.plugins.JbossSecuritySubjectFactory.createSubject(JbossSecuritySubjectFactory.java:88) [picketbox-4.0.7.Final.jar:4.0.7.Final]

           at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:1019)

           at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:1014)

           at java.security.AccessController.doPrivileged(Native Method)[rt.jar:1.6.0_27]

           at org.jboss.jca.deployers.common.AbstractDsDeployer.createSubject(AbstractDsDeployer.java:1013)

           at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:562)

           at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectssAndInjectValue(AbstractDsDeployer.java:282)

           at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(AbstractDataSourceService.java:271)

           at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:111)

           at org.jboss.msc.service.ServicecontrollerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

           at org.jboss.msc.service.ServicecontrollerImpl$StartTask.run(ServiceControllerImpl.java:1746)

           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[rt.jar:1.6.0_27]

           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[rt.jar:1.6.0_27]

           at java.lang.Thread.run(Thread.java:662)[rt.jar:1.6.0_27]

      {code}

       

      com.fishstore.security.jboss.HibernateLoginModule class is in fishstore-classes.jar

       

      {code}

      fishstore.ear
           |
           ---  fishstore-ejb.jar
           |
           ---  fishstore-rest-webapp.jar
           |
           ---  fishstore-webapp.war
           |
           ---  APP-INF
                    |
                    --- lib
                          |
                          ---  fishstore-classes.jar
                          |
                          ---  fishstore-hibernate-archive.jar
                                             |
                                             --- *.hbm.xml   hibernate.properties
                                             |
                                             --- META-INF
                                                      |
                                                      ---  persistence.xml

      {code}

       

      The configuration (standalone.xml) looks like so:

       

      {code}

      <datasources>

           <datasource jndi-name="java:jboss:/fishstore/fishstoreDataSource" pool-name="FishstoreDataSource" enabled="true" use-java-context="true">

                <connection-url>url</connection-url>

                <driver>oracle</driver>

                <security>

                     <user-name>validuser</user-name>

                     <password>validpw</password>

                     <security-domain>fishstore-db</security-domain>

                </security>    

           </datasource>

      </datasources>

      .....

      <security-domain name="fishstore-db">

           <authentication>

                <login-module code="com.fishstore.security.jboss.HibernateLoginModule" flag="required">

                     .....

                </login-module>

           </authentication>

      </security-domain>

       

      {code}