You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Jim Alateras <ji...@bigpond.net.au> on 2003/11/26 06:37:20 UTC

[merlin] avalon-http + context

Hi,

I am using the avalon-http block but am having some trouble setting the
app.home context entry. I have tried the following but it is not being
picked up by the component.

<component name="avalon-jetty"
 	     class="org.apache.avalon.merlin.http.JettyWebServer" 
           activation="startup">
  <context>
    <entry key="app.home">
      <constructor class="java.io.File"> 			  
	   /applications/merlin/
	 </constructor>
    </entry>
  </context>
</component>

Any ideas?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http, configuring base directory

Posted by Timothy Bennett <ex...@comcast.net>.
Jim Alateras wrote:

>
>><!-- Jetty-Phoenix block wrapper -->
>><component name="my-web-server"
>>	   class="org.apache.avalon.merlin.http.JettyWebServer">
>>    <configuration>
>>       <Listener port="8196" type="socket"/>
>>       <Context name="www" path="/"/>
> 
> Is this path relative or absolute? 
> 
> 
I believe this path is relative to the component's base directory


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: [merlin] avalon-http, configuring base directory

Posted by Jim Alateras <ji...@comware.com.au>.

> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Timothy Bennett
> Sent: Sunday, February 29, 2004 10:24 AM
> To: dev@avalon.apache.org
> Subject: Re: [merlin] avalon-http, configuring base directory
> 
> Jim Alateras wrote:
> > I am using avalon-http v1.3 with merlin v3.2.4 and I cannot find
> > information on configuring the base directory for serving static
html
> > documents. Can anyone point me to some documentation/source code (I
am
> > using Jetty web server).
> 
> Jim,
> 
> Here's a snippet from one of my block.xml's that define both a context
> for static HTML and a context for a web application.
> 
> <!-- My Jetty-Phoenix session manager sub-class -->
> <component name="my-session-manager"
> 	   class="com.exm.jettyphoenix.MySessionManagerImpl"/>
> 
> <!-- Jetty-Phoenix block wrapper -->
> <component name="my-web-server"
> 	   class="org.apache.avalon.merlin.http.JettyWebServer">
>     <configuration>
>        <Listener port="8196" type="socket"/>
>        <Context name="www" path="/"/>
Is this path relative or absolute? 


cheers
</jima>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http, configuring base directory

Posted by Timothy Bennett <ex...@comcast.net>.
Jim Alateras wrote:
> I am using avalon-http v1.3 with merlin v3.2.4 and I cannot find
> information on configuring the base directory for serving static html
> documents. Can anyone point me to some documentation/source code (I am
> using Jetty web server).

Jim,

Here's a snippet from one of my block.xml's that define both a context 
for static HTML and a context for a web application.

<!-- My Jetty-Phoenix session manager sub-class -->
<component name="my-session-manager"
	   class="com.exm.jettyphoenix.MySessionManagerImpl"/>

<!-- Jetty-Phoenix block wrapper -->
<component name="my-web-server"
	   class="org.apache.avalon.merlin.http.JettyWebServer">
    <configuration>
       <Listener port="8196" type="socket"/>
       <Context name="www" path="/"/>
       <WebContext name="logon" path="/logon/logon.war"/>
    </configuration>
</component>

Regards,
Timothy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http + context

Posted by Stephen McConnell <mc...@apache.org>.

Timothy Bennett wrote:

> Stephen McConnell wrote:
>
>>
>> That was the source file - could you post the patch instead?
>>
>
> Mea Culpa.  I'm learning....
>
> Here's the *real* patch. 


Applied - Thanks.

Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


[merlin] avalon-http, configuring base directory

Posted by Jim Alateras <ji...@comware.com.au>.
I am using avalon-http v1.3 with merlin v3.2.4 and I cannot find
information on configuring the base directory for serving static html
documents. Can anyone point me to some documentation/source code (I am
using Jetty web server).

cheers
</jima>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http + context

Posted by Timothy Bennett <ex...@comcast.net>.
Stephen McConnell wrote:
> 
> That was the source file - could you post the patch instead?
> 

Mea Culpa.  I'm learning....

Here's the *real* patch.


Re: [merlin] avalon-http + context

Posted by Stephen McConnell <mc...@apache.org>.

Timothy Bennett wrote:

> Stephen McConnell wrote:
>
>>
>> You can declare an alias in you context entry tag.
>>
>> @avalon.context key="urn:avalon:home" type="java.io.File" 
>> alias="app.home"
>>
>
> Confirmed this works.  Thanks.  Here's the patch to 
> JettyWebServer.java.... 


That was the source file - could you post the patch instead?

Cheers, Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http + context

Posted by Timothy Bennett <ex...@comcast.net>.
Stephen McConnell wrote:

> 
> You can declare an alias in you context entry tag.
> 
> @avalon.context key="urn:avalon:home" type="java.io.File" alias="app.home"
> 

Confirmed this works.  Thanks.  Here's the patch to JettyWebServer.java....

Re: [merlin] avalon-http + context

Posted by Stephen McConnell <mc...@apache.org>.

Timothy Bennett wrote:

> Jim... Steve... someone help me out a little.  Do I need to add a 
> meta-tag for app.home? 


You can declare an alias in you context entry tag.

@avalon.context key="urn:avalon:home" type="java.io.File" alias="app.home"

http://avalon.apache.org/meta/tools/tags/entry.html

Cheers, Steve.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: [merlin] avalon-http + context

Posted by Jim Alateras <ji...@comware.com.au>.
>  >>><component name="avalon-jetty"
>  >>> 	     class="org.apache.avalon.merlin.http.JettyWebServer"
>  >>>           activation="startup">
>  >>>  <context>
>  >>>    <entry key="app.home">
>  >>>      <constructor class="java.io.File">
>  >>>	   /applications/merlin/
>  >>>	 </constructor>
>  >>>    </entry>
>  >>>  </context>
>  >>></component>
> 
> Can you change the entry key to "urn:avalon:home" in the meantime?
> 
I have tried this but still get the same problem (i.e. app.home key not
found in context; trying urn:avalon:home)


cheers
</jima>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http + context

Posted by Timothy Bennett <ex...@comcast.net>.
Jim Alateras wrote:

 >>><component name="avalon-jetty"
 >>> 	     class="org.apache.avalon.merlin.http.JettyWebServer"
 >>>           activation="startup">
 >>>  <context>
 >>>    <entry key="app.home">
 >>>      <constructor class="java.io.File">
 >>>	   /applications/merlin/
 >>>	 </constructor>
 >>>    </entry>
 >>>  </context>
 >>></component>

Can you change the entry key to "urn:avalon:home" in the meantime?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: [merlin] avalon-http + context

Posted by Jim Alateras <ji...@comware.com.au>.
> > Hi,
> >
> > I am using the avalon-http block but am having some trouble setting
the
> > app.home context entry. I have tried the following but it is not
being
> > picked up by the component.
> >
> > <component name="avalon-jetty"
> >  	     class="org.apache.avalon.merlin.http.JettyWebServer"
> >            activation="startup">
> >   <context>
> >     <entry key="app.home">
> >       <constructor class="java.io.File">
> > 	   /applications/merlin/
> > 	 </constructor>
> >     </entry>
> >   </context>
> > </component>
> >
> > Any ideas?
> 
> The JettyWebServer component looks for both app.home and
> urn:avalon:home.  Did you get the following warning message in your
log
> when you started merlin-http?
> 
> 'app.home' key not found in context; trying 'urn:avalon:home'
> 
> Ah... looking at the code...

that's correct

> 
> @avalon.entry key="urn:avalon:home" type="java.io.File"
> 
> is defined as a meta-tag in JettyWebServer's contextualize method.
> Being still somewhat of a newbie, I'm guessing that I might need to
add
> 
> @avalon.entry key="app.home" type="java.io.File"
> 
> as a meta-tag also.  Is this correct?
> 
> I'm checking for app.home being defined in code like this:
> 
> try {
>     home = (File) context.get("app.home");
> } catch (ContextException ce) {
>     // log a warning message here...
>     try {
>        home = (File) context.get("urn:avalon:home");
>     } catch (ContextException cex) {
>        // log a warning message here...
>     }
> }
> 
> Jim... Steve... someone help me out a little.  Do I need to add a
> meta-tag for app.home?
> 

sorry can't help here.... will dig a bit further and get back to you.

Cheers
</jima>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: [merlin] avalon-http + context

Posted by Timothy Bennett <ex...@comcast.net>.
Jim Alateras wrote:

> Hi,
> 
> I am using the avalon-http block but am having some trouble setting the
> app.home context entry. I have tried the following but it is not being
> picked up by the component.
> 
> <component name="avalon-jetty"
>  	     class="org.apache.avalon.merlin.http.JettyWebServer" 
>            activation="startup">
>   <context>
>     <entry key="app.home">
>       <constructor class="java.io.File"> 			  
> 	   /applications/merlin/
> 	 </constructor>
>     </entry>
>   </context>
> </component>
> 
> Any ideas?

The JettyWebServer component looks for both app.home and 
urn:avalon:home.  Did you get the following warning message in your log 
when you started merlin-http?

'app.home' key not found in context; trying 'urn:avalon:home'

Ah... looking at the code...

@avalon.entry key="urn:avalon:home" type="java.io.File"

is defined as a meta-tag in JettyWebServer's contextualize method. 
Being still somewhat of a newbie, I'm guessing that I might need to add

@avalon.entry key="app.home" type="java.io.File"

as a meta-tag also.  Is this correct?

I'm checking for app.home being defined in code like this:

try {
    home = (File) context.get("app.home");
} catch (ContextException ce) {
    // log a warning message here...
    try {
       home = (File) context.get("urn:avalon:home");
    } catch (ContextException cex) {
       // log a warning message here...
    }
}

Jim... Steve... someone help me out a little.  Do I need to add a 
meta-tag for app.home?

Timothy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org