Meaningless Drivel is fun!*
The moose likes Spring and the fly likes Setter DI for the bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Setter DI for the bean" Watch "Setter DI for the bean" New topic
Author

Setter DI for the bean

sarma kiran
Ranch Hand

Joined: Jul 17, 2008
Posts: 30
Hi,
Is is possible to provide setter Injection for the bean which has static factory method?

Actually i am trying for setter injection in the bean, its showing error " No setter method found for num in java.lang.String" in configuaration file.

Can any one help me?




Regards,
Kiran

Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
It is because java.lang.String has no num attribute.
Change public static String createInstance() to public static BeanStaticDemo createInstance().


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
sarma kiran
Ranch Hand

Joined: Jul 17, 2008
Posts: 30
Thanks.
 
 
subject: Setter DI for the bean
 
Similar Threads
Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationExcep
Hello world spring aop
Dependency checking and constructor injection
AOP not getting invoked on my Target Bean Method --> Singer.perform() method
Spring Quartz migration to WAS