1 Reply Latest reply on May 3, 2004 12:01 PM by Scott Stark

    NPE in org.jboss.system.ServiceController.start

    Chris Bonham Newbie

      I checked out the latest CVS yesterday around 7pm GMT and I got an NPE trying to start my own XMLLoginConfig using a modified version of the StackableSecurityConfig described in the JBoss docs:

      2004-04-29 14:30:58,217 DEBUG [org.jboss.security.plugins.StackableSecurityConfig] (main:jboss.security:service=SecurityConfig,domain=LifePage) Starting jboss.security:service=SecurityConfig,domain=LifePage
      2004-04-29 14:31:16,864 INFO [org.jboss.security.plugins.StackableSecurityConfig] (main:jboss.security:service=SecurityConfig,domain=LifePage JAAS Login Config) Using mainSecurityConfigName: 'jboss.security:service=SecurityConfig'
      2004-04-29 14:31:17,795 INFO [org.jboss.security.plugins.StackableSecurityConfig] (main:jboss.security:service=SecurityConfig,domain=LifePage JAAS Login Config) Using loginConfigName: 'jboss.security:service=XMLLoginConfig,domain=LifePage'
      2004-04-29 14:33:15,905 INFO [org.jboss.security.plugins.StackableSecurityConfig] (main:jboss.security:service=SecurityConfig,domain=LifePage JAAS Login Config) Using JAAS AuthConfig: jar:file:/C:/jboss-3.2.4RC2/server/nonsecure/tmp/deploy/tmp57836lifepage.ear-contents/lifepage-security.sar!/META-INF/login-config.xml
      2004-04-29 14:33:23,756 WARN [org.jboss.system.ServiceController] (main:jboss.security:service=SecurityConfig,domain=LifePage JAAS Login Config jboss.security:service=XMLLoginConfig,domain=LifePage) Problem starting service jboss.security:service=XMLLoginConfig,domain=LifePage
      java.lang.NullPointerException
       at org.jboss.system.ServiceController.start(ServiceController.java:369)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:170)
       at org.jboss.security.plugins.StackableSecurityConfig.startService(StackableSecurityConfig.java:102)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:839)
       at $Proxy16.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:369)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
       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.GeneratedMethodAccessor25.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
       at $Proxy7.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:478)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:839)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:369)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:592)
       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:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java: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.java:186)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:466)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:174)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:404)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
       at org.jboss.Main.boot(Main.java:144)
       at org.jboss.Main$1.run(Main.java:389)
       at java.lang.Thread.run(Thread.java:536)
      2004-04-29 14:33:23,846 DEBUG [org.jboss.security.plugins.SecurityConfig] (main:) Installed JAAS Configuration service=jboss.security:service=XMLLoginConfig,domain=LifePage, config=org.jboss.security.auth.login.XMLLoginConfigImpl@1a04643
      2004-04-29 14:33:23,846 DEBUG [org.jboss.security.plugins.StackableSecurityConfig] (main:) Started jboss.security:service=SecurityConfig,domain=LifePage


      Apparently the ctx.proxy is null in the ServiceController. This worked with JBoss 3.2.4RC1. Also, here's the code from the StackableSecurityConfig that creates and starts the XMLLoginConfig:

      protected void startService() throws Exception
       {
       // Look for the authConf as resource
       ClassLoader loader = Thread.currentThread().getContextClassLoader();
       URL loginConfig = loader.getResource(authConf);
       if( loginConfig != null )
       {
       log.info("Using mainSecurityConfigName: '"+mainSecurityConfig+"'");
       log.info("Using loginConfigName: '"+loginConfigName+"'");
       log.info("Using JAAS AuthConfig: "+loginConfig.toExternalForm());
       config = new XMLLoginConfig();
       config.setConfigURL(loginConfig);
       MBeanServer server = super.getServer();
       ObjectName name = super.getServiceName();
       name = new ObjectName(loginConfigName);
       server.registerMBean(config, name);
       config.start(); <------------------- Line 102
       Object[] args = {name.toString()};
       String[] sig = {String.class.getName()};
       server.invoke(mainSecurityConfig, "pushLoginConfig", args, sig);
       }
       else
       {
       log.warn("No AuthConfig resource found");
       }
       }


      Thanks.