7 Replies Latest reply on Feb 13, 2007 3:16 AM by Ypatios Asmanidis

    SeamLoginModule

    Ypatios Asmanidis Newbie

      Hi all. I want to use the SeamLoginModule that uses JAAS in SEAM 1.1.5 and I've read the docs and I try to do it like it says to run an example but it doesn't work...

      here is my components.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
       xmlns:core="http://jboss.com/products/seam/core"
       xmlns:security="http://jboss.com/products/seam/security"
       xmlns:drools="http://jboss.com/products/seam/drools"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation=
       "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
      
       <component name="org.jboss.seam.core.init">
       <property name="jndiPattern">new_uai/#{ejbName}/local</property>
       </component>
      
       <!-- 120 second conversation timeout -->
       <core:manager conversation-timeout="120000"/>
      
       <security:identity authenticate-method="#{authenticator.authenticate}"/>
      
      
      
      </components>
      


      My authenticator method
      package uai.security;
      
      import java.util.Set;
      
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.NoResultException;
      
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.core.FacesMessages;
      
      import uai.entities.User;
      import uai.entities.UserRole;
      
      @Name("authenticator")
      public class Authenticator {
      
       @In
       EntityManager entityManager;
      
       public boolean authenticate(String username, String password,
       Set<String> roles) {
       try {
       User user = (User) entityManager
       .createQuery(
       "from User where username = :username and password = :password")
       .setParameter("username", username).setParameter(
       "password", password).getSingleResult();
       if (user.getRoles() != null) {
       for (UserRole mr : user.getRoles())
       roles.add(mr.getRoles());
       }
       return true;
       } catch (NoResultException ex) {
       FacesMessages.instance().add("Invalid username/password");
       return false;
       }
       }
      
       public boolean testme() {
       System.out.println("hi there");
       return true;
       }
      
      }
      


      and my login form

       <h:form>
      
       <div><h:outputLabel for="name" value="Username" /> <h:inputText
       id="name" value="#{identity.username}" /></div>
      
       <div><h:outputLabel for="password" value="Password" /> <h:inputSecret
       id="password" value="#{identity.password}" /></div>
       <div><h:commandButton value="Login" action="#{identity.login}" /></div>
      
      
      
      
       <div><h:messages layout="table" styleClass="cntError" /></div>
       </h:form>
      


      Now when I run this the only thing I get is a Conversion Error but the submit never goes to the authenticator bean....

      any ideas?

        • 1. Re: SeamLoginModule
          Pete Muir Master

          It would be best to give this a go using 1.1.6.GA (there were a couple of nasty bugs, and the documentation was improved)

          • 2. Re: SeamLoginModule
            Ypatios Asmanidis Newbie

            ok thx..I'll try 1.1.6

            • 3. Re: SeamLoginModule
              Ypatios Asmanidis Newbie

              Well I did tried 1.1.6 and it was alot better...now I can login and authenticate but when the flow returns from the authenticate method the value (true) I got this exception ....

              16:37:00,505 ERROR [SeamExceptionFilter] uncaught exception
              javax.servlet.ServletException: Error calling action method of component with id _id7:_id15
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Thread.java:595)
              16:37:00,552 ERROR [SeamExceptionFilter] exception root cause
              javax.faces.FacesException: Error calling action method of component with id _id7:_id15
               at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
               at javax.faces.component.UICommand.broadcast(UICommand.java:106)
               at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
               at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
               at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
               at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Thread.java:595)
              Caused by: javax.faces.el.EvaluationException: /home.xhtml @51,70 action="#{identity.login}": java.lang.IllegalStateException: no security rule base available - please install a RuleBase with the name 'securityRules'
               at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
               at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
               ... 32 more
              Caused by: java.lang.IllegalStateException: no security rule base available - please install a RuleBase with the name 'securityRules'
               at org.jboss.seam.security.Identity.assertSecurityContextExists(Identity.java:276)
               at org.jboss.seam.security.Identity.populateSecurityContext(Identity.java:245)
               at org.jboss.seam.security.Identity.postAuthenticate(Identity.java:223)
               at org.jboss.seam.security.Identity.authenticate(Identity.java:207)
               at org.jboss.seam.security.Identity.authenticate(Identity.java:199)
               at org.jboss.seam.security.Identity.login(Identity.java:184)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
               at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
               at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
               at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
               ... 33 more
              16:37:00,942 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
              javax.faces.FacesException: Error calling action method of component with id _id7:_id15
               at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
               at javax.faces.component.UICommand.broadcast(UICommand.java:106)
               at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
               at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
               at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
               at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Thread.java:595)
              Caused by: javax.faces.el.EvaluationException: /home.xhtml @51,70 action="#{identity.login}": java.lang.IllegalStateException: no security rule base available - please install a RuleBase with the name 'securityRules'
               at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
               at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
               ... 32 more
              Caused by: java.lang.IllegalStateException: no security rule base available - please install a RuleBase with the name 'securityRules'
               at org.jboss.seam.security.Identity.assertSecurityContextExists(Identity.java:276)
               at org.jboss.seam.security.Identity.populateSecurityContext(Identity.java:245)
               at org.jboss.seam.security.Identity.postAuthenticate(Identity.java:223)
               at org.jboss.seam.security.Identity.authenticate(Identity.java:207)
               at org.jboss.seam.security.Identity.authenticate(Identity.java:199)
               at org.jboss.seam.security.Identity.login(Identity.java:184)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
               at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
               at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
               at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
               ... 33 more
              
              


              And when I call the jsf page for the first time before I run the authenticator.authenticate method I get this exception

              Session event listener threw exception
              java.lang.RuntimeException: exception invoking: compileRuleBase
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:112)
               at org.jboss.seam.Component.callComponentMethod(Component.java:1835)
               at org.jboss.seam.Component.callCreateMethod(Component.java:1783)
               at org.jboss.seam.Component.newInstance(Component.java:1772)
               at org.jboss.seam.Component.getInstance(Component.java:1669)
               at org.jboss.seam.Component.getInstance(Component.java:1636)
               at org.jboss.seam.security.Identity.initSecurityContext(Identity.java:109)
               at org.jboss.seam.security.Identity.create(Identity.java:84)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
               at org.jboss.seam.Component.callComponentMethod(Component.java:1835)
               at org.jboss.seam.Component.callCreateMethod(Component.java:1783)
               at org.jboss.seam.Component.newInstance(Component.java:1772)
               at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:163)
               at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:223)
               at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:41)
               at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:384)
               at org.apache.catalina.session.StandardSession.setId(StandardSession.java:356)
               at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:824)
               at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:290)
               at org.apache.catalina.connector.Request.doGetSession(Request.java:2223)
               at org.apache.catalina.connector.Request.getSession(Request.java:2024)
               at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831)
               at org.apache.myfaces.context.servlet.ServletExternalContextImpl.getSession(ServletExternalContextImpl.java:197)
               at org.jboss.seam.contexts.ContextAdaptor.getSession(ContextAdaptor.java:42)
               at org.jboss.seam.contexts.Lifecycle.beginRequest(Lifecycle.java:42)
               at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:53)
               at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
               at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:103)
               at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Thread.java:595)
              Caused by: java.lang.reflect.InvocationTargetException
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
               ... 60 more
              Caused by: java.lang.NoClassDefFoundError: org/codehaus/janino/IClassLoader
               at java.lang.Class.forName0(Native Method)
               at java.lang.Class.forName(Class.java:164)
               at org.apache.commons.jci.compilers.JavaCompilerFactory.createCompiler(JavaCompilerFactory.java:67)
               at org.drools.compiler.PackageBuilder.loadCompiler(Unknown Source)
               at org.drools.compiler.PackageBuilder.<init>(Unknown Source)
               at org.drools.compiler.PackageBuilder.<init>(Unknown Source)
               at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:40)
               ... 66 more
              
              


              My components.xml file

              <?xml version="1.0" encoding="UTF-8"?>
              <components xmlns="http://jboss.com/products/seam/components"
               xmlns:core="http://jboss.com/products/seam/core"
               xmlns:security="http://jboss.com/products/seam/security"
               xmlns:drools="http://jboss.com/products/seam/drools"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
               http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
              
               <component name="org.jboss.seam.core.init">
               <property name="jndiPattern">new_uai/#{ejbName}/local</property>
               </component>
              
              
               <!-- 120 second conversation timeout -->
               <core:manager conversation-timeout="120000" />
              
               <!-- <core:jbpm>
               <core:process-definitions>
               <value>ordermanagement1.jpdl.xml</value>
               </core:process-definitions>
               <core:pageflow-definitions>
               <value>checkout.jpdl.xml</value>
               <value>newuser.jpdl.xml</value>
               </core:pageflow-definitions>
               </core:jbpm> -->
              
              
               <security:identity
               authenticate-method="#{authenticator.authenticate}" />
              
              
               <drools:rule-base name="securityRules">
               <drools:rule-files>security.drl</drools:rule-files>
               </drools:rule-base>
              
              
              
              </components>
              
              


              and the security.drl is in my jar,war and ear files just in case (putting it in the jar didn't work so I put it everywhere) but it is empty..(I copy paste the example code but it didn't work either)...

              any ideas?

              • 4. Re: SeamLoginModule
                Carsten Hoehne Master

                I have had the same experience with the rule base.

                My configuration is like yours but the contents of my rule file is this:#

                package bazLimsPermissions;
                
                import java.security.Principal;
                
                import org.jboss.seam.security.PermissionCheck;
                import org.jboss.seam.security.Role;


                I put it in a directory besides hibernate.cfg.xml so that it is in the root of the classpath. And it gets deployed correctly, so that it is found at runtime.
                Hope this helps.

                • 5. Re: SeamLoginModule
                  Stephan Bublava Newbie

                   


                  ...
                  Caused by: java.lang.NoClassDefFoundError: org/codehaus/janino/IClassLoader
                  at java.lang.Class.forName0(Native Method)
                  at java.lang.Class.forName(Class.java:164)
                  at org.apache.commons.jci.compilers.JavaCompilerFactory.createCompiler(JavaCompilerFactory.java:67)
                  ...


                  It seems that your EAR file doesn't contain all required libraries.

                  • 6. Re: SeamLoginModule
                    Shane Bryzak Master

                    The rule file element needs to be wrapped:

                     <drools:rule-base name="securityRules">
                     <drools:rule-files><value>/META-INF/security-rules.drl</value></drools:rule-files>
                     </drools:rule-base>
                    


                    • 7. Re: SeamLoginModule
                      Ypatios Asmanidis Newbie

                      Well everything is ok now...thx all, jaas is working just fine...