3 Replies Latest reply on Jun 19, 2002 5:53 PM by Michael Prescott

    virtual hosts in jboss3.0

    Narayan Newbie

      I am trying to create virtual hosts in jboss3.0. I have used the following in jetty.xml.





      jerome
      8080
      5
      255
      60000
      60000






      main.jerome
      /
      /examples


      but i am getting the following error


      [2002-05-13 21:00:19,160,Jetty,WARN] WARNING: Unsuitable contextPathSpec /main.jerome, Assuming: /main.jerome/*
      [2002-05-13 21:00:19,270,AutoDeployer,DEBUG] Received notification of mbean Jetty:Jetty=0,context=/main.jerome,WebApplicationContext=0's deployment.
      [2002-05-13 21:00:19,270,Jetty,INFO] Registered Jetty:Jetty=0,context=/main.jerome,WebApplicationContext=0
      [2002-05-13 21:00:19,270,Jetty,INFO] Web Application WebApplicationContext[/main.jerome,/] added
      [2002-05-13 21:00:19,270,Jetty,INFO] loaded config: ../conf/default/jetty.xml
      [2002-05-13 21:00:19,270,Jetty,INFO] start HttpServer version Jetty/3.1.0
      [2002-05-13 21:00:19,820,Jetty,WARN] WARNING: FATAL@file:/C:/examples/servlets/ line:2 col:-1 : org.xml.sax.SAXParseException: Illegal character at end of document, <.
      [2002-05-13 21:00:19,820,Jetty,WARN] WARNING: Configuration error /
      org.xml.sax.SAXParseException: Illegal character at end of document, <.
      at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3108)
      at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3102)
      at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:506)
      at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
      at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:357)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:235)
      at org.mortbay.xml.XmlParser.parse(XmlParser.java:110)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:247)
      at org.mortbay.http.HttpServer.start(HttpServer.java:131)
      at org.jboss.jetty.JettyService.startService(JettyService.java:242)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:117)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:775)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:479)
      at org.jboss.system.ServiceController.registerAndStartService(ServiceController.java:273)
      at org.jboss.system.ServiceController.deploy(ServiceController.java:257)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.ServiceDeployer.invoke(ServiceDeployer.java:732)
      at org.jboss.deployment.ServiceDeployer.addMBeans(ServiceDeployer.java:668)
      at org.jboss.deployment.ServiceDeployer.deploy(ServiceDeployer.java:215)
      at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBeanSupport.java:107)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:654)
      at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:327)
      at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:509)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:117)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:775)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:479)
      at org.jboss.system.ServiceController.registerAndStartService(ServiceController.java:273)
      at org.jboss.system.ServiceController.deploy(ServiceController.java:257)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.ServiceDeployer.invoke(ServiceDeployer.java:732)
      at org.jboss.deployment.ServiceDeployer.addMBeans(ServiceDeployer.java:668)
      at org.jboss.deployment.ServiceDeployer.deploy(ServiceDeployer.java:215)
      at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBeanSupport.java:107)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.Main.(Main.java:199)
      at org.jboss.Main$1.run(Main.java:411)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.Main.main(Main.java:406)
      getException():

      please let me know how to rectify it.

        • 1. Re: virtual hosts in jboss3.0
          Julian Gosnell Expert

          I think that you are making life difficult for yourself.

          You should not be messing with the Jetty configurationElement.

          You can now specify a virtual host in your web-app's jboss-web.xml file. (2.4.5 & 3.*) (find and look at the DTD)

          Then deploy your app by dropping it into deploy/ or using the JMX Agent on 8082.

          Does that help ?


          Jules

          • 2. Re: virtual hosts in jboss3.0
            Narayan Newbie

            Got it!!!!!!!

            Thanks a lot Jules

            What would i do without you..

            • 3. Re: virtual hosts in jboss3.0
              Michael Prescott Newbie

              It seems to me that there should be a way to achieve this that doesn't require anyone to add additional configuration information to the .ear/.war file.

              I think we've become desensitized to this because the J2EE standard isn't complete enough to deploy an EJB application; it's necessary to bundle in app server-specific information (like O/R mapping for entity beans, for example). So when it comes time to configure the server itself, it seems natural to do that inside the .ear file, despite the peculiar coupling this causes.

              I think, however, that things like virtual hosts belong in the app server configuration, not in the .ear. Compare with how data sources are defined and used.

              It would be nice if there was way of maintaining the association between virtual hosts and applications outside of the .ear file. In JBoss 2.4.x, I was able to do this by configuring new auto-deployer/j2ee-deployer mbeans to monitor a separate hot-deployment directory, which was associated with a second instance of jetty.

              This way I could build my .ear files irrespective of where they would be deployed. What if you're in the situation of having a number of web applications share the same virtual host?

              As far as I know, the only way to achieve this in JBoss 3.0 is to run multiple instances of JBoss (discussed elsewhere).

              Michael