users
[Top] [All Lists]

Re: [cinjug-users] Loading Spring Application Context Bean Factory from

To: John Olmstead <jolmstead2k@xxxxxxxxx>, users@xxxxxxxxxx
Subject: Re: [cinjug-users] Loading Spring Application Context Bean Factory from inside a jar file.
From: Brian Bonner <brian.bonner@xxxxxxxxxxxx>
Date: Thu, 15 Dec 2005 00:44:51 +0100
Delivered-to: mailing list users@cinjug.org
In-reply-to: <20051214204653.66150.qmail@web54309.mail.yahoo.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <20051214204653.66150.qmail@web54309.mail.yahoo.com>
Reply-to: Brian Bonner <brian.bonner@xxxxxxxxxxxx>
John, try:

ctx = new ClassPathXmlApplicationContext("/conf/applicationContext.xml");

Brian

On Wed, 14 Dec 2005 11:44 pm, John Olmstead wrote:
Gentlemen;

I have developed a standalone java app that uses Spring for its persistence management layer.
The classloader will not load the application context using Springs
ClassPathXmlApplicationContext class intended for this purpose. All of the unit tests
performed on this app pass. I have tried multiple variations of the following:


ApplicationContext

ctx = new ClassPathXmlApplicationContext("classpath*:conf/applicationContext.xml"); //This
loads the context with 0 bean definitions.


String[] paths = {"/conf/applicationContext.xml"};
or
paths = {"/applicationContext.xml"};
ctx = new ClassPathXmlApplicationContext(paths); //This results in a FileNotFound Exception
thrown and occurs whether or not I place the resource in the root or a sub directory.


I'm stumped. Don't know what else to try. Any suggestions would be appreciated and my
apologies if I missed something trivial.


By the way, the resource xml file is correctly bundled in the jar.

Thanks;

John Olmstead




John Olmstead jolmstead2k@xxxxxxxxx

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx
- Brian (mobile)

<Prev in Thread] Current Thread [Next in Thread>