3 Replies Latest reply on Apr 28, 2005 2:46 PM by John O'Grady

    Server configurations are completely unrelocatable

    John O'Grady Newbie

      Well, I've been working on this problem a couple of days now and had two posts here. One post has been ignored for six months, the other post got half an answer.

      All I want to do is have a server config directory somewhere other than jboss/server/xxx, where xxx is all, minimal, default, or my own config. Before I get another "rtfl lame brain!", I read the following twice:

      http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch01.html

      ...and spent the last two days playing with the settings in every concievable configuration possible given the documentation.

      Either JBoss is broken in this regard, or the documentation is completely wrong. Which is it guys?

      Let's go over one example. Given the following virtual hosting directory structure:

      /vhosts
       | ----/jboss.com
       | | ----/jboss-start.sh
       | | ----/jboss-stop.sh
       | | ----/webapps
       | | | ----/conf
       | | | ----/deploy
       | | | ----/lib
       | | ----/htdocs
       | | | ----/index.html
       | ----/hostedDomain2.com
       | | ----/jboss-start.sh
       | | ----/jboss-stop.sh
       | | ----/webapps
       | | | ----/conf
       | | | ----/deploy
       | | | ----/lib
       | | ----/htdocs
       | | | ----/index.html
      


      Assume the "webapps" directory is just a copy of the "minimal" server configuration from the default JBoss installation. Using what one poster gave me, I started the "jboss.com" server with the following:

      Z:\tmp\jboss\bin\run.bat \
      -Djboss.server.base.dir=Z:/tmp/vhosts/jboss.com/ \
      -Djboss.server.name=webapps

      ... and I get the following error:

      ===============================================================================
      .
       JBoss Bootstrap Environment
      .
       JBOSS_HOME: Z:\tmp\jboss\bin\\..
      .
       JAVA: C:\Java\jdk1.5.0\bin\java
      .
       JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m
      .
       CLASSPATH: C:\Java\jdk1.5.0\lib\tools.jar;Z:\tmp\jboss\bin\\run.jar
      .
      ===============================================================================
      .
      18:20:07,234 INFO [Server] Starting JBoss (MX MicroKernel)...
      18:20:07,234 INFO [Server] Release ID: JBoss [Zion] 4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)
      18:20:07,234 INFO [Server] Home Dir: Z:\tmp\jboss
      18:20:07,250 INFO [Server] Home URL: file:/Z:/tmp/jboss/
      18:20:07,250 INFO [Server] Library URL: file:/Z:/tmp/jboss/lib/
      18:20:07,250 INFO [Server] Patch URL: null
      18:20:07,250 INFO [Server] Server Name: webapps
      18:20:07,250 INFO [Server] Server Home Dir: Z:\tmp\vhosts\jboss.com\webapps
      18:20:07,250 INFO [Server] Server Home URL: file:/Z:/tmp/jboss/server/webapps/
      18:20:07,250 INFO [Server] Server Data Dir: Z:\tmp\vhosts\jboss.com\webapps\data
      18:20:07,250 INFO [Server] Server Temp Dir: Z:\tmp\vhosts\jboss.com\webapps\tmp
      18:20:07,265 INFO [Server] Server Config URL: file:/Z:/tmp/jboss/server/webapps/conf/
      18:20:07,265 INFO [Server] Server Library URL: file:/Z:/tmp/jboss/server/webapps/lib/
      18:20:07,265 INFO [Server] Root Deployment Filename: jboss-service.xml
      18:20:07,265 INFO [Server] Starting General Purpose Architecture (GPA)...
      18:20:08,078 INFO [ServerInfo] Java version: 1.5.0,Sun Microsystems Inc.
      18:20:08,078 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0-b64,Sun Microsystems Inc.
      18:20:08,078 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
      18:20:08,468 INFO [Server] Core system initialized
      Failed to boot JBoss:
      org.jboss.deployment.DeploymentException: url file:/Z:/tmp/jboss/server/webapps/conf/jboss-service.xml could not be open
      ed, does it exist?
       at org.jboss.deployment.DeploymentInfo.<init>(DeploymentInfo.java:175)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
       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:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
       at org.jboss.Main.boot(Main.java:162)
       at org.jboss.Main$1.run(Main.java:423)
       at java.lang.Thread.run(Thread.java:595)
      18:20:08,500 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
      Shutting down
      


      Now the jboss-service.xml is definitely there, but for some reason, JBoss can't find it. Well, the docs say there's another setting "jboss.server.config.url", that can be "redirected". But, umm... if you look at the output above, this line:
      18:20:07,265 INFO [Server] Server Config URL: file:/Z:/tmp/jboss/server/webapps/conf/
      

      ...? Doesn't that mean that jboss found where the jboss-service.xml file was?

      I'd list more trials here, but they all turn out the same no matter what combination of the so-called "overridable" location settings you use. Would anyone like to take a crack at why this is so broken, or why I am so wrong? I'd be happy if I was wrong...

        • 1. Re: Server configurations are completely unrelocatable
          Adrian Brock Master

          You will be so happy since you are wrong :-)

          Though tmainly because the config is slightly counter intuitive.

          [ejort@htimes2 ejort]$ cd ~/temp/jboss-4.0.1sp1
          [ejort@htimes2 jboss-4.0.1sp1]$ cp -r server/minimal/ /tmp
          [ejort@htimes2 jboss-4.0.1sp1]$ cd bin/
          [ejort@htimes2 bin]$ ./run.sh -Djboss.server.base.dir=/tmp -Djboss.server.base.url=file:/tmp -c webapps
          =========================================================================
          
           JBoss Bootstrap Environment
          
           JBOSS_HOME: /home/ejort/temp/jboss-4.0.1sp1
          
           JAVA: /usr/java/j2sdk1.4.2_04/bin/java
          
           JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh
          
           CLASSPATH: /home/ejort/temp/jboss-4.0.1sp1/bin/run.jar:/usr/java/j2sdk1.4.2_04/lib/tools.jar
          
          =========================================================================
          
          21:28:00,838 INFO [Server] Starting JBoss (MX MicroKernel)...
          21:28:00,883 INFO [Server] Release ID: JBoss [Zion] 4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)
          21:28:00,926 INFO [Server] Home Dir: /home/ejort/temp/jboss-4.0.1sp1
          21:28:00,968 INFO [Server] Home URL: file:/home/ejort/temp/jboss-4.0.1sp1/
          21:28:01,010 INFO [Server] Library URL: file:/home/ejort/temp/jboss-4.0.1sp1/lib/
          21:28:01,055 INFO [Server] Patch URL: null
          21:28:01,097 INFO [Server] Server Name: webapps
          21:28:01,138 INFO [Server] Server Home Dir: /tmp/webapps
          21:28:01,181 INFO [Server] Server Home URL: file:/tmp/webapps/
          21:28:01,223 INFO [Server] Server Data Dir: /tmp/webapps/data
          21:28:01,265 INFO [Server] Server Temp Dir: /tmp/webapps/tmp
          21:28:01,307 INFO [Server] Server Config URL: file:/tmp/webapps/conf/
          21:28:01,349 INFO [Server] Server Library URL: file:/tmp/webapps/lib/
          21:28:01,391 INFO [Server] Root Deployment Filename: jboss-service.xml
          21:28:01,441 INFO [Server] Starting General Purpose Architecture (GPA)...
          21:28:03,168 INFO [ServerInfo] Java version: 1.4.2_04,Sun Microsystems Inc.
          21:28:03,210 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.4.2_04-b05,Sun Microsystems Inc.
          21:28:03,252 INFO [ServerInfo] OS-System: Linux 2.4.20-30.9,i386
          21:28:04,777 INFO [Server] Core system initialized
          21:28:08,361 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
          21:28:09,812 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
          21:28:10,137 INFO [Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)] Started in 8s:696ms
          
          [1]+ Stopped ./run.sh -Djboss.server.base.dir=/tmp -Djboss.server.base.url=file:/tmp -c webapps
          [ejort@htimes2 bin]$ bg
          [1]+ ./run.sh -Djboss.server.base.dir=/tmp -Djboss.server.base.url=file:/tmp -c webapps &
          [ejort@htimes2 bin]$ touch /tmp/webapps/deploy/rubbish-service.xml
          [ejort@htimes2 bin]$ 21:29:00,263 ERROR [STDERR] [Fatal Error] :-1:-1: Premature end of file.
          21:29:00,293 ERROR [MainDeployer] Could not initialise deployment: file:/tmp/webapps/deploy/rubbish-service.xml
          


          Feature request:
          http://jira.jboss.com/jira/browse/JBAS-1760

          • 2. Re: Server configurations are completely unrelocatable
            Andy Nguyen Newbie

            Adrian, you're right, that is counter intuitive. It's got my vote to be fixed.

            • 3. Re: Server configurations are completely unrelocatable
              John O'Grady Newbie

              You're right - I'm glad I'm wrong! The documentation gives the impression that the URL property names are are only used for remoting some of the configuration, like so:

              The XXX_URL names correspond to locations that can be specified using a URL to access remote locations, for example, http URLs against a web server.
              


              ...which is from:

              http://docs.jboss.org/jbossas/admin-devel/Chap1.html

              This would seem like too basic and important a feature to have so cryptic a configuration if JBoss wants to gain market share in the web hosting domain, which I would think would be extremely important.