This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes class path resource [spring xml file] cannot be opened Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "class path resource [spring xml file] cannot be opened" Watch "class path resource [spring xml file] cannot be opened" New topic
Author

class path resource [spring xml file] cannot be opened

sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186
hai, i have just started learning things in spring, the following is the program i am trying to execute in eclipse


//program 1



//program 2



//program 3-spring xml




but when i am doing right click on democlient.java and run as -> java application the i am getting the following error , what should i do? where have i gone i am unable to undrstand. please help me.

I have added spring.jar and commons-logging.jar, by the way i am also new to eclipse. but whatever i have done is correct i think.


"SCJP5 | SCWCD5| DEVELOPER"
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The config file doesn't exist on the classpath, just like the error msg says.
sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186
David Newton wrote:The config file doesn't exist on the classpath, just like the error msg says.



thank you david, but i kept the demo.xml file in the package "sample", but still i don't understand where this error is creeping from .
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Have you tried "sample/demo.xml"?


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186
but i kept the demo.xml file in the package "sample"


that's what i said in the previous reply. i kept demo.xml in sample package ie., sample/demo.xml. but no use.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Is it being deployed?
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
sasank manohar wrote:
but i kept the demo.xml file in the package "sample"


that's what i said in the previous reply. i kept demo.xml in sample package ie., sample/demo.xml. but no use.

You should use "sample/demo.xml", not "demo.xml" because demo.xml is in the sample package.
Do you understand what I mean?
sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186
david, i didnot deploy this. i am not using any container, as it internally uses spring container.

yes, i understood kengkaj , i changed the code to this



but i am still getting the following error




is my dtd ok? i think nothing concerned about dtd coming in error right?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The bean definition requires the fully-qualified class name of the implementation: you left off the package.
sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186
thank you all, its working.

in DemoClient.java,




in Demo.xml file,




the above are the changes , i have made.and the code worked. now, i can carryon with my quest with springs. thank you.>
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Congrats. Thanks for the update.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class path resource [spring xml file] cannot be opened
 
Similar Threads
xml bean injection - error - netbeans 6.5
Issue with XMLBeanFactory
spring inside eclipse
Configuration Issues with Spring Framework on eclipse
[beans.xml] cannot be opened because it does not exist