You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Julio S. G." <ju...@gmail.com> on 2007/05/16 00:49:48 UTC
[chain] Can't load class resource.
Hi,
I have a web application running in jetty server and I'm trying to
load the chain configuration just like all the docs available, but it
isn't working.
My web.xml contains:
<context-param>
<param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
<param-value>file:/C:/chain-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.apache.commons.chain.web.ChainListener</listener-class>
</listener>
Debugging the source code I could see that the class loader is :
ClassLoader loader = Thread.currentThread().getContextClassLoader();
This loader is got from my web container thread
(org.mortbay.jetty.webapp.WebAppClassLoader) and this seems to be the
problem because the root directory of this loader is my web
application root directory, and unfortunately the syntax "file:/"
isn't working.
Do you have any clue to solve it?
Thanks.
Julio
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [chain] Can't load class resource.
Posted by Niall Pemberton <ni...@gmail.com>.
On 6/29/07, Julio S. G. <ju...@gmail.com> wrote:
> Great. I did the changes and made a patch. As I read at the "How to Get
> Involved" section, it seems to me that it's just to send a attched file. Is
> it correct? Who will apply the patch at main trunk?
>
> Thanks,
>
> Julio
>
>
> On 5/15/07, Niall Pemberton <ni...@gmail.com> wrote:
> >
> > On 5/15/07, Julio S. G. <ju...@gmail.com> wrote:
> > > Hi,
> > >
> > > I have a web application running in jetty server and I'm trying to
> > > load the chain configuration just like all the docs available, but it
> > > isn't working.
> > > My web.xml contains:
> > >
> > > <context-param>
> > > <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE
> > </param-name>
> > > <param-value>file:/C:/chain-config.xml</param-value>
> > > </context-param>
> > >
> > > <listener>
> > > <listener-class>org.apache.commons.chain.web.ChainListener
> > </listener-class>
> > > </listener>
> > >
> > > Debugging the source code I could see that the class loader is :
> > >
> > > ClassLoader loader = Thread.currentThread().getContextClassLoader();
> > >
> > > This loader is got from my web container thread
> > > (org.mortbay.jetty.webapp.WebAppClassLoader) and this seems to be the
> > > problem because the root directory of this loader is my web
> > > application root directory, and unfortunately the syntax "file:/"
> > > isn't working.
> > >
> > > Do you have any clue to solve it?
> >
> > Either you package up the chain config as part of your webapp or write
> > your own listener implementation to load them from an external file.
> > If you want Chain to provide that facilitliy then you could create a
> > Jira request - providing patches and tests would make it more likely
> > to be applied.
Its best to create an issue ticket and attach your patch to that:
http://jakarta.apache.org/commons/chain/issue-tracking.html
Niall
> > Niall
> >
> > > Thanks.
> > >
> > > Julio
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [chain] Can't load class resource.
Posted by "Julio S. G." <ju...@gmail.com>.
Great. I did the changes and made a patch. As I read at the "How to Get
Involved" section, it seems to me that it's just to send a attched file. Is
it correct? Who will apply the patch at main trunk?
Thanks,
Julio
On 5/15/07, Niall Pemberton <ni...@gmail.com> wrote:
>
> On 5/15/07, Julio S. G. <ju...@gmail.com> wrote:
> > Hi,
> >
> > I have a web application running in jetty server and I'm trying to
> > load the chain configuration just like all the docs available, but it
> > isn't working.
> > My web.xml contains:
> >
> > <context-param>
> > <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE
> </param-name>
> > <param-value>file:/C:/chain-config.xml</param-value>
> > </context-param>
> >
> > <listener>
> > <listener-class>org.apache.commons.chain.web.ChainListener
> </listener-class>
> > </listener>
> >
> > Debugging the source code I could see that the class loader is :
> >
> > ClassLoader loader = Thread.currentThread().getContextClassLoader();
> >
> > This loader is got from my web container thread
> > (org.mortbay.jetty.webapp.WebAppClassLoader) and this seems to be the
> > problem because the root directory of this loader is my web
> > application root directory, and unfortunately the syntax "file:/"
> > isn't working.
> >
> > Do you have any clue to solve it?
>
> Either you package up the chain config as part of your webapp or write
> your own listener implementation to load them from an external file.
> If you want Chain to provide that facilitliy then you could create a
> Jira request - providing patches and tests would make it more likely
> to be applied.
>
> Niall
>
> > Thanks.
> >
> > Julio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
Re: [chain] Can't load class resource.
Posted by Niall Pemberton <ni...@gmail.com>.
On 5/15/07, Julio S. G. <ju...@gmail.com> wrote:
> Hi,
>
> I have a web application running in jetty server and I'm trying to
> load the chain configuration just like all the docs available, but it
> isn't working.
> My web.xml contains:
>
> <context-param>
> <param-name>org.apache.commons.chain.CONFIG_CLASS_RESOURCE</param-name>
> <param-value>file:/C:/chain-config.xml</param-value>
> </context-param>
>
> <listener>
> <listener-class>org.apache.commons.chain.web.ChainListener</listener-class>
> </listener>
>
> Debugging the source code I could see that the class loader is :
>
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
>
> This loader is got from my web container thread
> (org.mortbay.jetty.webapp.WebAppClassLoader) and this seems to be the
> problem because the root directory of this loader is my web
> application root directory, and unfortunately the syntax "file:/"
> isn't working.
>
> Do you have any clue to solve it?
Either you package up the chain config as part of your webapp or write
your own listener implementation to load them from an external file.
If you want Chain to provide that facilitliy then you could create a
Jira request - providing patches and tests would make it more likely
to be applied.
Niall
> Thanks.
>
> Julio
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org