7 Replies Latest reply on Oct 31, 2013 7:22 AM by incardonamf

    How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working

    incardonamf

      Hi,

       

      Seems that it is not possible to launch the standalone.sh script with a non-default profile under unix. Note that the .bat windows script works fine.

       

      I tried to launch the standalone script using -Djboss.server.base.dir=/home/flowmindsu/devtools/jboss-eap-6.1/standalone-unit-tests but the config file cannot be found.

      I tried also using -Djboss.server.base.dir=../standalone-unit-tests, but it does not work neither.

       

      Thanks for your help!

       

      MF

       

      ./standalone.sh -Djboss.server.base.dir=/home/flowmindsu/devtools/jboss-eap-6.1/standalone-unit-tests -Djboss.socket.binding.port-offset=1000 --server-config=standalone-unit-tests.xml

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

       

       

        JBoss Bootstrap Environment

       

       

        JBOSS_HOME: /home/flowmindsu/devtools/jboss-eap-6.1

       

       

        JAVA: /usr/lib/jvm/jdk1.6.0_38/bin/java

       

       

        JAVA_OPTS:  -server -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

       

       

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

       

       

      [0m11:59:46,025 [INFO ] [modules             :842] main                 JBoss Modules version 1.2.0.Final-redhat-1

      [0m [31m11:59:46,212 [ERROR] [stderr              :71] main                 java.lang.IllegalStateException: JBAS014805: Impossible d'obtenir le fichier principal : standalone-unit-tests.xml. Les fichiers indiqués doivent se rapporter au répertoire de configuration : /home/flowmindsu/devtools/jboss-eap-6.1/standalone-unit-tests/configuration

      [0m [31m11:59:46,242 [ERROR] [stderr              :71] main                 at org.jboss.as.controller.persistence.ConfigurationFile.determineMainFile(ConfigurationFile.java:168)

      [0m [31m11:59:46,243 [ERROR] [stderr              :71] main                 at org.jboss.as.controller.persistence.ConfigurationFile.<init>(ConfigurationFile.java:95)

      [0m [31m11:59:46,243 [ERROR] [stderr              :71] main                 at org.jboss.as.server.ServerEnvironment.<init>(ServerEnvironment.java:390)

      [0m [31m11:59:46,244 [ERROR] [stderr              :71] main                 at org.jboss.as.server.Main.determineEnvironment(Main.java:257)

      [0m [31m11:59:46,244 [ERROR] [stderr              :71] main                 at org.jboss.as.server.Main.main(Main.java:88)

      [0m [31m11:59:46,245 [ERROR] [stderr              :71] main                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      [0m [31m11:59:46,246 [ERROR] [stderr              :71] main                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      [0m [31m11:59:46,247 [ERROR] [stderr              :71] main                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      [0m [31m11:59:46,247 [ERROR] [stderr              :71] main                 at java.lang.reflect.Method.invoke(Method.java:597)

      [0m [31m11:59:46,248 [ERROR] [stderr              :71] main                 at org.jboss.modules.Module.run(Module.java:270)

      [0m [31m11:59:46,249 [ERROR] [stderr              :71] main                 at org.jboss.modules.Main.main(Main.java:411)

      [0m

        • 1. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
          ctomc

          just use

           

          /standalone.sh -Djboss.socket.binding.port-offset=1000 -c standalone-unit-tests.xml

           

          that should work.

          • 2. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
            incardonamf

            Hi Tomaz,

             

            If I remove the jboss.server.base.dir, it will probably use the standalone profile which is the default one.

            The thing is that I would like to use a custom profile directory called "standalone-unit-tests" not the default standalone one.

             

            And my standalone-unit-tests.xml file is the standalone-unit-tests/configuration directory


            total 380

            drwxrwxr-x 11 flowmindsu flowmindsu   4096 oct.  30 14:53 .

            drwxrwxr-x  8 flowmindsu flowmindsu   4096 oct.   1 16:03 ..

            drwxrwxr-x  3 flowmindsu flowmindsu   4096 mai    9 13:10 appclient

            drwxrwxr-x  4 flowmindsu flowmindsu   4096 oct.  30 11:58 bin

            drwxrwxr-x  3 flowmindsu flowmindsu   4096 mai    9 13:10 bundles

            drwxrwxr-x  5 flowmindsu flowmindsu   4096 mai    9 13:10 docs

            drwxrwxr-x  5 flowmindsu flowmindsu   4096 mai    9 13:10 domain

            -rw-rw-r--  1 flowmindsu flowmindsu    425 mai    9 13:10 JBossEULA.txt

            -rw-rw-r--  1 flowmindsu flowmindsu 304854 mai    9 13:10 jboss-modules.jar

            -rw-rw-r--  1 flowmindsu flowmindsu  26530 mai    9 13:10 LICENSE.txt

            drwxrwxr-x  3 flowmindsu flowmindsu   4096 mai    9 13:10 modules

            -rw-rw-r--  1 flowmindsu flowmindsu      0 oct.  30 14:53 output2.txt

            drwxrwxr-x  8 flowmindsu flowmindsu   4096 oct.   1 11:48 standalone

            drwxrwxr-x  8 flowmindsu flowmindsu   4096 oct.   1 11:48 standalone-unit-tests

            -rw-rw-r--  1 flowmindsu flowmindsu     58 mai    9 13:10 version.txt

            drwxrwxr-x  3 flowmindsu flowmindsu   4096 mai    9 13:10 welcome-content

             

            Maybe the problem is linked to the following issue:

             

            [JBIDE-12424] Specifying a non-default configuration file in non-default profile doesn't work as expected via JBDS 5 - J…

             

            But the suggestion of putting relative path ie:

            ./standalone.sh -Djboss.server.base.dir=../custom --server-config=standalone-full-ha.xml

            does not work neither.


            • 3. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
              incardonamf

              By removing the -Djboss.server.base.dir directive in the standalone.sh, the unix script works fine now.

              The standalone.bat script for Windows does *not* contain the -Djboss.server.base.dir, this is why I tried to use the same command line for unix.

               

              Is there a reason why the command line is a bit different for unix compared to windows regarding the -Djboss.server.base.dir?

               

               

              while true; do

                 if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then

                    # Execute the JVM in the foreground

                    eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \

                       \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/server.log\" \

                       \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \

                       -jar \"$JBOSS_HOME/jboss-modules.jar\" \

                       -mp \"${JBOSS_MODULEPATH}\" \

                       -jaxpmodule "javax.xml.jaxp-provider" \

                       org.jboss.as.standalone \

                       -Djboss.home.dir=\"$JBOSS_HOME\" \

              #         -Djboss.server.base.dir=\"$JBOSS_BASE_DIR\" \

                       "$SERVER_OPTS"

                    JBOSS_STATUS=$?

                 else

              • 4. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
                jaikiran

                You should be able to override that jboss.server.base.dir property from the command line. Both from a .bat file and the .sh file. If you are not able to do it in either of those, then it's a bug. Can you file a JIRA please?

                • 5. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
                  incardonamf

                  Yes I did try to launch with the commented line and by overriding by using -Djboss.server.base.dir in the command line


                  #         -Djboss.server.base.dir=\"$JBOSS_BASE_DIR\" \


                  Sounds OK with a non-default profile, but I did not try to deploy any ears.


                  Now, the thing is that when I try to launch the default "standalone" profile with the commented line (without and with providing the -Djboss.server.base.dir=/path/to/standalone --server-config=myConfFile.xml), the deployement of ears that are present in the deployment directory fails with errors :


                  11:12:32,776 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.subunit."fm-server-jboss7-7.5.ear"."fm-ejb-step-manager-7.5.jar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."fm-server-jboss7-7.5.ear"."fm-ejb-step-manager-7.5.jar".PARSE: JBAS018733: N'a pas pu traiter la phase PARSE de subdeployment "fm-ejb-step-manager-7.5.jar" of deployment "fm-server-jboss7-7.5.ear"

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_38]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_38]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_38]

                  Caused by: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.ejb.default-resource-adapter-name-service not found

                    at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:448) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

                    at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.getDefaultResourceAdapterName(MessageDrivenComponentDescriptionFactory.java:270)

                    at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processMessageBeans(MessageDrivenComponentDescriptionFactory.java:152)

                    at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processAnnotations(MessageDrivenComponentDescriptionFactory.java:80)

                    at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:58)

                    at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDeploymentUnitProcessor.java:81)

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

                    ... 5 more


                  Sounds like it does not recognized my myConfFile.xml

                  I did try also to gives all the pathes to config dir, data dir, etc... on the command line, but it fails also.


                  When I rollback to the original standalone.sh file, the deployment of ears using the default profile is OK.

                  So, yes, I think that there is a bug in the standalone.sh script with non-default profile.


                  I'll try to create a JIRA ticket.


                  Cheers.

                  MF

                  • 6. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
                    ak_mwadmin

                    Hi MF,

                     

                         Try adding one more parameter along with -Djboss.server.base.dir=../DIR_NAME add the node name parameter to make sure it is using unique one in cluster -Djboss.node.name=NODE_NAME.

                     

                    Hope this should help u resolve this.

                    • 7. Re: How to launch JBoss-eap6.1 standalone unix script with non-default profile? seems that it's not working
                      incardonamf

                      Not sure I get your point. I'm not in cluster environment, just wanted to launch jboss with standalone.

                       

                      Anyway, I tried your suggestion by using a relative path for -Djboss.server.base.dir and adding a dummy node name like -Djboss.node.name=MY_NODE_NAME

                      It's not working, the problem is still with the main configuration file not found.