1 Reply Latest reply on Aug 24, 2009 4:34 PM by Timmy Storms

    Deployment error when using a security domain

    Timmy Storms Newbie

      I'm trying to setup basic http authentication on a webservice which resides in a seam application, but during the deployment of my ear file, I'm getting the following exception:




      java.lang.NullPointerException
      at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorFactory.createPerClass(RoleBasedAuthorizationInterceptorFactory.java:49)
      at org.jboss.aop.advice.AspectFactoryDelegator.createPerClass(AspectFactoryDelegator.java:107)
      at org.jboss.aop.Advisor.addPerClassAspect(Advisor.java:569)
      at org.jboss.aop.advice.ScopedInterceptorFactory.create(ScopedInterceptorFactory.java:72)
      at org.jboss.aop.Advisor.createInterceptorChain(Advisor.java:618)
      at org.jboss.aop.Advisor.pointcutResolved(Advisor.java:888)
      at org.jboss.aop.Advisor.resolveMethodPointcut(Advisor.java:650)
      at org.jboss.aop.ClassContainer.createInterceptorChains(ClassContainer.java:248)
      at org.jboss.aop.ClassContainer.rebuildInterceptors(ClassContainer.java:115)
      at org.jboss.aop.ClassContainer.initializeClassContainer(ClassContainer.java:58)
      at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:342)
      at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:140)
      at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:292)
      at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:356)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)



      This seams to mean that my SecurityDomain annotation (which is on my web service class) could not be found. The following annotations are on my web service class:


      @Stateless
      @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
      @SecurityDomain(value=mydomain", unauthenticatedPrincipal="anonymous")
      @WebService(endpointInterface="ProjectServiceRemote", name =.WEB_SERVICE_NAME, targetNamespace = TAGET_NAMESPACE, serviceName = "servicename")
      @WebContext(urlPattern = "/ps", authMethod = "BASIC", transportGuarantee = "NONE", secureWSDLAccess = false)



      The authentication should be done via Atlassian Crowd. I'm using an open source JAAS LoginModule to accomplish this. The following snippet is taken from login-config.xml:


      <application-policy name="mydomain">
      <authentication>
      <login-module code="com.atlassian.crowd.application.jaas.CrowdLoginModule"
      flag="required">
      <module-option name="application.name">n</module-option>
      <module-option name="application.password">n</module-option>
      <module-option name="storePass">true</module-option>
      <module-option name="crowd.server.url">http://urlcrowd/services</module-option>
      </login-module>
      </authentication>
      </application-policy>




      Do you guys have any idea what is causing this nullpointer? I've tested this scenario in a small JEE app and there it works perfectly... Do I need to do some Seam specific things for this?


      Important note: I'm using JBoss 4.2.3 and Seam 2.1.2.