Opening the console on the two virtual hosts only confirms you can resolve the host name alias but not the virtual host configuration.
The error you get at deployment time is because the deployer does not know the virtual host you specified in the plan. I would say you look into the config.xml and check if you are missing anything from the sample on the doc.
You should have something like this sample right after the <module
name="org.apache.geronimo.configs/tomcat6/2.1/car"> in the config.xml.
<gbean gbeanInfo="org.apache.geronimo.tomcat.HostGBean"
name="org.apache.geronimo.configs/tomcat6/2.1/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1/car,j2eeType=Host,name=exampleVirtualHost_1">
<attribute name="className">org.apache.catalina.core.StandardHost</attribute>
<attribute name="initParams">name=example.com
appBase=
workDir=work</attribute>
</gbean>
That's all you need for configuring one virtual host in Geronimo with Tomcat.
HTH
Cheers!
Hernan
John wrote:
Hi,
I've configured two virtual hosts for testing in Geronimo 2.1 running on
OS X by following the instructions at:
http://cwiki.apache.org/GMOxDOC21/configuring-virtual-hosts-in-geronimo-tomcat.html
However, when I try to deploy a webapp with the following deployment plan:
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
<environment>
<moduleId>
<groupId>com.example.hosting</groupId>
<artifactId>ChangePassword</artifactId>
<version>2.1</version>
<type>war</type>
</moduleId>
<dependencies>
<dependency>
<groupId>console.dbpool</groupId>
<artifactId>MailSystem</artifactId>
</dependency>
</dependencies>
</environment>
<context-root>/changePassword</context-root>
<host>example.com</host>
<resource-ref>
<ref-name>jdbc/MailSystem</ref-name>
<resource-link>jdbc/MailSystem</resource-link>
</resource-ref>
</web-app>
I receive the following exception:
Caused by: org.apache.geronimo.gbean.InvalidConfigurationException:
Configuration com.example.hosting/ChangePassword/2.1/war failed to start
due to the following reasons:
The service
J2EEApplication=null,j2eeType=WebModule,name=com.example.hosting/ChangePassword/2.1/war
did not start because Invalid virtual host 'example.com'. Do you have a
matching Host entry in the plan?
at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:485)
I can open the console application on the 2 different virtual hosts that
are configured and ping each from the command line, however, the
deployment fails. What am I missing?
Thanks,
John