Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-20358

jboss-logmanager does not resolve JBOSS_HOME

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Do
    • 7.2.7.GA, 7.3.3.CR1
    • None
    • CLI, Logging
    • None
    • False
    • False
    • Undefined
    • Hide

      Reproduce with JBoss EAP 7.2 and the result

      1. I started a docker container "centos:7"
      2. I installed openjdk-11
      3. unpacked jboss-eap-7.2 in "/opt"
      4. set JBOSS_HOME
        1. echo "export JBOSS_HOME=/opt/jboss-eap-7.2" >> /etc/profile.d/env.sh
      5. Reload shell environment
      6. create user and group with name "jboss"
      7. change owner of $JBOSS_HOME to "jboss:jboss"
        1. chmod -R jboss:jboss $JBOSS_HOME
      8. switch to user "jboss"
      9. change to directory "/opt"
      10. execute "sh $JBOSS_HOME/bin/jboss-cli.sh"
      11. execute "embed-server"

      step 11 will now produce the error shown below in the description. It works with user "root" though

      NOTE:
      The error does not occur if executed from within $JBOSS_HOME. Only if jboss-cli is executed from outside $JBOSS_HOME we get this problem
       

      Reproduce with JBoss EAP 7.3 and the result

      redo the same steps as for JBoss EAP 7.2. But this time we get a worse error message and jboss-cli cannot be executed at all anymore:

      -bash-4.2$ sh $JBOSS_HOME/bin/jboss-cli.sh
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      [disconnected /] embed-server
      Cannot start embedded server: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE": java.lang.reflect.InvocationTargetException: server.log (Pe
      rmission denied)
      

      EDIT

      I get the same problem on red-hat-enterprise-linux:8 docker image.

      JBOSS_HOME is not correctly resolved within docker images

      Show
      Reproduce with JBoss EAP 7.2 and the result I started a docker container "centos:7" I installed openjdk-11 unpacked jboss-eap-7.2 in "/opt" set JBOSS_HOME echo "export JBOSS_HOME=/opt/jboss-eap-7.2 " >> /etc/profile.d/env.sh Reload shell environment create user and group with name "jboss" change owner of $JBOSS_HOME to "jboss:jboss" chmod -R jboss:jboss $JBOSS_HOME switch to user "jboss" change to directory "/opt" execute "sh $JBOSS_HOME/bin/jboss-cli.sh" execute "embed-server" step 11 will now produce the error shown below in the description. It works with user "root" though NOTE: The error does not occur if executed from within $JBOSS_HOME. Only if jboss-cli is executed from outside $JBOSS_HOME we get this problem   Reproduce with JBoss EAP 7.3 and the result redo the same steps as for JBoss EAP 7.2. But this time we get a worse error message and jboss-cli cannot be executed at all anymore: -bash-4.2$ sh $JBOSS_HOME/bin/jboss-cli.sh You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands. [disconnected /] embed-server Cannot start embedded server: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE" : java.lang.reflect.InvocationTargetException: server.log (Pe rmission denied) EDIT I get the same problem on red-hat-enterprise-linux:8 docker image. JBOSS_HOME is not correctly resolved within docker images

    Description

      I am currently writing a cli-script to configure a jboss that runs with our application. But I am currently not able to run the jboss-cli from outside the JBOSS_HOME directory. If I try I get the following error because the environment variable is not resolved in the logging component of JBOSS

       

      -bash-4.2$ sh $JBOSS_HOME/bin/jboss-cli.sh
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      [disconnected /] embed-server
      Failed to invoke setter setFileName with value $JBOSS_HOME/standalone/log/server.log
      .java.lang.reflect.InvocationTargetException
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.applyPostCreate(AbstractPropertyConfiguration.jav
      a:217)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.applyPostCreate(AbstractPropertyConfiguration.jav
      a:197)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.config.LogContextConfigurationImpl.doApplyPostCreate(LogContextConfigurationImpl.java:31
      3)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:345)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:289)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:298)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:546)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
              at org.jboss.as.cli@6.0.14.Final-redhat-00001//org.jboss.as.cli.embedded.EmbeddedLogContext.configureLogContext(EmbeddedLogContext.java:82)
              at org.jboss.as.cli@6.0.14.Final-redhat-00001//org.jboss.as.cli.embedded.EmbedServerHandler.doHandle(EmbedServerHandler.java:181)
              at org.jboss.as.cli@6.0.14.Final-redhat-00001//org.jboss.as.cli.handlers.CommandHandlerWithHelp.handle(CommandHandlerWithHelp.java:89)
              at org.jboss.as.cli@6.0.14.Final-redhat-00001//org.jboss.as.cli.impl.CommandExecutor$2.lambda$build$0(CommandExecutor.java:685)
              at org.jboss.as.cli@6.0.14.Final-redhat-00001//org.jboss.as.cli.impl.CommandExecutor.lambda$execute$0(CommandExecutor.java:708)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.io.FileNotFoundException: $JBOSS_HOME/standalone/log/server.log (No such file or directory)
              at java.base/java.io.FileOutputStream.open0(Native Method)
              at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
              at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:151)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:104)
              at org.jboss.logmanager@2.1.7.Final-redhat-00001//org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:189)
              ... 21 more
      

      Attachments

        Activity

          People

            jdenise@redhat.com Jean Francois Denise
            captain-p-goldfish Pascal Knüppel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: