geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Possible class path class loader problem when using Spring ClassPathXmlApplicationContext class
Date Wed, 21 Sep 2005 10:52:13 GMT
I have an application that uses Spring to interface with Hibernate, which 
in turn accesses data via JDBC.

In Spring you can define a configuration file (applicationContext.xm) and 
embed it in your class structure, at the package level, like so


I have a class that loads up this configuration file, using the Spring 
ClassPathXmlApplicationContext class:

static final ApplicationContext springApplicationContext = new 

This code effectivley loads the application context from the classpath, 
and as my class that calls the above line of code is in the package

then by rights the applicationContext.xml should be in the classpath as 
well, as its at the same level in the package hierarchy as the class 
trying to load it.

The javadoc for the Spring class is here

This all works fine in Websphere 5.1. When I export my EAR from WSAD and 
try and deploy it into Geronimo I get the stack trace below. This implies 
to me that the classpath is somehow different to what it shuld be, but how 
can this be ? If the class running is

then how come it cannot find the resource


in the class path ? Is there some difference in how classpaths or 
classlaoding is handled between Websphere 5.1 and Geronimo ?

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: 
IOException parsing XML document from class path resource 
[net/targetgroup/broker/hibernate/applicationContext.xml]; nested 
exception is class path resource 
[net/targetgroup/broker/hibernate/applicationContext.xml] cannot be opened 
because it does not exist
        ... 7

Paul Newport
Systems Consultant
Tel:  +44  (0) 117 917 0600
Fax: +44 (0) 117 917 0660


This message is intended only for the use of the Addressee and may
contain information that is PRIVILEGED and CONFIDENTIAL. 
If you are not the intended recipient you must not copy, 
distribute or take any action or reliance upon it. 
The content of this message may also contain personal 
views of an employee of this company and does
not necessarily represent the view of the company.
This message has been scanned by Norton Anti-Virus. 
It has also been scanned by MAILsweeper to enforce our e-mail 
policy. If you have any concerns or comments about the content 
of this message, please  e-mail

This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
View raw message