[jboss-user] [Beginners Corner] - Setting up VirtualHosts

GermanDev do-not-reply at jboss.com
Sun Jun 7 08:21:05 EDT 2009


I have a Debian Lenny root server running JBoss 4.2.3.GA default installation. 

I have a few Seam applications (currently only two) that I want to deploy to the server. Both applications should be deployed as http://app1.my-domain.com and http://app2.my-domain.com. I first thought about using a transparent Proxy but then heard about the VirtualHost feature of JBoss. I tried to figure it out on my own but currently am stuck and so hope you can help me:

I first want to deploy one Seam application. The application is deployed as an EAR and currently accessible using http://serverip:8080/myApp.

Before changing this application I changed the /../jboss/server/default/deploy/jboss-web.deployer/server.xml and added another  section just below the existing one (server localhost).

  | <Host name="app1.my-domain.com" autoDeploy="false" deployOnStartup="true" deployXML="true">
  |          <Alias>app1.my-domain.com</Alias>
  |           <Valve className="org.apache.catalina.valves.AccessLogValve"
  |                        prefix="vhost1" suffix=".log" pattern="common"
  |                        directory="${jboss.server.home.dir}/log"/>
  |          <DefaultContext cookies="true" crossContext="true" override="true"/>
  | </Host>

Then I edited the jboss-web.xml file under myApp.ear/myApp.war/WEB-INF/ and changed it from 

  | <jboss-web>  
  |     <class-loading java2ClassLoadingCompliance="false">
  |         <loader-repository>
  |             seam.jboss.org:loader=myApp
  |             <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
  |         </loader-repository>
  |     </class-loading>
  | </jboss-web>


  | <jboss-web>
  |         <context-root>/</context-root>
  |         <virtual-host>app1.my-domain.com</virtual-host>
  | </jboss-web>

The application is nevertheless deployed to http://app1.my-domain.com/myApp/ but doesn't work even there properly. When trying to access the application the following error is thrown and I am redirected to my applications error page:

  | 14:14:56,676 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
  | java.lang.IllegalStateException: No active application scope

Additionally the whole RichFaces theming  (on the error page) doesn't work. 

What was my mistake? What can I do to correctly deploy the application to the second host 'app1.my-domain.com'?

Thank you in advance!

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4235825#4235825

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4235825

More information about the jboss-user mailing list