|
From: Kopylenko, D. <dko...@ac...> - 2004-01-21 19:18:29
|
.... Or use FileSystemXmlApplicationContext
Regards,
Dmitriy.
-----Original Message-----
From: Colin Sampaleanu [mailto:col...@ex...]
Sent: Wednesday, January 21, 2004 1:09 PM
To: spr...@li...
Subject: Re: [Springframework-developer] ClassPathXmlApplicationContext
issue.
Pedro,
Spring does no manipulation of the classpath. It uses whatever classpath
is given to it; generally this is the current thread's context
classloader's classpath, as set by whatever environment it is in.
If there are two application context definition files with the same name
available on the classpath, then generally Spring will load whichever
one the classloader returns. If this behaviour is not acceptable, then
you have to have unique names...
Regards,
Colin
pedro.costa wrote:
>Hi all,
>
>I'm trying to load two different applicationContext xml file using
>ClassPathXmlApplicationContext.
>
>The files have the same name, but are on diferent class paths.
>
>What is happening is that it seams that spring is always finding the
>same file in both cases, regardless of the classpath that is used when
creating ClassPathXmlApplicationContext.
>
>I can see it from the logs.
>
>If i change the name of one of the files, it works fine.
>
>Is this a known problem?
>
>here is the code:
>
>ClassPathXmlApplicationContext appContext = new
>ClassPathXmlApplicationContext("replica/command/beans/beans.xml");
>
>BeansMappings beansMappings =
>(BeansMappings)appContext.getBean("serverCommandMappings");
>
>// no problem here ...
>
>ClassPathXmlApplicationContext appContext = new
>ClassPathXmlApplicationContext("replica/server/beans.xml");
>
> Listener listener = (Listener)appContext .getBean("serverListener");
>
>// Problem! it can't find it .... it seams to have loaded the first
>file again.
>
>// If i use a diferent file name,it works fine.
>
>
>
>thanks,
>
>Pedro.
>
>
>
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the
breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|