Hi Mark,
Following is a workable solution you can give try. :)
1. Create folder structure like given.
<Port>
|- build.xml
|- <config>
|-<connectors>
|-<WEB-INF>
|-web.xml
|-<war1>
|-<WEB-INF>
|-web.xml
|-page1.jsp
|-<war2>
|-<WEB-INF>
|-web.xml
|-page2.jsp
|- application.xml
|- geronimo-applicaion.xml
|- <releases>
(Directories are shown in <> mark).
2. Use given build.xml file and geronimo-application.xml.
3. Install Ant on your OS.
4. Open a new command prompt and navigate in to the Port folder and give
ant command. It will create appPerPort.ear under Port/releases folder.
4. Deploy appPerPort.ear using Geronimo console.
5. Open 2 web browser consoles and point each of them in to
http://localhost:8081/war1/page1.jsp
http://localhost:8082/war2/page2.jsp
Thanks,
Lasantha Ranaweera
> Hi Lasantha,
>
> Sounds good. I did know about (1), but didn't figure out (2).
>
> Thanks!
>
> -Mark
>
> On Oct 20, 2006, at 3:07 AM, [EMAIL PROTECTED] wrote:
>
>> Hi Mark,
>>
>> There are 2 problems in the given ear of this sample application. As a
>> result of those, you are getting this issue. You can fix these
>> issues as
>> given below too.
>>
>> 1. There is a schema problem in the geronimo-application.xml file
>> with G
>> 1.1.1. Comment <context-prority-classloader> element (3 places).
>>
>> 2. If you try to deploy it straight way it won't work :). First you
>> have
>> to create proper ear and war files from the given files.
>>
>> Use jar command to create 3 wars and put them in to a correct package
>> hierachy of a ear file (with applicaion.xml and geronimo-
>> applicaion.xml
>> too). Create the ear file and deploy it.
>>
>> I have informed these issues in to the confuence with a fix (with
>> an Ant
>> script). Hope you will get it soon.
>>
>> Thanks,
>> Lasantha Ranaweera
>>
>>
>>> I'm still stuck on this, and unfortunately I cannot deploy my
>>> applications in production with Geronimo until I get this working.
>>>
>>> Has anyone been able to deploy two different applications to two
>>> different tomcat connectors in the same Geronimo instance? As shown
>>> below, the example on the wiki does not work!
>>>
>>> Thanks,
>>>
>>> -Mark
>>>
>>>> Well, I thought that I might be able to take the example in wiki
>>>> (http://cwiki.apache.org/GMOxDOC11/exposing-web-applications-on-
>>>> distinct-ports.html) and whittle it down to what I need, but I
>>>> can't even deploy the example .ear( appPerPort.ear). I get this
>>>> error:
>>>>
>>>> geronimo-1.1.1% java -jar bin/deployer.jar deploy appPerPort.ear
>>>>
>>>> Error: Unable to distribute appPerPort.ear: Cannot deploy the
>>>> requested application module because no deployer is able to
>>>> handle
>>>> it. This can happen if you have omitted the J2EE deployment
>>>> descriptor, disabled a deployer module, or if, for example, you
>>>> are
>>>> trying to deploy an EJB module on a minimal Geronimo server that
>>>> does not have EJB support installed.
>>>>
>>>> (moduleFile=/Users/mark/Programs/geronimo-1.1.1/var/temp/ geronimo-
>>>> deployer4506.tmpdir/appPerPort.ear)
>>>>
>>>>
>>>> and here is the stack trace in the log:
>>>>
>>>>
>>>> Deployer operation failed: Cannot deploy the requested application
>>>> module because no deployer is able to handle it. This can happen if
>>>> you have omitted the J2EE deployment descriptor, disabled a
>>>> deployer module, or if, for example, you are trying to deploy an
>>>> EJB module on a minimal Geronimo server that does not have EJB
>>>> support installed. (moduleFile=/Users/mark/Programs/geronimo-1.1.1/
>>>> var/temp/geronimo- deployer4504.tmpdir/appperport.ear)
>>>> org.apache.geronimo.common.DeploymentException: Cannot deploy the
>>>> requested application module because no deployer is able to handle
>>>> it. This can happen if you have omitted the J2EE deployment
>>>> descriptor, disabled a deployer module, or if, for example, you are
>>>> trying to deploy an EJB module on a minimal Geronimo server that
>>>> does not have EJB support installed. (moduleFile=/Users/mark/
>>>> Programs/ geronimo-1.1.1/var/temp/geronimo-deployer4504.tmpdir/
>>>> appperport.ear) at org.apache.geronimo.deployment.Deployer.deploy
>>>> (Deployer.java:239) at
>>>> org.apache.geronimo.deployment.Deployer.deploy (Deployer.java:124)
>>>> at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$
>>>> $734a235d.invoke(<generated>)
>>>>
>>>> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:
>>>> 53)
>>>>
>>>> at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke
>>>> (FastMethodInvoker.java:38) at
>>>> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke
>>>> (GBeanOperation.java:122) at
>>>> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke
>>>> (GBeanInstance.java:852) at
>>>> org.apache.geronimo.kernel.basic.BasicKernel.invoke
>>>> (BasicKernel.java:239) at
>>>> org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.do
>>>> De
>>>> pl oy(AbstractDeployCommand.java:106) at
>>>> org.apache.geronimo.deployment.plugin.local.DistributeCommand.run
>>>> (DistributeCommand.java:60)
>>>>
>>>> at java.lang.Thread.run(Thread.java:613)
>>>>
>>>> Any ideas?
>>>
>>>
>>>
>
>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004-2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Rev: 395697 $ $Date: 2006-04-20 14:07:47 -0700 (Thu, 20 Apr 2006) $ -->
<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1">
<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
<dep:moduleId>
<dep:groupId>geronimo</dep:groupId>
<dep:artifactId>appPerPort-tomcat</dep:artifactId>
<dep:version>1.1-SNAPSHOT</dep:version>
<dep:type>car</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>geronimo</dep:groupId>
<dep:artifactId>tomcat</dep:artifactId>
<dep:type>car</dep:type>
</dep:dependency>
</dep:dependencies>
<dep:hidden-classes/>
<dep:non-overridable-classes/>
</dep:environment>
<module>
<web>war1.war</web>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
<!-- <context-priority-classloader>false</context-priority-classloader> -->
<web-container>
<gbean-link>TomcatWebContainer1</gbean-link>
</web-container>
</web-app>
</module>
<module>
<web>war2.war</web>
<web-app
xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
<!-- <context-priority-classloader>false</context-priority-classloader> -->
<web-container>
<gbean-link>TomcatWebContainer2</gbean-link>
</web-container>
</web-app>
</module>
<module>
<web>connectors.war</web>
<web-app
xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
<!-- <context-priority-classloader>false</context-priority-classloader> -->
<gbean name="TomcatWebConnector1"
class="org.apache.geronimo.tomcat.ConnectorGBean">
<attribute name="name">HTTP</attribute>
<attribute name="host">localhost</attribute>
<attribute name="port">8081</attribute>
<attribute name="maxHttpHeaderSizeBytes">8192</attribute>
<attribute name="maxThreads">150</attribute>
<attribute name="minSpareThreads">25</attribute>
<attribute name="maxSpareThreads">75</attribute>
<attribute name="hostLookupEnabled">false</attribute>
<attribute name="redirectPort">8453</attribute>
<attribute name="acceptQueueSize">100</attribute>
<attribute name="connectionTimeoutMillis">20000</attribute>
<attribute name="uploadTimeoutEnabled">false</attribute>
<reference name="TomcatContainer">
<name>TomcatWebContainer1</name>
</reference>
</gbean>
<gbean name="TomcatWebConnector2"
class="org.apache.geronimo.tomcat.ConnectorGBean">
<attribute name="name">HTTP</attribute>
<attribute name="host">localhost</attribute>
<attribute name="port">8082</attribute>
<attribute name="maxHttpHeaderSizeBytes">8192</attribute>
<attribute name="maxThreads">150</attribute>
<attribute name="minSpareThreads">25</attribute>
<attribute name="maxSpareThreads">75</attribute>
<attribute name="hostLookupEnabled">false</attribute>
<attribute name="redirectPort">8453</attribute>
<attribute name="acceptQueueSize">100</attribute>
<attribute name="connectionTimeoutMillis">20000</attribute>
<attribute name="uploadTimeoutEnabled">false</attribute>
<reference name="TomcatContainer">
<name>TomcatWebContainer2</name>
</reference>
</gbean>
</web-app>
</module>
<gbean name="TomcatWebContainer1" class="org.apache.geronimo.tomcat.TomcatContainer">
<attribute name="catalinaHome">var/catalina</attribute>
<reference name="EngineGBean">
<name>TomcatEngine1</name>
</reference>
<reference name="ServerInfo">
<name>ServerInfo</name>
</reference>
<reference name="WebManager">
<name>TomcatWebManager</name>
</reference>
</gbean>
<gbean name="TomcatEngine1" class="org.apache.geronimo.tomcat.EngineGBean">
<attribute name="className">org.apache.geronimo.tomcat.TomcatEngine</attribute>
<attribute name="initParams">
name=Geronimo1
</attribute>
<reference name="DefaultHost">
<name>TomcatHost1</name>
</reference>
<references name="Hosts">
<pattern>
<name>TomcatHost1</name>
</pattern>
</references>
<reference name="RealmGBean">
<name>TomcatJAASRealm</name>
</reference>
<!--reference name="TomcatValveChain">
<name>FirstValve</name>
</reference-->
</gbean>
<gbean name="TomcatHost1" class="org.apache.geronimo.tomcat.HostGBean">
<attribute name="className">org.apache.catalina.core.StandardHost</attribute>
<attribute name="initParams">
name=localhost
appBase=
workDir=work
</attribute>
</gbean>
<gbean name="TomcatWebContainer2" class="org.apache.geronimo.tomcat.TomcatContainer">
<attribute name="catalinaHome">var/catalina</attribute>
<reference name="EngineGBean">
<name>TomcatEngine2</name>
</reference>
<reference name="ServerInfo">
<name>ServerInfo</name>
</reference>
<reference name="WebManager">
<name>TomcatWebManager</name>
</reference>
</gbean>
<gbean name="TomcatEngine2" class="org.apache.geronimo.tomcat.EngineGBean">
<attribute name="className">org.apache.geronimo.tomcat.TomcatEngine</attribute>
<attribute name="initParams">
name=Geronimo2
</attribute>
<reference name="DefaultHost">
<name>TomcatHost2</name>
</reference>
<references name="Hosts">
<pattern>
<name>TomcatHost2</name>
</pattern>
</references>
<reference name="RealmGBean">
<name>TomcatJAASRealm</name>
</reference>
<!--reference name="TomcatValveChain">
<name>FirstValve</name>
</reference-->
</gbean>
<gbean name="TomcatHost2" class="org.apache.geronimo.tomcat.HostGBean">
<attribute name="className">org.apache.catalina.core.StandardHost</attribute>
<attribute name="initParams">
name=localhost
appBase=
workDir=work
</attribute>
</gbean>
</application><?xml version="1.0"?>
<!-- ======================================================================
Geronimo Sample Applications
====================================================================== -->
<project name="Port" default="ear">
<property name="dest.dir" value="releases"/>
<property name="config.dir" value="config"/>
<!-- =================================================================== -->
<!-- target: client -->
<!-- =================================================================== -->
<target name="ear" depends="war1,war2,connectors">
<jar destfile="${dest.dir}/appPerPort.ear">
<zipfileset dir="${dest.dir}/ear">
</zipfileset>
</jar>
<delete dir="${dest.dir}/ear"/>
</target>
<!-- =================================================================== -->
<!-- target: war1 -->
<!-- =================================================================== -->
<target name="war1" depends="package">
<jar destfile="${dest.dir}/ear/war1.war">
<zipfileset dir="${dest.dir}/ear/war1">
</zipfileset>
</jar>
<delete dir="${dest.dir}/ear/war1"/>
</target>
<!-- =================================================================== -->
<!-- target: war2 -->
<!-- =================================================================== -->
<target name="war2" depends="package">
<jar destfile="${dest.dir}/ear/war2.war">
<zipfileset dir="${dest.dir}/ear/war2">
</zipfileset>
</jar>
<delete dir="${dest.dir}/ear/war2"/>
</target>
<!-- =================================================================== -->
<!-- target: connectors -->
<!-- =================================================================== -->
<target name="connectors" depends="package">
<jar destfile="${dest.dir}/ear/connectors.war">
<zipfileset dir="${dest.dir}/ear/connectors">
</zipfileset>
</jar>
<delete dir="${dest.dir}/ear/connectors"/>
</target>
<!-- =================================
package: build directory structure
================================= -->
<target name="package">
<mkdir dir="${dest.dir}/ear"/>
<mkdir dir="${dest.dir}/ear/META-INF"/>
<mkdir dir="${dest.dir}/ear/connectors"/>
<mkdir dir="${dest.dir}/ear/war1"/>
<mkdir dir="${dest.dir}/ear/war2"/>
<copy todir="${dest.dir}/ear/META-INF">
<fileset file="${config.dir}/application.xml"/>
<fileset file="${config.dir}/geronimo-application.xml"/>
</copy>
<copy todir="${dest.dir}/ear/war1">
<fileset dir="${config.dir}/war1"/>
</copy>
<copy todir="${dest.dir}/ear/war2">
<fileset dir="${config.dir}/war2"/>
</copy>
<copy todir="${dest.dir}/ear/connectors">
<fileset dir="${config.dir}/connectors"/>
</copy>
</target>
</project>