5 Replies Latest reply on Mar 16, 2009 12:10 PM by Pete Muir

    NPE using profileservice in Branch_5_x

    Pete Muir Master

      I get this NPE when using the profileservice in Branch_5_x (which works in Branch_5_0):

      java.io.IOException
       at org.jboss.webbeans.tck.integration.jbossas.ProfileServiceContainersImpl.setup(ProfileServiceContainersImpl.java:54)
       at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:171)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
       at org.testng.SuiteRunner.run(SuiteRunner.java:198)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
       at org.testng.TestNG.run(TestNG.java:708)
       at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
       at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
       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:597)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
      Caused by: java.lang.NullPointerException
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:117)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
       at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(AbstractDeployHandler.java:148)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
       at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:522)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
       at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:206)
       at org.jboss.remoting.Client.invoke(Client.java:1708)
       at org.jboss.remoting.Client.invoke(Client.java:612)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at AOPProxy$1.loadProfile(AOPProxy$1.java)
       at org.jboss.webbeans.tck.integration.jbossas.ProfileServiceContainersImpl.initDeploymentManager(ProfileServiceContainersImpl.java:179)
       at org.jboss.webbeans.tck.integration.jbossas.ProfileServiceContainersImpl.setup(ProfileServiceContainersImpl.java:50)
       at org.jboss.testharness.AbstractTest.beforeSuite(AbstractTest.java:171)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
       at org.testng.SuiteRunner.run(SuiteRunner.java:198)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:821)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:788)
       at org.testng.TestNG.run(TestNG.java:708)
       at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
       at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
       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:597)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at org.jboss.aspects.remoting.MergeMetaDataInterceptor.invoke(MergeMetaDataInterceptor.java:74)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
       at AOPProxy$1.loadProfile(AOPProxy$1.java)
       at org.jboss.webbeans.tck.integration.jbossas.ProfileServiceContainersImpl.initDeploymentManager(ProfileServiceContainersImpl.java:179)
       at org.jboss.webbeans.tck.integration.jbossas.ProfileServiceContainersImpl.setup(ProfileServiceContainersImpl.java:50)
       ... 23 more
      


      The initDeploymentManager looks like:

      /**
       * Obtain the Deployment Manager
       * @throws Exception
       */
       protected void initDeploymentManager() throws Exception
       {
       String profileName = "default";
       InitialContext ctx = new InitialContext();
       ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
       deploymentManager = ps.getDeploymentManager();
       ProfileKey defaultKey = new ProfileKey(profileName);
       deploymentManager.loadProfile(defaultKey, false);
       // Init the VFS to setup the vfs* protocol handlers
       VFS.init();
       }


      and I have this in jndi.properties

      #jboss JNDI properties
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://localhost:1099
      java.naming.factory.url.pkgs=org.jboss.naming\:org.jnp.interfaces