4 Replies Latest reply on Nov 19, 2007 11:39 AM by nezdali

    Problems with shutting down the JBoss after ava.lang.OutOfMe

    nezdali

      Hello,

      I having troubles with shutting down the JBoss AS 4.2.2.GA after it gets an error running my application

      2007-11-14 18:54:59,334 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
      java.lang.OutOfMemoryError: PermGen space
      


      When i try to shutdown -S, it throws an exception:

      Exception in thread "main" javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1099 [Root exception is java.io.EOFException]]
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at org.jboss.Shutdown.main(Shutdown.java:214)
      Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server localhost:1099 [Root exception is java.io.EOFException]
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268)
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
       ... 4 more
      Caused by: java.io.EOFException
       at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2232)
       at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)
       at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:750)
       at java.io.ObjectInputStream.<init>(ObjectInputStream.java:268)
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255)
       ... 5 more
      


      I am starting JBoss with run.sh -c all &,
      in run.conf the following settings:

      #
      if [ "x$JAVA_OPTS" = "x" ]; then
       JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
      fi
      
      # Enable the jconsole agent remotely on port 1120
      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=1120"
      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
      JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
      


      What could be the problem while shutting down the JBoss?

        • 1. Re: Problems with shutting down the JBoss after ava.lang.Out
          genman

          Well, when you run out of memory, weird stuff starts to happen, for example files get closed, etc. Does shutdown work when you don't run out of memory?

          • 2. Re: Problems with shutting down the JBoss after ava.lang.Out
            nezdali

            Yes shutdown works normally, with shutdown -S, when there is no "out of memory".

            • 3. Re: Problems with shutting down the JBoss after ava.lang.Out
              nezdali

              Hello,

              I have tried to run jboss with changed in run.sh to generate the stack trace into a file:

              org.jboss.Main "$@" > jboss.trace


              Here is the log: http://bsd.ee/~nezdali/jboss/jboss.trace

              and for logging the garbage collector, in run.conf i have added :

              -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -Xloggc:gc.log


              the log file is here:
              http://bsd.ee/~nezdali/jboss/gc.log

              so the whole JAVA_OPTS is:

              JAVA_OPTS="-Xss128k -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
              
              JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=1120"
              JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
              JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
              
              JAVA_OPTS="$JAVA_OPTS -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -Xloggc:gc.log"




              • 4. Re: Problems with shutting down the JBoss after ava.lang.Out
                nezdali

                I've added to java start options -XX:PermSize=128m -XX:MaxPermSize=128m and it works now.