4 Replies Latest reply on Jun 11, 2004 10:34 AM by Scott Stark

    Null CachePolicy

    shin_kenneth Newbie

      All,
      Using JBoss 3.2.4, I have been experimenting with a custom login module and I have it working except for this one error:

      ---
      DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added jmx-console, org.jboss.security.plugins.JaasSecurityDomain@a00185 to map
      WARN [org.jboss.security.plugins.JaasSecurityManagerService] Failed to locate auth CachePolicy at: java:/timedCacheFactory for securityDomain=jmx-console
      DEBUG [org.jboss.security.plugins.JaasSecurityDomain.jmx-console] CachePolicy set to: null
      DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=null
      ---

      because of this, I get a nullPointerException during authentication, when the getPrincipal method is invoked on the JaasSecurityManager.

      I have hacked the JaasSecurityManager to initialize the CachePolicy when it is null, but I figure there is a much better way to handle this.

      thanks,
      Kenneth Shin

        • 1. how to configure typemapping of java.sql.Time to xsd:time?
          Scott Stark Master

          Hi,

          I am using Axis in JBoss and would like to know how to configure the java type java.sql.Time to xsd:time.
          Currently it automatically gets converted into a xsd:dateTime (probably
          because java.sql.Time extends java.sql.Date).

          On the client side I manage to deal with the problem by providing an own
          Deserializer. But I do not know how to configure a Serializer on the
          server side, if trying to define one for xsd:date I always receive the
          exception:
          11:35:39,959 ERROR [MainDeployer] could not start deployment:
          file:/D:/jboss-3.2.5/server/default/tmp/deploy/tmp16950codewednesday.ear
          -contents/codewednesday.ws
          r
          org.jboss.deployment.DeploymentException: Could not deploy axis
          descriptor.; - nested throwable:
          (org.apache.axis.deployment.wsdd.WSDDException: javax.xml.rpc.J
          AXRPCException: Null qualified name specified.
          javax.xml.rpc.JAXRPCException: Null qualified name specified.
          at
          org.apache.axis.encoding.TypeMappingImpl.internalRegister(TypeMappingImp
          l.java:273)
          at
          org.apache.axis.encoding.TypeMappingImpl.register(TypeMappingImpl.java:2
          55)
          at
          org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDServic
          e.java:560)
          at
          org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:267
          )
          at
          org.apache.axis.deployment.wsdd.WSDDService.(WSDDService.java:247)
          at
          org.apache.axis.deployment.wsdd.WSDDDeployment.(WSDDDeployment.jav
          a:243)
          at org.jboss.net.axis.Deployment.(Deployment.java:79)
          at
          org.jboss.net.axis.server.AxisService.start(AxisService.java:491)
          at
          org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
          at
          org.jboss.deployment.MainDeployer.start(MainDeployer.java:828)
          at
          org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
          at
          org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
          at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
          at
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
          Impl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at
          org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.jav
          a:60)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at
          org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.jav
          a:185)
          at
          org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
          at
          org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
          at $Proxy7.deploy(Unknown Source)
          at
          org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentSc
          anner.java:304)
          at
          org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScan
          ner.java:460)
          at
          org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doS
          can(AbstractDeploymentScanner.java:201)
          at
          org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loo
          p(AbstractDeploymentScanner.java:212)
          at
          org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run
          (AbstractDeploymentScanner.java:191)

          My typemapping in the webservice.xml looks like this:
          <typeMapping qname="xsd:time"
          xmlns:tns="http://www.w3.org/2001/XMLSchema"
          languageSpecificType="java:java.sql.Time"

          serializer="com.essencio.codewednesday.axis.TimeSerializerFactory"

          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

          Thanks for your time and best regards from sunny Black Forest, Germany,
          Mattin

          • 2. Re: Null CachePolicy
            Scott Stark Master

            No, the JaasSecurityManager does not accept a null cache. You either need a noop cache impl or subclass JaasSecurityManager to deal with this. What is the JaasSecurityDomain that is producing a null cache?

            • 3. Re: Null CachePolicy
              shin_kenneth Newbie

              I have a JaasSecurityDomain configured in jboss-service.xml as such:
              (i have escaped the '<' and '>' with '-' for display purposes)

              -mbean code="org.jboss.security.plugins.JaasSecurityDomain" name="jboss.web:service=SecurityDomain"-
              -constructor-
              -arg type="java.lang.String" value="jmx-console"/-
              -/constructor-
              -attribute name="KeyStoreURL"-keystorepath-/attribute-
              -attribute name="KeyStorePass"-keypass-/attribute-
              -/mbean-

              Am I missing a configuration parameter that is causing the null cache policy?

              thanks for you help,
              Kenneth Shin

              • 4. Re: Null CachePolicy
                jgra Newbie

                Hi

                I'm experiencing the same problem with cache policy.
                My configuration is as described on JBossSX wiki: http://www.jboss.org/wiki/Wiki.jsp?page=BaseCertLoginModule

                In server.log I found following warning:

                2004-09-03 11:14:09,494 DEBUG [org.jboss.security.plugins.JaasSecurityDomain] Creating jboss.web:service=SecurityDomain
                2004-09-03 11:14:09,494 DEBUG [org.jboss.security.plugins.JaasSecurityDomain.jmx-console] Adding com.sun.net.ssl.internal.ssl.Provider
                2004-09-03 11:14:10,057 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added jmx-console, org.jboss.security.plugins.JaasSecurityDomain@3c9c31 to map
                2004-09-03 11:14:10,088 WARN [org.jboss.security.plugins.JaasSecurityManagerService] Failed to locate auth CachePolicy at: java:/timedCacheFactory for securityDomain=jmx-console
                2004-09-03 11:14:10,088 DEBUG [org.jboss.security.plugins.JaasSecurityDomain.jmx-console] CachePolicy set to: null
                2004-09-03 11:14:10,088 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=null
                2004-09-03 11:14:10,088 DEBUG [org.jboss.security.plugins.JaasSecurityDomain] Created jboss.web:service=SecurityDomain

                And after login with client certificate to /jmx-console I'm recieving NullPointerException:
                2004-09-03 11:14:51,822 TRACE [org.jboss.security.auth.spi.BaseCertLoginModule] User 'EMAILADDRESS=i1@zibi.pl, CN=zibi i1, OU=i1, O=zibi, ST=maz, C=pl' authenticated, loginOk=true
                2004-09-03 11:14:51,822 DEBUG [org.jboss.security.auth.spi.BaseCertLoginModule] exit: login()
                2004-09-03 11:14:51,822 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] initialize
                2004-09-03 11:14:51,838 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] findResource: null
                2004-09-03 11:14:51,838 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] Properties file=file:/C:/jboss322/server/default/deploy/jmx-console.war/WEB-INF/classes/jmx-console-users.properties
                2004-09-03 11:14:51,838 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] findResource: null
                2004-09-03 11:14:51,838 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] Properties file=file:/C:/jboss322/server/default/deploy/jmx-console.war/WEB-INF/classes/jmx-console-roles.properties^M
                2004-09-03 11:14:51,838 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] login
                2004-09-03 11:14:51,854 TRACE [org.jboss.security.auth.spi.BaseCertLoginModule] commit, loginOk=true
                2004-09-03 11:14:51,854 TRACE [org.jboss.security.auth.spi.UsersRolesLoginModule] commit, loginOk=true
                2004-09-03 11:14:51,869 ERROR [org.apache.coyote.tomcat5.CoyoteAdapter] An exception or error occurred in the container during the request processing
                java.lang.NullPointerException
                at org.jboss.security.plugins.JaasSecurityManager.getPrincipal(JaasSecurityManager.java:271)
                at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:173)

                Scott can you help?

                Regards Janusz