6 Replies Latest reply on Feb 22, 2012 11:44 AM by peterj

    JBoss 6.1 is unable to write to boot.log

    biswajit.sinha

      JBoss Experts,

       

      I have just started using JBoss 6.1 (final) on a 64 bit linux host but not without too much success, initially it wont boot up so had to include few java options and include the logging jar which eventually got JBoss up however it is still unable to write boot.log. Here is the snippet of the startup errors I get:-

        JBoss Bootstrap Environment

        JBOSS_HOME: /opt/jboss/jboss-6.1

        JAVA: /usr/java/jdk1.6.0_24/bin/java

        JAVA_OPTS: -Xms460m -Xmx512m -Dsun.net.inetaddr.ttl=600 -Dsun.net.inetaddr.negative.ttl=1 -XX:MaxPermSize=128m -server -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -verbose:memory,gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12026 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.net.preferIPv4Stack=true -Dprogram.name=run.sh -Dlogging.configuration=file:/opt/jboss/jboss-6.1/bin/logging.properties -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl -Djboss.platform.mbeanserver -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl -Djava.library.path=/opt/jboss/jboss-6.1/bin/native/lib

      CLASSPATH: /opt/jboss/jboss-6.1/bin/run.jar:/usr/java/jdk1.6.0_24/lib/tools.jar:/opt/jboss/jboss-6.1/lib/jboss-logmanager.jar

      =========================================================================

      Unable to set property fileName on class org.jboss.logmanager.handlers.FileHandler: java.lang.reflect.InvocationTargetException
              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.jboss.logmanager.PropertyConfigurator.configureProperties(PropertyConfigurator.java:187)
              at org.jboss.logmanager.PropertyConfigurator.configureHandler(PropertyConfigurator.java:312)
              at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:128)
              at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:86)
              at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:246)
              at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:231)
              at java.util.logging.LogManager$2.run(LogManager.java:266)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:264)
              at java.util.logging.LogManager.getLogManager(LogManager.java:247)
              at java.util.logging.Logger.<init>(Logger.java:225)
              at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:969)
              at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:966)
              at java.util.logging.LogManager$1.run(LogManager.java:179)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.util.logging.LogManager.<clinit>(LogManager.java:156)
              at java.util.logging.Logger.getLogger(Logger.java:287)
              at sun.management.snmp.util.MibLogger.<init>(MibLogger.java:57)
              at sun.management.snmp.util.MibLogger.<init>(MibLogger.java:42)
              at sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:760)
              at sun.management.Agent.startAgent(Agent.java:127)
              at sun.management.Agent.startAgent(Agent.java:239)
      Caused by: java.io.FileNotFoundException: ${jboss.server.log.dir}/boot.log (No such file or directory)
              at java.io.FileOutputStream.open(Native Method)
              at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
              at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:152)
              at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:183)
              ... 26 more

       

      I even changed the logging.properties from $JBOSS_HOME/bin/logging.properties to handler.FILE.fileName=${jboss.server.log.dir}/boot.log as I am running JBoss as a non root user. Can anyone please advise?

       

      Regards,

      Bis

        • 1. Re: JBoss 6.1 is unable to write to boot.log
          peterj

          Did you change the owner for /opt/jboss/jboss-6.1/ and all of its subdirectories to the user you are using to run JBoss AS? And did you verify that that user has write access?

          • 2. Re: JBoss 6.1 is unable to write to boot.log
            biswajit.sinha

            Thanks for the prompt response Peter, No that directory (/opt/jboss/jboss-6.1/) is owned by root and the service account with which I am testing does not have rights and moreover I want the boot.log to be written to another directory where server.log(s) are already being written.

            • 3. Re: JBoss 6.1 is unable to write to boot.log
              peterj

              If you are running JBoss AS as a non-root user you will have to change the ownership of that directory, otherwise nothing will work. The account you use to run the app server must have write access to that directory and its subdirectories.

              • 4. Re: JBoss 6.1 is unable to write to boot.log
                biswajit.sinha

                Hello Peter, actually I am running multiple JBoss instances on the same host. So I have copied the contents of the JBoss "all" server profile in a separate directory however I am running the run.sh from the root install, it is writing server.log in this new local directory but is failing to write boot.log which used to work in JBoss 5.1 as well. I dont want boot.log to be written to the root install but instead should be written to this new local directory.

                • 5. Re: JBoss 6.1 is unable to write to boot.log
                  biswajit.sinha

                  Also to add to this, in order to completely isolate the root install I am passing "-Djboss.server.base.dir=/path/to/my_new_server_directory" and "-Djboss.server.base.url=file://path/to/my_new_server_directory" during the startup

                   

                  Any suggestions/advises would be really appreciated?

                  • 6. Re: JBoss 6.1 is unable to write to boot.log
                    peterj

                    By default, the server and boot logs are written to server/xxx/log, where xxx is the server name. So if you copied 'all' as 'all1' and 'all2', and ran all1 and all2, then the logs for all1 would be written to server/all1/log, and the logs for all2 would be written to server/all2/log. You do not have to set -Djboss.server.base.dir nor -Djboss.server.base.url to get this functionality - simplye passing a -"c all2", for example, will hange all of the locations.

                     

                    Most likely, you are writing the boot.log for both of your servers to the same location, which you cause the failure for the second server.