3 Replies Latest reply on Aug 28, 2007 5:15 AM by Pete Muir

    javax.faces.el.PropertyNotFoundException: Base is null

    Arbi Sookazian Master

      Can anybody please explain this error???

      i have a new Seam project with a testit.jsp:

      <%@ page language="java" pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
       <title>get web context info</title>
      </head>
      
      <body>
       <f:view>
       <h:form>
      
       <h:commandButton type="submit" value="get web context info"
       action="#{webContextInfo.testit}" />
       </h:form>
       </f:view>
      </body>
      </html>


      submits to following SLSB:

      package org.jimfarley.gadgets;
      
      import javax.ejb.Stateless;
      import javax.faces.context.FacesContext;
      
      import org.apache.log4j.Logger;
      import org.jboss.seam.annotations.Name;
      
      @Stateless
      @Name("webContextInfo")
      public class WebContextInfoBean implements IWebContextInfoBean {
      
       Logger log = Logger.getLogger(this.getClass());
      
       public void testit() {
      
       String contextPath = FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
      
       log.debug("contextPath = " + contextPath);
      
       String viewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();
      
       log.debug("viewId = " + viewId);
       }
      }


      getting following stack trace:

      2007-08-28 00:18:00,421 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/PracticalSeam-Intro-Seam].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      javax.faces.FacesException: Error calling action method of component with id _idJsp0:_idJsp1
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{webContextInfo.testit}
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:165)
       at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
       at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       ... 25 more
      Caused by: javax.faces.el.PropertyNotFoundException: Base is null: webContextInfo
       at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:460)
       at org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty(MethodBindingImpl.java:180)
       at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:114)
       ... 28 more


      In the same project/war, this jsf's submit works as intended:

      <%@ page language="java" pageEncoding="ISO-8859-1"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
       <title>Add a Gadget</title>
      </head>
      
      <body>
       <f:view>
       <h:form>
       <table border="0">
       <tr>
       <td>Description:</td>
       <td>
       <h:inputText value="#{gadget.description}"
       required="true" />
       </td>
       </tr>
       <tr>
       <td>Type:</td>
       <td>
       <h:selectOneMenu value="#{gadget.type}"
       required="true">
       <f:selectItems value="#{gadget.gadgetTypes}" />
       </h:selectOneMenu>
       </td>
       </tr>
       </table>
       <h:commandButton type="submit" value="Create"
       action="#{gadgetAdmin.newGadget}" />
       </h:form>
       </f:view>
      </body>
      </html>


        • 1. Re: javax.faces.el.PropertyNotFoundException: Base is null
          Arbi Sookazian Master

          I added a commandButton to the addGadget.jsp and the associated new method to the SLSB and got the following:

          2007-08-28 00:34:42,875 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/PracticalSeam-Intro-Seam].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
          javax.faces.FacesException: Value binding '#{gadget.gadgetTypes}'of UISelectItems with component-path {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /addGadget.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: _idJsp2][Class: javax.faces.component.UISelectItems,Id: _idJsp3]} does not reference an Object of type SelectItem, SelectItem[], Collection or Map but of type : null


          something wrong with the classpath or configuration(s)? this is project based on the intro-Seam example from the new Practical Jboss book...

          • 2. Re: javax.faces.el.PropertyNotFoundException: Base is null
            Arbi Sookazian Master

            ok, so I restarted JBoss 4.0.5 (BTW I'm using Seam 1.2.1.GA with this app).

            I'm getting the following stack trace while it's deploying this app:

            2007-08-28 00:43:33,046 DEBUG [org.jboss.seam.deployment.ComponentScanner] found component class: org/jimfarley/gadgets/GadgetAdminBean.class
            2007-08-28 00:43:33,046 DEBUG [org.jboss.seam.deployment.ComponentScanner] could not load class: org.jimfarley.gadgets.GadgetAdminBean
            java.lang.ClassNotFoundException: org.jimfarley.gadgets.GadgetAdminBean
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)
             at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
             at org.jboss.seam.deployment.ComponentScanner.handleItem(ComponentScanner.java:59)
             at org.jboss.seam.deployment.Scanner.handleArchive(Scanner.java:139)
             at org.jboss.seam.deployment.Scanner.scan(Scanner.java:118)
             at org.jboss.seam.deployment.ComponentScanner.getClasses(ComponentScanner.java:39)
             at org.jboss.seam.init.Initialization.scanForComponents(Initialization.java:585)
             at org.jboss.seam.init.Initialization.init(Initialization.java:490)
             at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
             at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
             at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
             at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
             at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
             at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
             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:585)
             at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
             at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
             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:585)
             at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
             at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
             at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
             at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
             at org.jboss.web.WebModule.startModule(WebModule.java:83)
             at org.jboss.web.WebModule.startService(WebModule.java:61)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
             at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
             at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:417)
             at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy49.start(Unknown Source)
             at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
             at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
             at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
             at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
             at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy50.start(Unknown Source)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy6.deploy(Unknown Source)
             at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
             at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
             at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
             at $Proxy0.start(Unknown Source)
             at org.jboss.system.ServiceController.start(ServiceController.java:417)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy4.start(Unknown Source)
             at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
             at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
             at $Proxy5.deploy(Unknown Source)
             at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
             at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
             at org.jboss.Main.boot(Main.java:200)
             at org.jboss.Main$1.run(Main.java:490)
             at java.lang.Thread.run(Thread.java:595)


            and then similar for another SB:

            2007-08-28 00:43:33,062 DEBUG [org.jboss.seam.deployment.ComponentScanner] could not load class: org.jimfarley.gadgets.WebContextInfoBean
            java.lang.ClassNotFoundException: org.jimfarley.gadgets.WebContextInfoBean


            and then towards the end:

            2007-08-28 00:43:39,906 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:
            
            --- MBeans waiting for other MBeans ---
            ObjectName: jboss.j2ee:service=EJB3,module=PracticalSeam-Intro-Seam.jar
             State: FAILED
             Reason: java.lang.ClassNotFoundException: Unexpected error during load of: org.jimfarley.gadgets.GadgetAdminBean, msg=Bad version number in .class file
            
            --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
            ObjectName: jboss.j2ee:service=EJB3,module=PracticalSeam-Intro-Seam.jar
             State: FAILED
             Reason: java.lang.ClassNotFoundException: Unexpected error during load of: org.jimfarley.gadgets.GadgetAdminBean, msg=Bad version number in .class file


            what the hell is going on here??

            • 3. Re: javax.faces.el.PropertyNotFoundException: Base is null
              Pete Muir Master

              Do a complete clean on your project, build it. Make sure you have clean JBoss AS install.