Hi all,
I have created a simple Bean which will insert the values in to the database. While executing that i got this error:
javax.faces.FacesException: Problem in renderResponse: Error creating bean with name 'dbBean' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.openi.web.ui.jsf.bean.reports.analysis.DBBean]: Constructor threw exception; nested exception is java.lang.NullPointerException
com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:294)
com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:161)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
com.icesoft.faces.webapp.http.core.PageServer$1.respond(PageServer.java:25)
com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:161)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet$ThreadBlockingRequestResponse.respondWith(ThreadBlockingAdaptingServlet.java:36)
com.icesoft.faces.webapp.http.core.PageServer.service(PageServer.java:30)
com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:48)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:139)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.openi.security.AuthorizationFilter.doFilter(AuthorizationFilter.java:98)
My Bean code is:
Can anyone suggest me to resolve this issue?
Thanks in advance.
All search starts with beginner's luck and all search ends with victor's severly tested.
Can you also post the code for ConnectionFactory ?
(By the way, you should consider using dependecny injection for referencing a ConnectionFactory, since you're making use of Spring, but that's a whole different matter).
Sorry, I now realized that ConnectionFactory is not one of your classes, it's from an API However, I still suspect that NPE is thrown by the 'new ConnectionFactory()' line.