2 Replies Latest reply on Jun 27, 2008 5:34 AM by mantay

    NoInitialContextException while stopping server.

    cgorantala

      Hi,
      We are getting following exception, while stopping the Jboss. Could some help us to fix the issue.

      2008-06-04 18:09:16,565 INFO [org.jboss.ejb3.EJBContainer] STOPPED EJB: com.sonymusic.aoma.notification.EmailConfirmationListener ejbName: EmailConfirmationListener
      2008-06-04 18:09:16,568 WARN [org.jboss.ejb3.JmxKernelAbstraction] jboss.j2ee:ear=aoma.ear,jar=aoma.jar,name=EmailConfirmationListener,service=EJB3 is not registered
      2008-06-04 18:09:16,585 INFO [org.jboss.ejb3.EJBContainer] STOPPED EJB: com.sonymusic.aoma.notification.EmailNotificationListener ejbName: EmailNotificationListener
      2008-06-04 18:09:16,587 WARN [org.jboss.ejb3.JmxKernelAbstraction] jboss.j2ee:ear=aoma.ear,jar=aoma.jar,name=EmailNotificationListener,service=EJB3 is not registered
      2008-06-04 18:09:16,590 INFO [org.jboss.ejb3.entity.PersistenceUnitDeployment] Stopping persistence unit persistence.units:ear=aoma.ear,unitName=AOMAPersistence
      2008-06-04 18:09:16,590 WARN [org.jboss.ejb3.ServiceDelegateWrapper] Stopping failed persistence.units:ear=aoma.ear,unitName=AOMAPersistence
      javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
      at javax.naming.InitialContext.getNameParser(InitialContext.java:439)
      at org.jboss.ejb3.NonSerializableFactory.unbind(NonSerializableFactory.java:60)
      at org.jboss.ejb3.entity.PersistenceUnitDeployment.stop(PersistenceUnitDeployment.java:276)
      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:585)
      at org.jboss.ejb3.ServiceDelegateWrapper.stopService(ServiceDelegateWrapper.java:119)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      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.stop(Unknown Source)
      at org.jboss.system.ServiceController.stop(ServiceController.java:508)
      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:585)
      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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy57.stop(Unknown Source)
      at org.jboss.ejb3.JmxKernelAbstraction.uninstallMBean(JmxKernelAbstraction.java:175)
      at org.jboss.ejb3.JmxKernelAbstraction.uninstall(JmxKernelAbstraction.java:202)
      at org.jboss.ejb3.Ejb3Deployment.stopPersistenceUnits(Ejb3Deployment.java:642)
      at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:668)
      at org.jboss.ejb3.Ejb3Module.stopService(Ejb3Module.java:107)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      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.stop(Unknown Source)
      at org.jboss.system.ServiceController.stop(ServiceController.java:508)
      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:585)
      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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy33.stop(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.stop(EJB3Deployer.java:532)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.wsf.container.jboss42.DeployerInterceptor.stop(DeployerInterceptor.java:98)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.stop(SubDeployerInterceptorSupport.java:196)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:99)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy34.stop(Unknown Source)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:667)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:659)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:638)
      at org.jboss.deployment.MainDeployer.shutdown(MainDeployer.java:516)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.server.ServerImpl$ShutdownHook.shutdownDeployments(ServerImpl.java:1058)
      at org.jboss.system.server.ServerImpl$ShutdownHook.shutdown(ServerImpl.java:1033)
      at org.jboss.system.server.ServerImpl$ShutdownHook.run(ServerImpl.java:996)
      2008-06-04 18:09:16,606 WARN [org.jboss.ejb3.JmxKernelAbstraction] persistence.units:ear=aoma.ear,unitName=AOMAPersistence is not registered
      2008-06-04 18:09:16,609 WARN [org.jboss.ejb3.JmxKernelAbstraction] persistence.units:ear=aoma.ear,unitName=AOMAPersistenceJ2SE is not registered
      2008-06-04 18:09:16,971 INFO [org.jboss.deployment.EARDeployer] Undeploying J2EE application, destroy step: file:/apps/jboss-4.2.2.GA/server/default/deploy/aoma.ear
      2008-06-04 18:09:16,974 INFO [org.jboss.deployment.EARDeployer] Undeployed J2EE application: file:/apps/jboss-4.2.2.GA/server/default/deploy/aoma.ear
      2008-06-04 18:09:17,137 INFO [org.jboss.web.tomcat.service.TomcatDeployer] undeploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
      2008-06-04 18:09:17,194 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/MILoadXADS' from JNDI name 'java:jdbc/MILoadXADS'
      2008-06-04 18:09:17,202 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/TxManagerXADS' from JNDI name 'java:jdbc/TxManagerXADS'

      Thanks

        • 1. Re: NoInitialContextException while stopping server.
          mantay

          We have the same problem here. I have been digging into this problem, but have not found a solution yet.

          We have message-driven beans in our project, and if I remove the MDBs, the exception disappears. So I assume that the information in jndi.properties, which includes a value for parameter java.naming.factory.initial, is not available when undeploying an MDB. Hence, it could be a bug in JBoss.

          I will keep on elaborating on this issue and keep you informed if I find out something meaningful.

          • 2. Re: NoInitialContextException while stopping server.
            mantay

            Further observations:

            The class loader doesn't seem to load the MDB before its first use. I checked that by adding a static initializer to the MDB. If a message arrives in the queue that the MDB is connected to, the static initializer is invoked. The system properties java.naming.provider.url and java.naming.factory.url.pkgs are set correctly in that case, however, the property java.naming.factory.initial is unset, even though the file jndi.properties is in the conf folder of the JBoss installation directory. In my opinion, this is a bug.

            Even if I add

             System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
            


            to the static initializer, I still get the NoInitialContextException.