• 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic