Tagged: 2 months 3 weeks ago
- This topic has 7 replies, 2 voices, and was last updated 10 years, 11 months ago by
support-pradeep.
-
AuthorPosts
-
use notation instead of applicationContext.xml
@Service (value = “fixedDepositService”)
//@Service
public class FixedDepositServiceImpl implements FixedDepositService {
@Autowired
private FixedDepositDao fixedDepositDao;@Override
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Jul 21, 2014 1:34:10 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘bankapp’
Jul 21, 2014 1:34:10 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘fixedDepositController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private sample.spring.chapter11.service.FixedDepositService sample.spring.chapter11.web.FixedDepositController.fixedDepositService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [sample.spring.chapter11.service.FixedDepositService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.sprat java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private sample.spring.chapter11.service.FixedDepositService sample.spring.chapter11.web.FixedDepositController.fixedDepositService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [sample.spring.chapter11.service.FixedDepositService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
… 29 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [sample.spring.chapter11.service.FixedDepositService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
atJuly 21, 2014 at 5:54 am #350511
support-pradeepMemberayc868,
Please take a look at these links which discusses the similar problem :
http://stackoverflow.com/questions/8961275/no-matching-bean-of-type-found-for-dependency
http://stackoverflow.com/questions/20333147/autowired-no-qualifying-bean-of-type-found-for-dependency
http://forum.spring.io/forum/spring-projects/data/98781-injection-of-autowired-dependencies-failed-stuck-on-this-for-days-nowThis looks like a development related query and I suggest you to cross post on development forums(like http://stackoverflow.com/ ) for better support on this query.
July 21, 2014 at 12:56 pm #350522Do you have any spring autowired annotation example that work?
so that I can compare . Any way, a workable for myeclipse.
The sample( from the book) I have suppose to be work, but not for myeclipse 2015July 22, 2014 at 4:40 am #350535
support-pradeepMemberayc868,
I’m afraid MyEclipse doesn’t provide any tutorials for spring @Autowired annotation. For your convenience I have pasted some tutorial links here –
http://www.dineshonjava.com/2012/07/spring-autowired-annotation.html#.U84uSvmSzHI
http://www.tutorialspoint.com/spring/spring_autowired_annotation.htmLet us know if you see any issues in MyEclipse.
July 22, 2014 at 5:49 pm #350567I have a lot resources.
But the problem is,it must be a web application. My problem is the deployment to Tomcat with MyEclipse –
combination problem. Tomcat loading problemJuly 22, 2014 at 11:22 pm #350572
support-pradeepMemberayc868,
My problem is the deployment to Tomcat with MyEclipse –
combination problem. Tomcat loading problem1. Can you please be more clear on what exact problem you are facing ? Please mention the exact steps to help us replicate the issue at our end.
2. Can you please clarify on which Tomcat server you are facing the problem ? Is it with MyEclipse embedded Tomcat server or external Tomcat server ? Also mention the tomcat version you are using?
3. Is the issue only with a particular project or all the projects ?
4. Clear the contents of the .log file which is located at <workspace dir>/.metadata/.log, now try deploying the project. Please paste the entire contents of the .log file here to help us investigate further.
July 23, 2014 at 7:52 pm #350598This is trick. it take me long time to resolve all this.
July 29, 2014 at 7:13 am #350687
support-pradeepMemberayc868,
Can you please clarify whether you could fix the Tomcat deployment issue ? If yes, can you please let us know what changes have you done to make it work ?
If you are still facing the problem, Can you please provide the details that I have asked in my earlier response ?
-
AuthorPosts