• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

@Autowired problem

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Was wondering if someone can help me with an 'Injection of autowired dependencies failed':

INFO: Initializing Spring FrameworkServlet 'spring'

In ViewDVDController()

Oct 26, 2011 11:50:07 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'viewDVDController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationEapp structure.jpgxception: Could not autowire field: private springmvc.application.inventory.impl.InventoryMana gerImpl springmvc.presentation.ViewDVDController.manager; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [springmvc.application.inventory.impl.InventoryMana gerImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Aut owired(required=true)}

InventoryManagerImpl class:



ViewDVDController:



web.xml:


spring.properties:



spring-servlet:



jdbc-context.xml:




applicationContext.xml:
app-structure.GIF
[Thumbnail for app-structure.GIF]
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have
@Autowired // ?
private InventoryManager manager;

but you have not wired in InventoryManagerImpl instance. You need to mark InventoryManagerImpl as @Resource or @Controller.

Hopefully you are asking Spring to scan the packages and look out for annotations
 
karl czukoski
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
InventoryManagerImpl is marked @Controller

jdbc-context.xml contains <tx:annotation-driven transaction-manager="transactionManager" />
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

karl czukoski wrote:InventoryManagerImpl is marked @Controller

jdbc-context.xml contains <tx:annotation-driven transaction-manager="transactionManager" />



Don't see it in the class you have posted above
 
karl czukoski
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I misunderstood

Now have:



but still the same error
 
get schwifty. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic