NullPointerException while trying to load application context in JSF 1.2

試著忘記壹切 提交于 2019-12-11 14:12:42

问题


Null pointer exception is coming while trying to load application context while migrating to jsf 1.2.

Below is the stack trace

    [ERROR] [com.sun.faces.lifecycle.InvokeApplicationPhase] [] - #   {CustomerSearchBean.searchCustomers}: javax.faces.el.EvaluationException: 
     java.lang.NullPointerException
    javax.faces.FacesException: #{CustomerSearchBean.searchCustomers}: javax.faces.el.EvaluationException: java.lang.NullPointerException
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)

    ... 29 more
 Caused by: java.lang.NullPointerException
at com.tms.cdqi.presentation.jsf.bean.customerprofile.CustomerSearchBean.searchCustomers(CustomerSearchBean.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

Below is the faces-xml

 <managed-bean>
    <description>This bean is used for customer profile</description>
    <managed-bean-name>CustomerSearchBean</managed-bean-name>
    <managed-bean-class>com.tms.cdqi.presentation.jsf.bean.customerprofile.CustomerSearchBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
        <property-name>commandInvoker</property-name>
        <value>#{commandInvoker}</value>
    </managed-property>
    <managed-property>
        <property-name>applicationContextFactory</property-name>
        <value>#{cdqiApplicationContextFactory}</value>
    </managed-property>

</managed-bean>

Edit 1: Below is the Application context xml

       <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.springframework.org/schema/beans"
  xsi:schemaLocation="
            http://www.springframework.org/schema/beans
     http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="cdqiApplicationContextFactory"
    class="com.tms.cdqi.framework.context.CDQIApplicationContextFactoryImpl" />

Edit 2 Code

    The application context  where null pointer is occurring

    CDQIApplicationContext context = this.getApplicationContextFactory()
            .getApplicationContext();

来源:https://stackoverflow.com/questions/28342750/nullpointerexception-while-trying-to-load-application-context-in-jsf-1-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!