Multiple configuration and WebAppDeployer issue with jetty 6.1.4 standalone.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple configuration and WebAppDeployer issue with jetty 6.1.4 standalone.

copernic Jeremy
Hello everyone!

I am facing a strange issue with jetty 6.1.4.standalone:
I have two configuration file jetty.xml and jetty2.xml.

I am launching the server through this command:
> java -jar start.jar etc/jetty.xml etc/jetty2.xml

My first configuration file contain a basic SelectChannelConnector on port 8080 and a WebAppDeployer on $Jetty_Home/webapp and my second file is configured on port 8090 with also a selectChannelConnector and a WebAppDeployer on $Jetty_home/webapp2.
  $Jetty_home/webapp contain mywebapp1.war
  $Jetty_home/webapp2 contain mywebapp2.war


The issue:

Once I have launched the server through the command line java -jar start.jar etc/jetty.xml etc/jetty2.xml  it seems that jetty merge and override the WebAppDeployer configuration of jetty.xml with jetty2.xml, because I can only access to the  mywebapp2.war application on port 8080 and 8090. So it seems that the Jetty instance is the same on both port (8080 and 8090), and so only the content of the folder  $Jetty_Home/webapp2 (which is here) mywebapp2.war is accessible.  Of course by changing the order ( java -jar start.jar etc/jetty2.xml etc/jetty.xml) of the configuration file, then only mywebapp1.war is accessible.

The probleme is that the documentation  http://docs.codehaus.org/display/JETTY/jetty.xml state that "a single Jetty instance will be started with one org.mortbay.jetty.Server instance per configuration file". So In my case I guessed that I was able to access the content  of $Jetty_home/webapp on port 8080 and the content of $jetty_home/webapp2 on port 8090 through this command ( java -jar start.jar etc/jetty.xml etc/jetty2.xml).  But it is not the case.
Can someone please explain me the missconfiguration I may have done or confirm me that it might be a potential bug?

Cheers,
Jeremy

Here is my jetty2.xml:


<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" " http://jetty.mortbay.org/configure.dtd">

<Configure id="Server" class="org.mortbay.jetty.Server">
....
  
    <Set name="ThreadPool">
         <New class="org.mortbay.thread.BoundedThreadPool ">
        <Set name="minThreads">10</Set>
        <Set name="maxThreads">250</Set>
        </New>
    </Set>
 
    <Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <Set name="port"><SystemProperty name="jetty.port" default="8090"/></Set>
           </New>
      </Arg>
    </Call>


    <Set name="handler">
      <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection ">
        <Set name="handlers">
         <Array type="org.mortbay.jetty.Handler">
           <Item>
             <New id="Contexts" class=" org.mortbay.jetty.handler.ContextHandlerCollection"/>
           </Item>
           <Item>
             <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>
   
   
    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.WebAppDeployer">
          <Set name="contexts"><Ref id="Contexts"/></Set>
          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/webapp2</Set>
          <Set name="parentLoaderPriority">false</Set>
          <Set name="extract">true</Set>
          <Set name="allowDuplicates">false</Set>
          <Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
        </New>
      </Arg>
    </Call>
....
</Configure>






-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Multiple configuration and WebAppDeployer issue with jetty 6.1.4 standalone.

Jan Bartel
Hi Jeremy,


The info you need is here:
http://docs.codehaus.org/display/JETTY/How+to+serve+webbapp+A+from+portA+and+webapp+B+from+portB

You need to configure a different Server instance in both of your
startup files, so make sure you give them each a different "id" attribute.

The wording on the http://docs.codehaus.org/display/JETTY/jetty.xml page
is misleading, so I've fixed that.

regards
Jan

copernic Jeremy wrote:

> Hello everyone!
>
> I am facing a strange issue with jetty 6.1.4.standalone:
> I have two configuration file jetty.xml and jetty2.xml.
>
> I am launching the server through this command:
>> java -jar start.jar etc/jetty.xml etc/jetty2.xml
>
> My first configuration file contain a basic SelectChannelConnector on
> port 8080 and a WebAppDeployer on $Jetty_Home/webapp and my second file
> is configured on port 8090 with also a selectChannelConnector and a
> WebAppDeployer on $Jetty_home/webapp2.
>   $Jetty_home/webapp contain mywebapp1.war
>   $Jetty_home/webapp2 contain mywebapp2.war
>
>
> The issue:
>
> Once I have launched the server through the command line java -jar
> start.jar etc/jetty.xml etc/jetty2.xml  it seems that jetty merge and
> override the WebAppDeployer configuration of jetty.xml with jetty2.xml,
> because I can only access to the  mywebapp2.war application on port 8080
> and 8090. So it seems that the Jetty instance is the same on both port
> (8080 and 8090), and so only the content of the folder
> $Jetty_Home/webapp2 (which is here) mywebapp2.war is accessible.  Of
> course by changing the order ( java -jar start.jar etc/jetty2.xml
> etc/jetty.xml) of the configuration file, then only mywebapp1.war is
> accessible.
>
> The probleme is that the documentation
> http://docs.codehaus.org/display/JETTY/jetty.xml state that "a single
> Jetty instance will be started with one org.mortbay.jetty.Server^
> <http://jetty.mortbay.org/apidocs/org/mortbay/jetty/Server.html>
> instance per configuration file". So In my case I guessed that I was
> able to access the content  of $Jetty_home/webapp on port 8080 and the
> content of $jetty_home/webapp2 on port 8090 through this command ( java
> -jar start.jar etc/jetty.xml etc/jetty2.xml).  But it is not the case.
> Can someone please explain me the missconfiguration I may have done or
> confirm me that it might be a potential bug?
>
> Cheers,
> Jeremy
>
> Here is my jetty2.xml:
>
>
> <?xml version="1.0"?>
> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "
> http://jetty.mortbay.org/configure.dtd">
>
> <Configure id="Server" class="org.mortbay.jetty.Server">
> ....
>  
>     <Set name="ThreadPool">
>          <New class="org.mortbay.thread.BoundedThreadPool ">
>         <Set name="minThreads">10</Set>
>         <Set name="maxThreads">250</Set>
>         </New>
>     </Set>
>  
>     <Call name="addConnector">
>       <Arg>
>           <New class="org.mortbay.jetty.nio.SelectChannelConnector">
>             <Set name="port"><SystemProperty name="jetty.port"
> default="8090"/></Set>
>            </New>
>       </Arg>
>     </Call>
>
>
>     <Set name="handler">
>       <New id="Handlers"
> class="org.mortbay.jetty.handler.HandlerCollection ">
>         <Set name="handlers">
>          <Array type="org.mortbay.jetty.Handler">
>            <Item>
>              <New id="Contexts" class="
> org.mortbay.jetty.handler.ContextHandlerCollection"/>
>            </Item>
>            <Item>
>              <New id="DefaultHandler"
> class="org.mortbay.jetty.handler.DefaultHandler"/>
>            </Item>
>          </Array>
>         </Set>
>       </New>
>     </Set>
>    
>    
>     <Call name="addLifeCycle">
>       <Arg>
>         <New class="org.mortbay.jetty.deployer.WebAppDeployer">
>           <Set name="contexts"><Ref id="Contexts"/></Set>
>           <Set name="webAppDir"><SystemProperty name="jetty.home"
> default="."/>/webapp2</Set>
>           <Set name="parentLoaderPriority">false</Set>
>           <Set name="extract">true</Set>
>           <Set name="allowDuplicates">false</Set>
>           <Set name="defaultsDescriptor"><SystemProperty
> name="jetty.home" default="."/>/etc/webdefault.xml</Set>
>         </New>
>       </Arg>
>     </Call>
> ....
> </Configure>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> jetty-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-discuss


--
Jan Bartel, Webtide LLC | [hidden email] | http://www.webtide.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss