7 Replies Latest reply on Nov 30, 2004 10:24 AM by mkey

    Log4j problem on jboss3.2.3!!!!

    raffaelecorvino

      Hello all
      I have a problem about Chaptre 7 of tutorial Enclipse-Lomboz-jboss. I run a JMS example. The server deploiy correctly the application, but when I run the test client, the client console give me this orrible error:

      Looking up the factory
      log4j:ERROR Failed to create directory structure: /log
      log4j:ERROR setFile(null,false) call failed.
      java.io.FileNotFoundException: /log/boot.log (No such file or directory)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.(FileOutputStream.java:179)
      at java.io.FileOutputStream.(FileOutputStream.java:102)
      at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
      at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
      at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
      at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123)
      at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
      at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:645)
      at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
      at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
      at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
      at org.apache.log4j.LogManager.(LogManager.java:113)
      at org.jboss.logging.Log4jLoggerPlugin.init(Log4jLoggerPlugin.java:63)
      at org.jboss.logging.Logger.getDelegatePlugin(Logger.java:320)
      at org.jboss.logging.Logger.(Logger.java:78)
      at org.jboss.logging.Logger.getLogger(Logger.java:291)
      at org.jnp.interfaces.NamingContext.(NamingContext.java:102)
      at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:41)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
      at javax.naming.InitialContext.init(InitialContext.java:219)
      at javax.naming.InitialContext.(InitialContext.java:195)
      at au.com.tusc.client.RequestMDBClient.getContext(RequestMDBClient.java:38)
      at au.com.tusc.client.RequestMDBClient.testMDBBean(RequestMDBClient.java:51)
      at au.com.tusc.client.RequestMDBClient.main(RequestMDBClient.java:79)
      Looking up the queue
      java.lang.ClassCastException
      at au.com.tusc.client.RequestMDBClient.testMDBBean(RequestMDBClient.java:54)
      at au.com.tusc.client.RequestMDBClient.main(RequestMDBClient.java:79)

      I'm using jboss3.2.3.
      Can Anyone help me, please???
      Thanks in advance very much
      raffaele

        • 1. Re: Log4j problem on jboss3.2.3!!!!
          ahardy66

          taking a wild guess, I would say that you are running JBoss as a user who doesn't have the rights to create the log directory or log file.

          • 2. Re: Log4j problem on jboss3.2.3!!!!
            huckfinn

            I have the same problem...

            Yes, apparently the creation of the log directory and boot.log file fail as JBoss tries to write them under root, where mortal users have no access to.

            I specifically have this problem when firing up JBoss from Eclipse+Lomboz; I don't know if it's a Lomboz problem or not. I have a hunch that it might be due to Lomboz starting JBoss so that the current working directory is / ?

            Is there a way to configure the log file's location somewhere in JBoss configs?

            I'm quite surprised that this issue hasn't been talked about more as it seems to me it is something a newbie is going to bump into as first thing out of the box...

            • 3. Re: Log4j problem on jboss3.2.3!!!!
              raffaelecorvino

              My problem is an authorization problem. I solve it selecting the "all" permiss on the folder where the log file is created.
              I hope to help you, but I had solved this problem two or three mounts ago...
              Bye
              Raffaele

              • 4. Re: Log4j problem on jboss3.2.3!!!!
                huckfinn

                Ok... certainly one can create a world-writable /log directory, but seriously, it seems like such bad form to have to essentially have root privileges to set up a mere development server... I can't help but feel that the directory's location is "strange", especially in a unix-style environment.

                Oh well, thanks for attention :)

                • 5. Re: Log4j problem on jboss3.2.3!!!!
                  huckfinn

                  Ok... certainly one can create a world-writable /log directory, but seriously, it seems like such bad form to have to essentially have root privileges to set up a mere development server... I can't help but feel that the directory's location is "strange", especially in a unix-style environment.

                  Oh well, thanks for attention :)

                  • 6. Re: Log4j problem on jboss3.2.3!!!!
                    starksm64

                    There is some problem resolving the property references from the log4j.properties file in the run.jar. The boot.log is placed under the ${jboss.server.home.dir}/log/boot.log where jboss.server.home.dir is a system property initialized by the startup layer if it has not been set externally.

                    ### A bootstrap file appender
                    log4j.appender.FILE=org.jboss.logging.appender.FileAppender
                    log4j.appender.FILE.File=${jboss.server.home.dir}/log/boot.log
                    log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
                    log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p %c{1}] %m%n
                    log4j.appender.FILE.Append=false
                    



                    • 7. Re: Log4j problem on jboss3.2.3!!!!
                      mkey

                      i've got this problem with jboss3.2.5 + eclipse3.0.1 + lomboz3.0.1, too!

                      i've created a EMPTY log4j.properties file in my client-sourceFolder and i've got no exceptions anymore!

                      strange problem-solution!? does anybody know an answer of my solution?