10 Replies Latest reply on Oct 15, 2010 8:50 AM by proque_cu

    Unable to stop Jboss

    proque_cu

      Hello,

       

      I'm currently trying to stop JBoss and I'm not able to accomplish it, have look everywhere... java, etc, no idea.
      It was working well and then it just stopped :S

       

      no changes were made from a Jboss perspective.

       

      Please see error.

       

      [root@myserver jboss]# service jboss stop
      JBOSS_CMD_START = cd /opt/jboss/bin; /opt/jboss/bin/run.sh -c default -b 0.0.0.0
      Exception in thread "main" java.lang.NoClassDefFoundError: javax.management.MalformedObjectNameException
         at org.jboss.mx.util.ObjectNameFactory.create(ObjectNameFactory.java:52)
         at org.jboss.system.server.ServerImplMBean.<clinit>(ServerImplMBean.java:35)
         at java.lang.Class.initializeClass(libgcj.so.7rh)
         at org.jboss.Shutdown.main(Shutdown.java:118)

       


      Thanks

        • 1. Re: Unable to stop Jboss
          peterj

          You need to check the /etc/init.d/jboss script to see which version of Java you are using (does your script set JAVA_HOME, and to what?). I suspect that the script is now using a non-Sun JDK (some Linux updates will do things like that).

          • 2. Re: Unable to stop Jboss
            proque_cu

            Thanks for your comment:

             

            /etc/init.d/jboss

            #make sure java is in your path
            JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.6.0_18/bin"}

             

            And that's indeed the path. It was working well which is the weird part.

            • 3. Re: Unable to stop Jboss
              peterj

              Looking in jboss_init_*.sh I see this line:

               

              JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}

               

              Looks like the JAVA_HOME and JAVAPTH are ignored, which means that you will get /usr/bin/java which is probably not the one you want. Whenever I see stuff like this in a script (and I see it wuite often) I always wonder what was going through the mind of the person who wrote it. (Sorry, this is a sore point with me.)

              • 4. Re: Unable to stop Jboss
                proque_cu

                Pardon for my ignorance but how can I work around this issue based on your statement

                Any suggestions?

                 

                Thanks

                • 5. Re: Unable to stop Jboss
                  peterj

                  JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"$JAVAPTH/java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}

                  • 6. Re: Unable to stop Jboss
                    proque_cu

                    This is what I'm getting.

                     

                    [root@myserver java]# service jboss stop
                    JBOSS_CMD_START = cd /opt/jboss/bin; /opt/jboss/bin/run.sh -c default -b 0.0.0.0
                    -bash: /java: No such file or directory

                     

                    I have Java under /usr/bin/latest "latest is a symbolic link" not sure if this information may be of much help

                    is the /java meaning that it's trying to search under "JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.6.0_18/bin"} + java"?

                     

                    Thanks,

                    • 7. Re: Unable to stop Jboss
                      peterj

                      Yes. You should have JAVAPTH set to $JAVA_HOME/bin, so if JAVA_HOME=/usr/java/latest, then you should have JAVAPTH=/usr/java/latest/bin. Personally, I would add JAVA_HOME to /etc/init.d/jboss and use it to set JAVAPTH.

                      • 8. Re: Unable to stop Jboss
                        proque_cu

                        from the jboss file:

                        #make sure java is in your path
                        JAVAPTH=${JAVAPTH:-"/usr/java/jdk1.6.0_18/bin"}

                        JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"$JAVAPATH -classpath $JBOSSCP org.jboss.Shutdown --shutdown"} "suggested by you thanks "

                         

                        [root@myserver bin]# service jboss stop
                        JBOSS_CMD_START = cd /opt/jboss/bin; /opt/jboss/bin/run.sh -c default -b 0.0.0.0
                        -bash: -classpath: command not found

                        • 9. Re: Unable to stop Jboss
                          peterj

                          >>suggested by you thanks

                          Not quite, you mistyped the line; go back and check what I posted.

                          • 10. Re: Unable to stop Jboss
                            proque_cu

                            Hi Peter,

                             

                            Sorry for the delay, was working on some other things as well "JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"$JAVAPTH/java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}" was the thing, thank you very much.

                             

                            and my typo was JAVAPTH lol, with an A in pth, took me forever to find it.

                             

                            Thanks again