R Bab

Greenhorn
+ Follow
since Jan 19, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by R Bab

Thanks for your reply. That was my bad and I made the typo while posting. In the actual code I still refer the dir as conf


Larry Chung wrote:I can help with question 1 at least.

Notice that in your project tree folder structure, there is a folder called "config":

R Bab wrote:
project->src->java
com.x.y.Hello.java
project->src->config
beans.xml



For your code to work, the folder's name should be refactored to "conf". Be sure to put beans.xml in the conf folder.



14 years ago
Hi,
My question is similar to https://coderanch.com/t/424153/Spring/Application-Frameworks/beans-xml-cannot-opened-because

I kinda know the answer in one way but still could not figure out the way I expect

I have folder structure as follows.

project->src->java
com.x.y.Hello.java
project->src->conf
beans.xml

Code looks like,



Exception:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [conf/beans.xml]; nested exception is java.io.FileNotFoundException: class path resource [conf/beans.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)


So I have tried few other combinations:


but nothing works.

So I have changed the folder structure to

project->src->
com.x.y.Hello.java
project->src->
beans.xml

ofcourse everything works!

But I do not want to compromise the folder structure.

1) So how to add conf/beans.xml into the classpath so that ClassPathXmlApplicationContext can resolve it.

2) Also how do I find out list of class paths loaded by ClassPathXmlApplicationContext?

I use spring 2.5.x and I thought I will use like,



Now I run into
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'hello' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)

3) If I see the above error that means the beans.xml is found but not the bean 'hello' correct? If so, how to resolve this?

Any help is appreciated. Thanks.
14 years ago
Hi,
If I take the exam in Apr 2009, is still the exam objective is as same as 1.4?

Is reading 1 book (HFSJ) and few mockup exam are enough?

I have taken SCJP 1.5 more than a year ago and do I need to refresh Java1.5 w.r.t SCWCD1.5?

Thanks.