• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

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









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!
    Bookmark Topic Watch Topic
  • New Topic