PDA

View Full Version : Eclipse Plugin Dev and loading AppContext - problem1



ahchiu
Nov 8th, 2004, 11:37 AM
I am developing a standalone application using eclipse as a rich client.
I tried many ways to load my application context .xml file, but could only succeed using FileSystemXmlApplicationContext, with which I have to use the whole filesystem path as input : "e:/workspace/com/xyz/myapplication/appContext.xml"

If I use


ClassPathResource res = new ClassPathResource("appContext.xml");
XmlBeanFactory factory = new XmlBeanFactory(res);


the error is:
java.io.FileNotFoundException: Could not open class path resource [appContext.xml]

Same thing happens even if I state the whole classpath:


ClassPathResource res = new ClassPathResource("com/xyz/myapplication/appContext.xml");
XmlBeanFactory factory = new XmlBeanFactory(res);

the error is:
java.io.FileNotFoundException: Could not open class path resource [com/xyz/myapplication/appContext.xml]

Please help!!

Torsten Juergeleit
Nov 8th, 2004, 04:28 PM
It seems that you are not alone with your classloader issues while using Spring within Eclipse :-(

Maybe you can find help in one of the other forums, e.g. http://forum.springframework.org/showthread.php?t=9581 or http://forum.springframework.org/showthread.php?t=9850

Spring IDE uses spring-core.jar only for parsing the Spring beans config files. No beans are instantiated - so no bean classloading happens in Spring IDE. Sorry, can't help with Eclipse classloading issues.

Cheers,
Torsten