JNDI classloader issues

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

JNDI classloader issues

mihobson
Hi there,

I'm using the jetty trunk with the m2 plugin to run my webapp.  I have
configured jetty.xml to put a project dependency's class into JNDI as
an env-entry.

The problem is that when the m2 plugin applies jetty.xml, the
org.mortbay.xml.XmlConfiguration uses the context classloader to
instantiate the env-entry class, which hasn't been set to accommodate
the project's dependencies in it's classpath.

To solve this we need the same classloader that is used by jetty at
runtime to be set as the context classloader during applyJettyXml(),
although this appears to be a chicken-and-egg situation as the webapp
classloader is generated from the configuration.

Anyone got any ideas on how best to patch this?

Cheers,

Mark


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JNDI classloader issues

jan_bartel
Mark,

Stuff that is configured in jetty.xml files is considered to be at the
level of the system classloader, so the classes referred to therein must
be in $JETTY_HOME/lib.  Therefore, the objects you want to put in JNDI
have move out of jars in your webapp into $JETTY_HOME/lib.

When running with the plugin, this means that the project dependency
should be put as a plugin dependency instead.

cheers
Jan

Mark Hobson wrote:

> Hi there,
>
> I'm using the jetty trunk with the m2 plugin to run my webapp.  I have
> configured jetty.xml to put a project dependency's class into JNDI as
> an env-entry.
>
> The problem is that when the m2 plugin applies jetty.xml, the
> org.mortbay.xml.XmlConfiguration uses the context classloader to
> instantiate the env-entry class, which hasn't been set to accommodate
> the project's dependencies in it's classpath.
>
> To solve this we need the same classloader that is used by jetty at
> runtime to be set as the context classloader during applyJettyXml(),
> although this appears to be a chicken-and-egg situation as the webapp
> classloader is generated from the configuration.
>
> Anyone got any ideas on how best to patch this?
>
> Cheers,
>
> Mark
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Re: JNDI classloader issues

mihobson
On 10/03/06, Jan Bartel <[hidden email]> wrote:
> Stuff that is configured in jetty.xml files is considered to be at the
> level of the system classloader, so the classes referred to therein must
> be in $JETTY_HOME/lib.  Therefore, the objects you want to put in JNDI
> have move out of jars in your webapp into $JETTY_HOME/lib.
>
> When running with the plugin, this means that the project dependency
> should be put as a plugin dependency instead.

Thanks for the reply Jan, but the problem with this solution is that
the class I want to put into JNDI also exists within the webapp
classpath itself.  This causes two versions of the same class to
co-exist - one loaded from the system classloader which sits in JNDI,
and the other loaded from webapp lib (due to webapp classloader lookup
strategy) which is used by the webapp.

Any suggestions on how to remedy this?

Cheers,

Mark


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JNDI classloader issues

jan_bartel
Mark,

You should be able to mark the project dependecy as <scope>provided</scope>,
which means it will be available for compilation, but won't be put into
WEB-INF/lib.

cheers
Jan


Mark Hobson wrote:

> On 10/03/06, Jan Bartel <[hidden email]> wrote:
>
>>Stuff that is configured in jetty.xml files is considered to be at the
>>level of the system classloader, so the classes referred to therein must
>>be in $JETTY_HOME/lib.  Therefore, the objects you want to put in JNDI
>>have move out of jars in your webapp into $JETTY_HOME/lib.
>>
>>When running with the plugin, this means that the project dependency
>>should be put as a plugin dependency instead.
>
>
> Thanks for the reply Jan, but the problem with this solution is that
> the class I want to put into JNDI also exists within the webapp
> classpath itself.  This causes two versions of the same class to
> co-exist - one loaded from the system classloader which sits in JNDI,
> and the other loaded from webapp lib (due to webapp classloader lookup
> strategy) which is used by the webapp.
>
> Any suggestions on how to remedy this?
>
> Cheers,
>
> Mark
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Re: JNDI classloader issues

mihobson
On 10/03/06, Jan Bartel <[hidden email]> wrote:
> You should be able to mark the project dependecy as <scope>provided</scope>,
> which means it will be available for compilation, but won't be put into
> WEB-INF/lib.

Thanks Jan, although the class I'm putting into JNDI requires
resources from the webapp.  It's a shame there's no easy way of
sharing the same classloader between objects in JNDI and the webapp?
This is how Tomcat's JNDI works.

Mark


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JNDI classloader issues

Greg Wilkins-5

Mark,

I've been chatting to Jan about the best way to achieve this.

I think we might consider adding support for a
WEB-INF/jetty-env.xml file.

This file would be a jetty.xml style configuration file,
but it would only have access to the JNDI Context object for
the web context.   It would be executed after the JNDI
context object is created, but before the web.xml is handled.

This will allow web context specific entries to be bound into
the JNDI context using the contexts classloader.

Does that sound like a workable solution for you?

cheers



Mark Hobson wrote:

> On 10/03/06, Jan Bartel <[hidden email]> wrote:
>
>>You should be able to mark the project dependecy as <scope>provided</scope>,
>>which means it will be available for compilation, but won't be put into
>>WEB-INF/lib.
>
>
> Thanks Jan, although the class I'm putting into JNDI requires
> resources from the webapp.  It's a shame there's no easy way of
> sharing the same classloader between objects in JNDI and the webapp?
> This is how Tomcat's JNDI works.
>
> Mark
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JNDI classloader issues

mihobson
Hi Greg,

That would certainly work for my use-case.  If you could squeeze this
into Jetty6 then that'd be great thanks.

Cheers,

Mark

On 11/03/06, Greg Wilkins <[hidden email]> wrote:

>
> Mark,
>
> I've been chatting to Jan about the best way to achieve this.
>
> I think we might consider adding support for a
> WEB-INF/jetty-env.xml file.
>
> This file would be a jetty.xml style configuration file,
> but it would only have access to the JNDI Context object for
> the web context.   It would be executed after the JNDI
> context object is created, but before the web.xml is handled.
>
> This will allow web context specific entries to be bound into
> the JNDI context using the contexts classloader.
>
> Does that sound like a workable solution for you?
>
> cheers
>
>
>
> Mark Hobson wrote:
> > On 10/03/06, Jan Bartel <[hidden email]> wrote:
> >
> >>You should be able to mark the project dependecy as <scope>provided</scope>,
> >>which means it will be available for compilation, but won't be put into
> >>WEB-INF/lib.
> >
> >
> > Thanks Jan, although the class I'm putting into JNDI requires
> > resources from the webapp.  It's a shame there's no easy way of
> > sharing the same classloader between objects in JNDI and the webapp?
> > This is how Tomcat's JNDI works.
> >
> > Mark
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > that extends applications into web and mobile media. Attend the live webcast
> > and join the prime developer group breaking into this new coding territory!
> > <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> > _______________________________________________
> > Jetty-support mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/jetty-support
> >
>
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JNDI classloader issues

jan_bartel
Mark,

FYI for beta11, I've added the ability to have a jetty-env.xml
file in WEB-INF that has JNDI entries in it that will be
specific to that web application. Note that as per normal,
you must reference those JNDI entries in your web.xml file
for them to appear in the webapp's java:comp/env (actually
that's not totally true of EnvEntries, but I won't go into
that right now).

Here's a quick example of a jetty-env.xml file:

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

<Configure class="org.mortbay.jetty.webapp.WebAppContext">

  <!-- Add an EnvEntry only valid for this webapp               -->
  <New id="gargle"  class="org.mortbay.jetty.plus.naming.EnvEntry">
    <Arg>gargle</Arg>
    <Arg type="java.lang.Double">100</Arg>
    <Arg type="boolean">true</Arg>
  </New>


  <!-- Add a DataSource only valid for this webapp                     -->
  <New id="mydatasource99" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/mydatasource99</Arg>
    <Arg>
     <New class="com.atomikos.jdbc.SimpleDataSourceBean">
      <Set name="xaDataSourceClassName">org.apache.derby.jdbc.EmbeddedXADataSource</Set>
      <Set name="xaDataSourceProperties">databaseName=testdb99;createDatabase=create</Set>
      <Set name="UniqueResourceName">mydatasource99</Set></New>
    </Arg>
   </New>

</Configure>

Let me know how you get on with this.

cheers
Jan


Mark Hobson wrote:

> Hi Greg,
>
> That would certainly work for my use-case.  If you could squeeze this
> into Jetty6 then that'd be great thanks.
>
> Cheers,
>
> Mark
>
> On 11/03/06, Greg Wilkins <[hidden email]> wrote:
>
>>Mark,
>>
>>I've been chatting to Jan about the best way to achieve this.
>>
>>I think we might consider adding support for a
>>WEB-INF/jetty-env.xml file.
>>
>>This file would be a jetty.xml style configuration file,
>>but it would only have access to the JNDI Context object for
>>the web context.   It would be executed after the JNDI
>>context object is created, but before the web.xml is handled.
>>
>>This will allow web context specific entries to be bound into
>>the JNDI context using the contexts classloader.
>>
>>Does that sound like a workable solution for you?
>>
>>cheers
>>
>>
>>
>>Mark Hobson wrote:
>>
>>>On 10/03/06, Jan Bartel <[hidden email]> wrote:
>>>
>>>
>>>>You should be able to mark the project dependecy as <scope>provided</scope>,
>>>>which means it will be available for compilation, but won't be put into
>>>>WEB-INF/lib.
>>>
>>>
>>>Thanks Jan, although the class I'm putting into JNDI requires
>>>resources from the webapp.  It's a shame there's no easy way of
>>>sharing the same classloader between objects in JNDI and the webapp?
>>>This is how Tomcat's JNDI works.
>>>
>>>Mark
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
>>>that extends applications into web and mobile media. Attend the live webcast
>>>and join the prime developer group breaking into this new coding territory!
>>><a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support
>>>
>>
>>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Re: JNDI classloader issues

Ceki Gulcu-2

I apologize for the interruption, but could it be possible to explain how
Jetty supports JNDI/EnvEntries? In particular, does one need to add a JNDI
provider to Jetty? If my memory serves me correctly, previous versions of
Jetty required jetty-plus for JNDI support. Is this still the case? I hope
I am not too off base with my question.

At 10:20 PM 3/14/2006, Jan Bartel wrote:

>Mark,
>
>FYI for beta11, I've added the ability to have a jetty-env.xml file in
>WEB-INF that has JNDI entries in it that will be specific to that web
>application. Note that as per normal,
>you must reference those JNDI entries in your web.xml file
>for them to appear in the webapp's java:comp/env (actually
>that's not totally true of EnvEntries, but I won't go into
>that right now).
>
>Here's a quick example of a jetty-env.xml file:

[snip]


--
Ceki Gülcü
http://ceki.blogspot.com/



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: JNDI classloader issues

jan_bartel
Hi Ceki,

jetty6 has a JNDI implementation available in the jetty-naming.jar
which is used to support java:comp/env in the jetty-plus.jar. It
is a lot simpler to configure than in jetty5.

Here's the docs on it so far, which I will be updating with the
newest jetty-env.xml functionality:

http://docs.codehaus.org/display/JETTY/JNDI

cheers
Jan

Ceki Gülcü wrote:

>
> I apologize for the interruption, but could it be possible to explain
> how Jetty supports JNDI/EnvEntries? In particular, does one need to add
> a JNDI provider to Jetty? If my memory serves me correctly, previous
> versions of Jetty required jetty-plus for JNDI support. Is this still
> the case? I hope I am not too off base with my question.
>
> At 10:20 PM 3/14/2006, Jan Bartel wrote:
>
>> Mark,
>>
>> FYI for beta11, I've added the ability to have a jetty-env.xml file in
>> WEB-INF that has JNDI entries in it that will be specific to that web
>> application. Note that as per normal,
>> you must reference those JNDI entries in your web.xml file
>> for them to appear in the webapp's java:comp/env (actually
>> that's not totally true of EnvEntries, but I won't go into
>> that right now).
>>
>> Here's a quick example of a jetty-env.xml file:
>
>
> [snip]
>
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

unsubscribe

Hahne, Ronald
 

winmail.dat (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: JNDI classloader issues

mihobson
In reply to this post by jan_bartel
Hi Jan,

I did see that thanks and gave it a go yesterday.  It all works great,
apart from there appears to be a problem with reloading a context that
uses jetty-env.xml.  I've got a reproducable test-case here - do you
want me to send it to the list or raise a jira?

Cheers,

Mark

On 14/03/06, Jan Bartel <[hidden email]> wrote:

> Mark,
>
> FYI for beta11, I've added the ability to have a jetty-env.xml
> file in WEB-INF that has JNDI entries in it that will be
> specific to that web application. Note that as per normal,
> you must reference those JNDI entries in your web.xml file
> for them to appear in the webapp's java:comp/env (actually
> that's not totally true of EnvEntries, but I won't go into
> that right now).
>
> Here's a quick example of a jetty-env.xml file:
>
> <?xml version="1.0"?>
> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
>
> <Configure class="org.mortbay.jetty.webapp.WebAppContext">
>
>   <!-- Add an EnvEntry only valid for this webapp               -->
>   <New id="gargle"  class="org.mortbay.jetty.plus.naming.EnvEntry">
>     <Arg>gargle</Arg>
>     <Arg type="java.lang.Double">100</Arg>
>     <Arg type="boolean">true</Arg>
>   </New>
>
>
>   <!-- Add a DataSource only valid for this webapp                     -->
>   <New id="mydatasource99" class="org.mortbay.jetty.plus.naming.Resource">
>     <Arg>jdbc/mydatasource99</Arg>
>     <Arg>
>      <New class="com.atomikos.jdbc.SimpleDataSourceBean">
>       <Set name="xaDataSourceClassName">org.apache.derby.jdbc.EmbeddedXADataSource</Set>
>       <Set name="xaDataSourceProperties">databaseName=testdb99;createDatabase=create</Set>
>       <Set name="UniqueResourceName">mydatasource99</Set></New>
>     </Arg>
>    </New>
>
> </Configure>
>
> Let me know how you get on with this.
>
> cheers
> Jan
>
>
> Mark Hobson wrote:
> > Hi Greg,
> >
> > That would certainly work for my use-case.  If you could squeeze this
> > into Jetty6 then that'd be great thanks.
> >
> > Cheers,
> >
> > Mark
> >
> > On 11/03/06, Greg Wilkins <[hidden email]> wrote:
> >
> >>Mark,
> >>
> >>I've been chatting to Jan about the best way to achieve this.
> >>
> >>I think we might consider adding support for a
> >>WEB-INF/jetty-env.xml file.
> >>
> >>This file would be a jetty.xml style configuration file,
> >>but it would only have access to the JNDI Context object for
> >>the web context.   It would be executed after the JNDI
> >>context object is created, but before the web.xml is handled.
> >>
> >>This will allow web context specific entries to be bound into
> >>the JNDI context using the contexts classloader.
> >>
> >>Does that sound like a workable solution for you?
> >>
> >>cheers
> >>
> >>
> >>
> >>Mark Hobson wrote:
> >>
> >>>On 10/03/06, Jan Bartel <[hidden email]> wrote:
> >>>
> >>>
> >>>>You should be able to mark the project dependecy as <scope>provided</scope>,
> >>>>which means it will be available for compilation, but won't be put into
> >>>>WEB-INF/lib.
> >>>
> >>>
> >>>Thanks Jan, although the class I'm putting into JNDI requires
> >>>resources from the webapp.  It's a shame there's no easy way of
> >>>sharing the same classloader between objects in JNDI and the webapp?
> >>>This is how Tomcat's JNDI works.
> >>>
> >>>Mark
> >>>
> >>>
> >>>-------------------------------------------------------
> >>>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> >>>that extends applications into web and mobile media. Attend the live webcast
> >>>and join the prime developer group breaking into this new coding territory!
> >>><a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> >>>_______________________________________________
> >>>Jetty-support mailing list
> >>>[hidden email]
> >>>https://lists.sourceforge.net/lists/listinfo/jetty-support
> >>>
> >>
> >>
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > that extends applications into web and mobile media. Attend the live webcast
> > and join the prime developer group breaking into this new coding territory!
> > <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> > _______________________________________________
> > Jetty-support mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/jetty-support
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Re: JNDI classloader issues

mihobson
See http://jira.codehaus.org/browse/JETTY-27

Mark

On 15/03/06, Mark Hobson <[hidden email]> wrote:

> Hi Jan,
>
> I did see that thanks and gave it a go yesterday.  It all works great,
> apart from there appears to be a problem with reloading a context that
> uses jetty-env.xml.  I've got a reproducable test-case here - do you
> want me to send it to the list or raise a jira?
>
> Cheers,
>
> Mark
>
> On 14/03/06, Jan Bartel <[hidden email]> wrote:
> > Mark,
> >
> > FYI for beta11, I've added the ability to have a jetty-env.xml
> > file in WEB-INF that has JNDI entries in it that will be
> > specific to that web application. Note that as per normal,
> > you must reference those JNDI entries in your web.xml file
> > for them to appear in the webapp's java:comp/env (actually
> > that's not totally true of EnvEntries, but I won't go into
> > that right now).
> >
> > Here's a quick example of a jetty-env.xml file:
> >
> > <?xml version="1.0"?>
> > <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
> >
> > <Configure class="org.mortbay.jetty.webapp.WebAppContext">
> >
> >   <!-- Add an EnvEntry only valid for this webapp               -->
> >   <New id="gargle"  class="org.mortbay.jetty.plus.naming.EnvEntry">
> >     <Arg>gargle</Arg>
> >     <Arg type="java.lang.Double">100</Arg>
> >     <Arg type="boolean">true</Arg>
> >   </New>
> >
> >
> >   <!-- Add a DataSource only valid for this webapp                     -->
> >   <New id="mydatasource99" class="org.mortbay.jetty.plus.naming.Resource">
> >     <Arg>jdbc/mydatasource99</Arg>
> >     <Arg>
> >      <New class="com.atomikos.jdbc.SimpleDataSourceBean">
> >       <Set name="xaDataSourceClassName">org.apache.derby.jdbc.EmbeddedXADataSource</Set>
> >       <Set name="xaDataSourceProperties">databaseName=testdb99;createDatabase=create</Set>
> >       <Set name="UniqueResourceName">mydatasource99</Set></New>
> >     </Arg>
> >    </New>
> >
> > </Configure>
> >
> > Let me know how you get on with this.
> >
> > cheers
> > Jan
> >
> >
> > Mark Hobson wrote:
> > > Hi Greg,
> > >
> > > That would certainly work for my use-case.  If you could squeeze this
> > > into Jetty6 then that'd be great thanks.
> > >
> > > Cheers,
> > >
> > > Mark
> > >
> > > On 11/03/06, Greg Wilkins <[hidden email]> wrote:
> > >
> > >>Mark,
> > >>
> > >>I've been chatting to Jan about the best way to achieve this.
> > >>
> > >>I think we might consider adding support for a
> > >>WEB-INF/jetty-env.xml file.
> > >>
> > >>This file would be a jetty.xml style configuration file,
> > >>but it would only have access to the JNDI Context object for
> > >>the web context.   It would be executed after the JNDI
> > >>context object is created, but before the web.xml is handled.
> > >>
> > >>This will allow web context specific entries to be bound into
> > >>the JNDI context using the contexts classloader.
> > >>
> > >>Does that sound like a workable solution for you?
> > >>
> > >>cheers
> > >>
> > >>
> > >>
> > >>Mark Hobson wrote:
> > >>
> > >>>On 10/03/06, Jan Bartel <[hidden email]> wrote:
> > >>>
> > >>>
> > >>>>You should be able to mark the project dependecy as <scope>provided</scope>,
> > >>>>which means it will be available for compilation, but won't be put into
> > >>>>WEB-INF/lib.
> > >>>
> > >>>
> > >>>Thanks Jan, although the class I'm putting into JNDI requires
> > >>>resources from the webapp.  It's a shame there's no easy way of
> > >>>sharing the same classloader between objects in JNDI and the webapp?
> > >>>This is how Tomcat's JNDI works.
> > >>>
> > >>>Mark
> > >>>
> > >>>
> > >>>-------------------------------------------------------
> > >>>This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > >>>that extends applications into web and mobile media. Attend the live webcast
> > >>>and join the prime developer group breaking into this new coding territory!
> > >>><a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> > >>>_______________________________________________
> > >>>Jetty-support mailing list
> > >>>[hidden email]
> > >>>https://lists.sourceforge.net/lists/listinfo/jetty-support
> > >>>
> > >>
> > >>
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > > that extends applications into web and mobile media. Attend the live webcast
> > > and join the prime developer group breaking into this new coding territory!
> > > <a href="http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
> > > _______________________________________________
> > > Jetty-support mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/jetty-support
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > that extends applications into web and mobile media. Attend the live webcast
> > and join the prime developer group breaking into this new coding territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> > _______________________________________________
> > Jetty-support mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/jetty-support
> >
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support