8 Replies Latest reply on Mar 9, 2007 3:16 PM by peterj

    Accessing ini file after deployment - Urgent

    ycindepalle

      Hello,

      I am passing application.home and application.configFile to JAVA_OPTS in run.bat and run.sh files for windows and unix instances respectively.

      I am not able to access these files from my application after deploying the ear file.

      Windows instance:

      set JAVA_OPTS=%JAVA_OPTS% -Dapplication.home=C:\jboss405GA\server\default\deploy\
      set JAVA_OPTS=%JAVA_OPTS% -Dapplication.configFile=bin\security.ini


      Since the ear is exploded in the tmp directory, i am not able to
      access my home directory like this: System.getProperty("application.home")

      Any help is greatly appreciated.

      We use this on other app servers like OC4J and weblogic too.

      regards
      Yugandhar

        • 1. Re: Accessing ini file after deployment - Urgent
          peterj

          You could deploy an exploded ear file. See http://wiki.jboss.org/wiki/Wiki.jsp?page=ExplodedDeployment

          In addition, you do not need to define application.home, you can instead use the jboss.server.home.dir system property and add the /deploy to it:

          String deployDir = System.getProperty("jboss.server.home.dir") + "/deploy";

          • 2. Re: Accessing ini file after deployment - Urgent
            ycindepalle

            Peter

            thanks for your quick response. I appreciate your time.

            What am I supposed to do with my ear file to deploy in exploded form.

            I copied the ear file into the deploy directory and it exploded in tmp directory.

            regards
            Yugandhar

            • 3. Re: Accessing ini file after deployment - Urgent
              ycindepalle

              Peter

              Actually my question is - do we need to do it manually all the time for exploded deployment.

              Can we configure in jboss to do it automatically the exploded format.

              redeployment needs manually intervention ..right
              regards

              Yugandhar

              • 4. Re: Accessing ini file after deployment - Urgent
                peterj

                If you create your ear file by first gathering all of the necessary files into one location and then creating an ear from that directory, all you need to do its copy that directory to the deploy directory. Note that the directory must have a .ear extension.

                For example, if your ear file is named myapp.ear and it contains webui.war, someejbs.jar and the application.xml file, you would have the following files when you deploy exploded:

                server/xxx/deploy/myapp.ear/someejbs.jar
                server/xxx/deploy/myapp.ear/webui.war
                server/xxx/deploy/myapp.ear/META-INF/application.xml



                • 5. Re: Accessing ini file after deployment - Urgent
                  ycindepalle

                  thanks peter for your reply.

                  I am creating .ear file from a single directory. Your suggestions should work. Will test them.

                  regards
                  Yugandhar

                  • 6. Re: Accessing ini file after deployment - Urgent
                    ycindepalle

                    Peter

                    If I want to acces my bin directory for the ini file located in SOAServices.ear/bin/security.ini

                    then can i set up the application.home as -Dapplication.home=C:\jboss405GA\server\default\deploy\SOAServices.ear

                    we would like to avoid using jboss specific home directories in the code. hence
                    we are passing the application.home in the JAVA_OPTS.

                    thanks in advance.
                    regards
                    Yugandhar

                    • 7. Re: Accessing ini file after deployment - Urgent
                      ycindepalle

                      I created and deployed the contents in the directory. The deployment went fine. It works when I make EJB calls but for some reason I dont see any System.out.println statements in the console when I give my application home as
                      -Dapplication.home=C:\jboss405GA\server\default\deploy\SOAServices.ear

                      Infact I dont see any activity on the console though the deployment is fine and EJB requests are responding. Also I dont see log files created if this is accepting my ini file for creating the logs.

                      Any advise is greatly appreciated.

                      regards
                      Yugandhar

                      • 8. Re: Accessing ini file after deployment - Urgent
                        peterj

                        Without knowing what your code is doing or how it is handling the ini file or what output you are expecting to see, I could not make any kind of guess as to what is wrong.