8 Replies Latest reply on Oct 5, 2011 4:17 PM by bwilly

    seam-security Login failed NPE

    zoul akhdar Newbie

      I have a ear (war and jar )  packaged  seam 3 project running on AS7 . I want to integrate security features based from security-idmconsole example when i deploy the project  it's ok but when i want to loggin i got a NPE :




      17:51:02,217 INFO  [org.jboss.web] (MSC service thread 1-3) registering web context: /PPOSMWeb
      17:51:02,266 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "PPOSMEar.ear"
      17:51:19,416 WARN  [org.jboss.seam.faces.environment.SeamApplicationWrapper] (http--127.0.0.1-8080-3) Cannot attempt extension on null
      17:51:19,429 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] (http--127.0.0.1-8080-3) Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
      17:51:19,446 WARN  [org.jboss.seam.faces.environment.SeamApplicationWrapper] (http--127.0.0.1-8080-3) Cannot attempt extension on null
      17:51:19,572 ERROR [org.jboss.seam.security.IdentityImpl] (http--127.0.0.1-8080-3) Login failed: java.lang.RuntimeException: java.lang.NullPointerException
           at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:329) [seam-security.jar:]
           at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:229) [seam-security.jar:]
           at org.jboss.seam.security.IdentityImpl$Proxy$_$$_WeldClientProxy.login(IdentityImpl$Proxy$_$$_WeldClientProxy.java) [seam-security.jar:]
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]
           at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
           at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
           at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
           at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
           at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
           at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
           at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79) [primefaces-3.0.M1.jar:]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]
           at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
           at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
      Caused by: java.lang.NullPointerException
           at org.picketlink.idm.impl.api.session.IdentitySessionImpl.<init>(IdentitySessionImpl.java:138) [picketlink-idm-core.jar:]
           at org.picketlink.idm.impl.api.IdentitySessionFactoryImpl.createIdentitySession(IdentitySessionFactoryImpl.java:114) [picketlink-idm-core.jar:]
           at org.jboss.seam.security.management.picketlink.IdentitySessionProducer.createIdentitySession(IdentitySessionProducer.java:136) [seam-security.jar:]
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]
           at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
           at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:169) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.bean.ProducerMethod$1.produce(ProducerMethod.java:149) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:361) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:122) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:124) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
           at org.jboss.weld.proxies.IdentitySession$-116769523$Proxy$_$$_WeldClientProxy.getAttributesManager(IdentitySession$-116769523$Proxy$_$$_WeldClientProxy.java)
           at org.jboss.seam.security.management.IdmAuthenticator.authenticate(IdmAuthenticator.java:44) [seam-security.jar:]
           at org.jboss.seam.security.management.IdmAuthenticator$Proxy$_$$_WeldClientProxy.authenticate(IdmAuthenticator$Proxy$_$$_WeldClientProxy.java) [seam-security.jar:]
           at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:305) [seam-security.jar:]
           ... 40 more




      my seam-beans.xml located on WEB-INF/classes/META-INF




      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:s="urn:java:ee" xmlns:drools="urn:java:org.jboss.seam.drools:org.jboss.seam.drools.config"
           xmlns:security="urn:java:org.jboss.seam.security.permission"
           xmlns:plidm="urn:java:org.jboss.seam.security.management.picketlink"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
      
      
      
           
      
           <security:JpaPermissionStore>
                <s:replaces/>
                <security:identityPermissionClass>ci.prosuma.entity.identity.IdentityPermission</security:identityPermissionClass>
           </security:JpaPermissionStore>
      
           <plidm:JpaIdentityStoreConfiguration>
                <s:replaces />
                <plidm:identityClass>ci.prosuma.entity.identity.IdentityObject</plidm:identityClass>
                <plidm:credentialClass>ci.prosuma.entity.identity.IdentityObjectCredential</plidm:credentialClass>
                <plidm:relationshipClass>ci.prosuma.entity.identity.IdentityObjectRelationship</plidm:relationshipClass>
                <plidm:roleTypeClass>ci.prosuma.entity.identity.IdentityRoleName</plidm:roleTypeClass>
                <plidm:attributeClass>ci.prosuma.entity.identity.IdentityObjectAttribute</plidm:attributeClass>
           </plidm:JpaIdentityStoreConfiguration>
      
      </beans>
      



      i also have an EntityManagerProducer and all xhtml are same of security-idmconsole .


      security.drl is located on WEB-INF/classes/
      all entities is copy/past from the example , i just modified the datasourceto fit  my database.


      What's i wrong ?

        • 1. Re: seam-security Login failed NPE
          Jason Porter Master

          Do you have Seam Config in your application?

          • 2. Re: seam-security Login failed NPE
            zoul akhdar Newbie

            yes i have  in my MyEAR/EarContent/lib




            seam-cath.jar
            seam-config-xml.jar
            seam-faces.jar
            seam-international.jar
            seam-persistence.jar
            seam-security.jar
            seam-servlet.jar
            seam-solder.jar
            drools-api.jar
            drools-compiler.jar
            drools-core.jar
            ecj.jar
            el-impl.jar
            joda-time.jar
            mvel2.jar
            nekohtml.jar
            picketlink-idm-api.jar
            picketlink-idm-common.jar
            picketlink-idm-core.jar
            picketlink-idm-spi.jar
            spring-beans.jar
            spring-context.jar
            spring-core.jar
            spring-dao.jar
            spring-jdbc.jar










            • 3. Re: seam-security Login failed NPE
              Shane Bryzak Master

              Could you please set a breakpoint in org.jboss.seam.security.management.picketlink.IdentitySessionProducer.init(), and check if the identity stores are found successfully?  It should happen in the following loop:




                      Set<Bean<?>> storeBeans = manager.getBeans(IdentityStoreConfiguration.class);
                      for (Bean<?> storeBean : storeBeans) {
                          IdentityStoreConfiguration config = (IdentityStoreConfiguration) manager
                                  .getReference(storeBean, IdentityStoreConfiguration.class,
                                          manager.createCreationalContext(storeBean));
              
                          if (config.isConfigured()) {
                              IdentityStoreConfigurationMetaDataImpl storeConfig = new IdentityStoreConfigurationMetaDataImpl();
                              config.configure(storeConfig);
                              stores.add(storeConfig);
              
                              if (defaultStoreId == null && storeConfig.getId() != null) {
                                  defaultStoreId = storeConfig.getId();
                              }
                          }
                      }



              • 4. Re: seam-security Login failed NPE
                zoul akhdar Newbie

                set a breakpoint in org.jboss.seam.security.management.picketlink.IdentitySessionProducer.init()
                the identityStores  list is empty  see  the  debug variable tree  :





                this----IdentitySessionProducer  (id=144)     
                   |----defaultAttributeStoreId     null     
                   |----defaultIdentityStoreId     null     
                   |----defaultRealm     "default" (id=151)     
                   |----entityManagerInstance     InstanceImpl<T>  (id=156)     
                   |    |-------beanManager     BeanManagerImpl  (id=162)     
                   |    |-------creationalContext     CreationalContextImpl<T>  (id=245)     
                   |    |-------injectionPoint     FieldInjectionPoint<T,X>  (id=249)     
                   |----factory     null     
                   |----manager     BeanManagerImpl  (id=162)     
                     |-------accessibleManagers     HashSet<E>  (id=180)     
                     |-------beanResolver     TypeSafeBeanResolver<T>  (id=184)     
                     |-------beans     CopyOnWriteArrayList<E>  (id=190)     
                     |-------beanSet     Collections$SynchronizedSet<E>  (id=193)     
                     |-------childActivities     CopyOnWriteArraySet<E>  (id=196)     
                     |-------childIds     AtomicInteger  (id=198)     
                     |-------clientProxyProvider     ClientProxyProvider  (id=201)     
                     |-------contexts     Multimaps$CustomListMultimap<K,V>  (id=203)     
                     |-------currentActivities     CopyOnWriteArraySet<E>  (id=209)     
                     |-------decoratorResolver     TypeSafeDecoratorResolver  (id=210)     
                     |-------decorators     CopyOnWriteArrayList<E>  (id=212)     
                     |-------enabled     Enabled  (id=213)     
                     |-------enterpriseBeans     ConcurrentHashMap<K,V>  (id=215)     
                     |-------id     "PPOSMEar.ear.PPOSMWeb.war/D:/jboss-as-7.0.0.Final/standalone/deployments/PPOSMEar.ear/PPOSMWeb.war/WEB-INF/lib/seam-security.jar" (id=218)     
                     |-------interceptorMetadataReader     DefaultMetadataCachingReader  (id=220)     
                     |-------interceptorModelRegistry     ConcurrentHashMap<K,V>  (id=223)     
                     |-------interceptorResolver     TypeSafeInterceptorResolver  (id=224)     
                     |-------interceptors     CopyOnWriteArrayList<E>  (id=226)     
                     |-------nameBasedResolver     NameBasedResolver  (id=227)     
                     |-------namespaces     CopyOnWriteArrayList<E>  (id=229)     
                     |-------observerResolver     TypeSafeObserverResolver  (id=230)     
                     |-------observers     CopyOnWriteArrayList<E>  (id=232)     
                     |-------rootNamespace     null     
                     |-------services     SimpleServiceRegistry  (id=233)     
                     |-------specializedBeans     HashMap<K,V>  (id=236)     
                     |-------transitiveBeans     CopyOnWriteArrayList<E>  (id=238)     
                     |-------weldELResolver     WeldELResolver  (id=239)     
                metadata--------IdentityConfigurationMetaDataImpl  (id=263)     
                |-------identityStores     LinkedList<E>  (id=370)     
                |       |-------header     LinkedList$Entry<E>  (id=379)     
                |       |-------modCount     0     
                |       |-------size     0     
                |-------options     HashMap<K,V>  (id=374)     
                |-------realms     LinkedList<E>  (id=376)     
                |       |-------header     LinkedList$Entry<E>  (id=383)     
                |       |-------modCount     0     
                |       |-------size     0     
                |-------repositories     LinkedList<E>  (id=377)     
                |       |-------header     LinkedList$Entry<E>  (id=384)     
                |       |-------modCount     0     
                |       |-------size     0     
                stores     ArrayList<E>  (id=287)     
                |-------elementData     Object[10]  (id=292)     
                |-------modCount     0     
                |-------size     0     
                defaultStoreId     null     
                storeBeans------HashSet<E>  (id=290)     
                |-------map-----HashMap<K,V>  (id=294)     
                     |-------entrySet     HashMap$EntrySet  (id=424)     
                     |-------keySet     HashMap$KeySet  (id=295)     
                     |-------loadFactor     0.75     
                     |-------modCount     1     
                     |-------size     1     
                     |-------table     HashMap$Entry<K,V>[16]  (id=297)     
                               [0]     null     
                               [1]     null     
                               [2]     null     
                               [3]     null     
                               [4]     null     
                               [5]     null     
                               [6]     null     
                               [7]     null     
                               [8]     null     
                               [9]     null     
                               [10]     null     
                               [11]     null     
                               [12]     HashMap$Entry<K,V>  (id=300)     
                                    hash     478864220     
                                    key     ManagedBean<T>  (id=303)     
                                         alternative     false     
                                         annotatedItem     WeldClassImpl<T>  (id=312)     
                                         beanManager     BeanManagerImpl  (id=162)     
                                         beanManager     BeanManagerImpl  (id=162)     
                                         constructor     ConstructorInjectionPoint<T>  (id=317)     
                                         constructorForEnhancedSubclass     null     
                                         decorators     ArrayList<E>  (id=325)     
                                         delegateInjectionPoints     ArraySet<E>  (id=326)     
                                         ejbInjectionPoints     ArraySet<E>  (id=328)     
                                         enhancedSubclass     null     
                                         hashCode     493329618     
                                         hasSerializationOrInvocationInterceptorMethods     false     
                                         id     "org.jboss.weld.bean-PPOSMEar.ear.PPOSMWeb.war/D:/jboss-as-7.0.0.Final/standalone/deployments/PPOSMEar.ear/PPOSMWeb.war/WEB-INF/lib/seam-security.jar-ManagedBean-class org.jboss.seam.security.management.picketlink.JpaIdentityStoreConfiguration" (id=331)     
                                         initialized     true     
                                         initializerMethods     ArrayList<E>  (id=332)     
                                         injectableFields     ArrayList<E>  (id=334)     
                                         injectionPoints     ArraySet<E>  (id=335)     
                                         injectionTarget     ManagedBean$ManagedBeanInjectionTarget<T>  (id=336)     
                                         mergedStereotypes     MergedStereotypes<T,E>  (id=340)     
                                         name     null     
                                         newInjectionPoints     ArraySet<E>  (id=342)     
                                         passivationCapableBean     false     
                                         passivationCapableDependency     false     
                                         persistenceContextInjectionPoints     ArraySet<E>  (id=344)     
                                         persistenceUnitInjectionPoints     ArraySet<E>  (id=346)     
                                         postConstructMethods     ArrayList<E>  (id=347)     
                                         preDestroyMethods     ArrayList<E>  (id=348)     
                                         proxiable     true     
                                         proxyRequired     false     
                                         qualifiers     Collections$UnmodifiableSet<E>  (id=350)     
                                         resourceInjectionPoints     ArraySet<E>  (id=354)     
                                         scope     Class<T> (javax.enterprise.context.Dependent) (id=355)     
                                         services     SimpleServiceRegistry  (id=356)     
                                         specializedBean     null     
                                         type     Class<T> (org.jboss.seam.security.management.picketlink.JpaIdentityStoreConfiguration) (id=358)     
                                         types     Collections$UnmodifiableSet<E>  (id=359)     
                                    next     null     
                                    value     Object  (id=305)     
                               [13]     null     
                               [14]     null     
                               [15]     null     
                          threshold     12     
                          values     null     




                • 5. Re: seam-security Login failed NPE
                  Andrew Murphy Newbie

                  I have the same issue running the latest JBoss AS7 Snapshot.


                  Shane, I've stepped through org.jboss.seam.security.management.picketlink.IdentitySessionProducer.init() method and can confirm that


                  IdentityStoreConfiguration config = (IdentityStoreConfiguration) manager
                                      .getReference(storeBean, IdentityStoreConfiguration.class,
                                              manager.createCreationalContext(storeBean));
                  



                  obtains a reference to an org.jboss.seam.security.management.picketlink.JpaIdentityStoreConfiguration object, but all the attributes are null, which means


                  if (config.isConfigured()) {
                     //...
                  }
                  


                  resolves to 'false'.


                  Could this be an issue with Weld?

                  • 7. Re: seam-security Login failed NPE
                    Andrew Murphy Newbie

                    I've just revisited this issue and went back to basics by deploying the sample web app 'security-idmconsole.war' in a clean AS7 instance. It loaded without error.


                    When I logged in to http://localhost:8080/security-idmconsole (using demo/demo) all appeared fine, however the console had the following ERROR stacktrace:


                    22:30:24,184 ERROR [org.jboss.weld.Bean] (http--127.0.0.1-8080-1) WELD-000019 Error destroying an instance Managed Bean [class org.jboss.seam.security.permission.SecurityRuleProducer] with qualifiers [@Any @Default] of org.jboss.seam.security.permission.SecurityRuleProducer@305e3ad0
                    22:30:24,184 ERROR [org.jboss.seam.security.IdentityImpl] (http--127.0.0.1-8080-1) Login failed: java.lang.RuntimeException: java.lang.IllegalArgumentException: stream cannot be null
                            at org.jboss.seam.security.IdentityImpl.authenticate(IdentityImpl.java:304) [seam-security-impl-3.0.1-20110624.041853-12.jar:]
                            at org.jboss.seam.security.IdentityImpl.login(IdentityImpl.java:223) [seam-security-impl-3.0.1-20110624.041853-12.jar:]
                    ... rest omitted
                    Caused by: java.lang.IllegalArgumentException: stream cannot be null
                            at org.drools.io.impl.InputStreamResource.<init>(InputStreamResource.java:35) [drools-core-5.1.1.jar:]
                            at org.drools.io.impl.ResourceFactoryServiceImpl.newInputStreamResource(ResourceFactoryServiceImpl.java:87) [drools-core-5.1.1.jar:]
                            at org.drools.io.ResourceFactory.newInputStreamResource(ResourceFactory.java:87) [drools-api-5.1.1.jar:]
                    ...rest omitted
                    


                    After a little digging I figured the exception was because security.drl could not be found on the classpath, so I moved it from /WEB-INF/ to /WEB-INF/classes/.


                    This is obviously a classpath issue with seam security running in AS7!?


                    Now I have this working I shall need to figure out why my own implementation generates the NullPointerException alluded to above!

                    • 8. Re: seam-security Login failed NPE
                      bwilly Newbie

                      I just want to reiterate that this is a solution that works for stream cannot be null. It worked for me with JBoss AS 7. Oddly, I was not initially encountering the error. But once I started getting it, it was consistent.


                      --------
                      After a little digging I figured the exception was because security.drl could not be found on the classpath, so I moved it from /WEB-INF/ to /WEB-INF/classes/.
                      --------