[jboss-user] [JBoss Seam] - javax.faces.el.PropertyNotFoundException: Base is null
asookazian
do-not-reply at jboss.com
Tue Aug 28 03:39:06 EDT 2007
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>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078609#4078609
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078609
More information about the jboss-user
mailing list