File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes DI - Beginners Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "DI - Beginners Question" Watch "DI - Beginners Question" New topic
Author

DI - Beginners Question

Javier Montagna
Greenhorn

Joined: Apr 06, 2010
Posts: 8
Hi all, first of all sorry if this question was answer elsewhere I looked for it and found some similar examples but when I try to implement the solution (Found in this kind of post) I get an error message.

I am trying to use a really simple DI example, the configuration file does a few thing but the part that is causing problems is the following (I will erase everything but the part that is causing problems to keep it simple):

1)

2)

3)

The line in red is causing the following error:

I am trying to do this simple DI but is not finding the properties but I honestly don't know why, if someone could give me a hand i would be much appreciated.

Thanks in advanced and sorry for the nob question
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you try with lower-case property names, which would be the conventional, and correct approach?

It's also typical to name Java instance variables and Spring beans starting with a lower-case letter.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I agree with David. You have to do something about your naming convention. This not only looks awful, but it's also prone to errors. Check this document. These are only guidelines, but worth to follow.


[My Blog]
All roads lead to JavaRanch
Javier Montagna
Greenhorn

Joined: Apr 06, 2010
Posts: 8
Thanks for the Input, I follow the Convention display in the web site but the problem persists

Thank you for the replies.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Can you post the current configuration and code? Also try adding a getter (so it's a "real" property).
Javier Montagna
Greenhorn

Joined: Apr 06, 2010
Posts: 8
David Newton wrote:Can you post the current configuration and code? Also try adding a getter (so it's a "real" property).


I stand corrected :P ... I was missing an uppercase jeje, double check, fix the naming and now it works

Thanks again for the help :)

Have a great day
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: DI - Beginners Question
 
Similar Threads
Error while executing simple application with jdk1.5
org.springframework.beans.factory.BeanCreationException
Spring AOP HELP needed
Spring 2.5 - Transaction example
Getting Error in setting property values