[Solved] Spring dependency injection not working

On February 1, 2011, in JSF, Spring, by lucasterdev

You made an application with JSF + Spring integration.
You deployed your application.
You got NullPointerException when an injected object’s method is called.

How to fix that:

Add the following piece of XML in faces-config.xml:

 	<application>
		<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
	</application>

You’ll get the following warning:

Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver

Ignore it.

 

One Response to [Solved] Spring dependency injection not working

  1. Joelle says:

    Thank you very much for this article!!! I spent two days looking for the solution of this error.
    Many thanks

Leave a Reply