It looks OK to me and I have the very same config working on my machine. I'm 
running this on Windows though.

Could it be some "poison" character messing around in the config.xml; maybe at the end of 
<attribute name="initParams">name=elitesa.com  !?

Can somebody else with a Mac take a quick look at this? I copied and pasted 
this conf on my machine and got it working

Cheers!
Hernan

John wrote:
Hernan Cunico wrote:
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.

Hernan,

Thanks for your response. Here is my gbean definition, right after the <module name="..."> line in my config.xml:

<gbean name="org.apache.geronimo.configs/tomcat6/2.1/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1/car,j2eeType=Host,name=TomcatVirtualHost_1" gbeanInfo="org.apache.geronimo.tomcat.HostGBean"> <attribute name="className">org.apache.catalina.core.StandardHost</attribute>
           <attribute name="initParams">name=elitesa.com
           appBase=
           workDir=work</attribute>
 </gbean>

Here is my complete, unedited, deployment plan:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0";>
   <environment>
       <moduleId>
           <groupId>com.esa.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>elitesa.com</host>
   <resource-ref>
       <ref-name>jdbc/MailSystem</ref-name>
       <resource-link>jdbc/MailSystem</resource-link>
   </resource-ref>
</web-app>

As you can see, both the "name=" from the config.xml definition and the host entry in the deployment plan match up. I am performing a command line deployment with the geronimo-web.xml deployment plan at WEB-INF within my WAR file. Yet, I still receive this error:

The service J2EEApplication=null,j2eeType=WebModule,name=com.esa.hosting/ChangePassword/2.1/war did not start because Invalid virtual host 'elitesa.com'. Do you have a matching Host entry in the plan?

at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:485)
   ... 41 more
   Error: Operation failed: start of
   com.esa.hosting/ChangePassword/2.1/war failed

       Unknown start exception

       Configuration com.esa.hosting/ChangePassword/2.1/war failed to
   start due to the following reasons:

     The service
J2EEApplication=null,j2eeType=WebModule,name=com.esa.hosting/ChangePassword/2.1/war
   did not start because Invalid virtual host 'elitesa.com'.  Do you
   have a matching Host entry in the plan?

I agree that it should be just as easy as you say, however, it isn't for me.

Thanks again,
John


Reply via email to