2 Replies Latest reply on Jun 6, 2011 12:19 PM by miragpl

    Shutting jboss

    miragpl Newbie



      Could anyone tell me how should I shutdown jboss with shutdown command?

      I tried already:


      ./shutdown.bat -S

      ./shutdown.bat -s service:jmx:rmi:///jndi/rmi://localhost:1090/jmxrmi


      but neither of the worked. Both of them throws such an exception:


      Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoIn

      itialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root excep

      tion is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]

              at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)

              at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)

              at org.jboss.Shutdown.main(Shutdown.java:235)

      Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.Nami

      ngContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingConte


              at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)

              at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

              at javax.naming.InitialContext.init(InitialContext.java:223)

              at javax.naming.InitialContext.<init>(InitialContext.java:197)

              at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1884)

              at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)

              at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)

              ... 2 more

      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

              at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

              at java.security.AccessController.doPrivileged(Native Method)

              at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

              at java.lang.Class.forName0(Native Method)

              at java.lang.Class.forName(Class.java:247)

              at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)

              at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)

              ... 8 more



      I use:



      java: 1.6.0_20


      -Xms256m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInt

      erval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -server -XX:+DisableExplicitGC -Dstartmode=noscan


      I would never expect that such simple thinkg like closing jboss would be so troublesome


      Thanks in advance for any hint!

        • 1. Re: Shutting jboss
          Peter Johnson Master

          Here is the root cause:


          >>Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory


          That class appears in several JAR file but I suspect that shutdown will use the one from client/jnp-client.jar (or perhaps client/jbossjmx-ant.jar) based on the classpath set on line 67 of shutdown.sh.


          I suspect that there is something wrong in your setup. I would look at the following:


          1) Did you make any changes to shutdown.sh?


          2) Verify that the two JAR files I mentioned exist.


          3) Do you have JBOSS_HOME set? If so, unset it! The shutdown script will set it automatically.


          4) Determine the full command line passed to the java process (for shutdown). You can do this by either running ps while the java process is running (could be tricky, it won't run long), or by editing the shutdown.sh to echo the command.

          • 2. Re: Shutting jboss
            miragpl Newbie



            You were right there were problem with contents of JBOSS_HOME/client directory.

            I would never quest that some jars could be missing there.