• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Injecting Spring service in Backing Bean

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to make a web with netbeans 7.4, SPRING 3.2.3, JSF 2.2 with Primefaces 3.5 and Glassfish 4.0.

My objective is to create a very simple project that injects a service in a backing bean. Till now I have created a new project in netbeans with these 2 frameworks. These are the files in my project:

Project TREE


Index.xhtml



IndexBB.java



Servicio.java



ServicioImpl.java



applicationContext.XML



dispatcher-servlet.XML



faces-config.XML



web.XML



As you can see the project is VERY simple. Just a button that takes the value from a service an puts it in a variable.

The problem is that when I press the button Glassfish gives me a NullPointer with this stackTrace:



In my opinion the service is not being correctly injected, so when I press the button it is NULL.

I have searched over the net with no result (most of the code I have found doesn't work).
May some person with experience configuring Spring take a look to my project to help me?
Thanks in advance!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic