You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephane Decleire <sd...@cariboo-networks.com> on 2006/04/24 23:40:35 UTC

Spring applicationContext in library

Hi,

I have a library wich used Spring to link Tapestry component to 
Hibernate backend.
When I use this library in my application which also use Spring, my 
application applicationContext file is used by the library instead of 
its applicationContext ...
Any idea ???

Thanks in advance.

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: Spring applicationContext in library

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Yea it helps !
That works great. Thanks Eric.

Eric Fesler wrote:

>I guess you should have a ContextLoaderListener setup in your WEB-INF/web.xml 
>file.
>
>It it's the case, then you should add the following context parameter in your 
>web.xml
>
><context-param>
>	    <param-name>contextConfigLocation</param-name>
>	    <param-value>
>		classpath*:META-INF/applicationContext.xml
>	     	/WEB-INF/applicationContext.xml</param-value>
>	</context-param>
>
>providing your library applicationContext is named applicationContext.xml and 
>is located in the META-INF directory embedded in the JAR file.
>
>This configuration will tell Spring to parse both the jar included 
>applicationContext.xml and the applicationContext.xml file located in you web 
>application WEB-INF directory.
>
>Hope it helps.
>
>--ERic
>
>
>On Tuesday 25 April 2006 09:48, Stephane Decleire wrote:
>  
>
>>You've understood my configuration.
>>I've tried to rename the applicationContext file with no results.
>>It looks like this file is never parsed ...
>>
>>Mark wrote:
>>    
>>
>>>I'm not sure if I understand this... Do you have your library as a jar
>>>file (your-lib.jar) and in there an applicationContext.xml?
>>>And then another applicationContext.xml in your webapp classpath?
>>>If so, then I guess your xml file in the jar gets overwritten by the
>>>one in the webapp.
>>>I guess you should name the one in the library jar differently, e.g.
>>>"my-lib-applicationContext.xml" so you will not run into conflicts
>>>like this one...
>>>
>>>MARK
>>>
>>>Stephane Decleire wrote:
>>>      
>>>
>>>>Hi,
>>>>
>>>>I have a library wich used Spring to link Tapestry component to
>>>>Hibernate backend.
>>>>When I use this library in my application which also use Spring, my
>>>>application applicationContext file is used by the library instead of
>>>>its applicationContext ...
>>>>Any idea ???
>>>>
>>>>Thanks in advance.
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>      
>>>
>
>  
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: Spring applicationContext in library

Posted by Eric Fesler <er...@audaxis.com>.
I guess you should have a ContextLoaderListener setup in your WEB-INF/web.xml 
file.

It it's the case, then you should add the following context parameter in your 
web.xml

<context-param>
	    <param-name>contextConfigLocation</param-name>
	    <param-value>
		classpath*:META-INF/applicationContext.xml
	     	/WEB-INF/applicationContext.xml</param-value>
	</context-param>

providing your library applicationContext is named applicationContext.xml and 
is located in the META-INF directory embedded in the JAR file.

This configuration will tell Spring to parse both the jar included 
applicationContext.xml and the applicationContext.xml file located in you web 
application WEB-INF directory.

Hope it helps.

--ERic


On Tuesday 25 April 2006 09:48, Stephane Decleire wrote:
> You've understood my configuration.
> I've tried to rename the applicationContext file with no results.
> It looks like this file is never parsed ...
>
> Mark wrote:
> > I'm not sure if I understand this... Do you have your library as a jar
> > file (your-lib.jar) and in there an applicationContext.xml?
> > And then another applicationContext.xml in your webapp classpath?
> > If so, then I guess your xml file in the jar gets overwritten by the
> > one in the webapp.
> > I guess you should name the one in the library jar differently, e.g.
> > "my-lib-applicationContext.xml" so you will not run into conflicts
> > like this one...
> >
> > MARK
> >
> > Stephane Decleire wrote:
> >> Hi,
> >>
> >> I have a library wich used Spring to link Tapestry component to
> >> Hibernate backend.
> >> When I use this library in my application which also use Spring, my
> >> application applicationContext file is used by the library instead of
> >> its applicationContext ...
> >> Any idea ???
> >>
> >> Thanks in advance.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

-- 
Eric Fesler
Technical Director
-------------------------------------------------------------------
 Audaxis S.A.
 Tel: +32 (0)2 361.83.01 
 Fax: +32 (0)2 361.83.11 
 Mob: +32 (0)478 22.90.78 
 http://www.audaxis.com
 
 PGP Fingerprint : FECF 2841 48B7 47D8 C426 55A4 0A60 FB52 833B 1EF1
 Public PGP key  : available at server subkeys.pgp.net
-------------------------------------------------------------------

You have a strong desire for a home and your family interests come first.

Re: Spring applicationContext in library

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
You've understood my configuration.
I've tried to rename the applicationContext file with no results.
It looks like this file is never parsed ...

Mark wrote:

> I'm not sure if I understand this... Do you have your library as a jar 
> file (your-lib.jar) and in there an applicationContext.xml?
> And then another applicationContext.xml in your webapp classpath?
> If so, then I guess your xml file in the jar gets overwritten by the 
> one in the webapp.
> I guess you should name the one in the library jar differently, e.g. 
> "my-lib-applicationContext.xml" so you will not run into conflicts 
> like this one...
>
> MARK
>
>
> Stephane Decleire wrote:
>
>> Hi,
>>
>> I have a library wich used Spring to link Tapestry component to 
>> Hibernate backend.
>> When I use this library in my application which also use Spring, my 
>> application applicationContext file is used by the library instead of 
>> its applicationContext ...
>> Any idea ???
>>
>> Thanks in advance.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: Spring applicationContext in library

Posted by Mark <li...@mark-arnold.net>.
I'm not sure if I understand this... Do you have your library as a jar 
file (your-lib.jar) and in there an applicationContext.xml?
And then another applicationContext.xml in your webapp classpath?
If so, then I guess your xml file in the jar gets overwritten by the one 
in the webapp.
I guess you should name the one in the library jar differently, e.g. 
"my-lib-applicationContext.xml" so you will not run into conflicts like 
this one...

MARK


Stephane Decleire wrote:
> Hi,
>
> I have a library wich used Spring to link Tapestry component to 
> Hibernate backend.
> When I use this library in my application which also use Spring, my 
> application applicationContext file is used by the library instead of 
> its applicationContext ...
> Any idea ???
>
> Thanks in advance.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org