[JBoss Seam] - Re: javax.faces.el.PropertyNotFoundException: Base is null
by asookazian
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...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078611#4078611
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078611
18Â years, 8Â months
[JBoss Seam] - the intercept component don't work!
by chlol
my test intercept:
@Name("interceptsTest")
@Interceptor
public class InterceptsTest {
@Logger
Log log;
@AroundInvoke
public Object doLogs(InvocationContext inv) throws Exception {
int methodModify = inv.getMethod().getModifiers();
String methodName = inv.getMethod().getName();
if (methodModify == Modifier.PUBLIC
&& (methodName.startsWith("create")
|| methodName.startsWith("update")
|| methodName.startsWith("persist")
|| methodName.startsWith("remove"))) {
Map data = inv.getContextData();
Object target = inv.getTarget();
log.debug("ContextData:" + data);
log.debug("Target:" + target);
}
return inv.proceed();
}
}
my invoke intercept class:
@Name("useIntercept")
@Interceptors(InterceptsTest.class)
public class UseIntercept {
public void persist() {
System.out.println("&&&&&&&&&&&& do persist() &&&&&&&&&&&&");
}
}
but when the persist() is executed,the intercept don't be invoked
can you help me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078610#4078610
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078610
18Â years, 8Â months
[JBoss Seam] - javax.faces.el.PropertyNotFoundException: Base is null
by asookazian
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
18Â years, 8Â months
[JBoss Seam] - is it rich:menuItem bug ?
by chlol
my menu source code:
<rich:menuItem submitMode="ajax" value="update" action="/UserEdit.xhtml">
<f:param name="userId"
value="#{authenticator.user.id}"/>
</rich:menuItem>
the Authenticator class:
@Name("authenticator")
@Scope(ScopeType.SESSION)
public class Authenticator {
@Logger
Log log;
@In
Identity identity;
@In
EntityManager entityManager;
private User user = new User();
public boolean authenticate() {
log.info("authenticating #0", identity.getUsername());
// write your authentication logic here,
// return true if the authentication was
// successful, false otherwise
try {
user = (User) entityManager
.createQuery(
"from User where username = :username and password = :password")
.setParameter("username", identity.getUsername())
.setParameter("password", identity.getPassword())
.getSingleResult();
if (user.getUserRoles() != null) {
for (UserRole role : user.getUserRoles()) {
identity.addRole(role.getRole().getName());
}
}
return true;
} catch (NoResultException ex) {
return false;
}
}
@Out
public User getUser() {
return user;
}
}
i login to the home page ,then drop the menu update,the url is manhour/UserEdit.seam?cid=37
but the edit page has no the user info,but when i drop the menu update again,the url is manhour/UserEdit.seam?userId=1&cid=38,here the user info appear,i can't understant that.
can you help me?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078602#4078602
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078602
18Â years, 8Â months
[JBoss Seam] - SEAM internationalization problem :(
by alex_enache
Hi guys,
I'm having a problem with internationalization in SEAM for 2 days now. And I can't seem to make it right. So, I have the following files:
pmResources_ro.properties
pmResources_en.properties
pmResources_fr.properties
pmResources.properties
They are stored in:
/myapp.ear/myapp.war/WEB-INF/classes/
Here is what faces-config.xml contains about the bundle:
<application>
| <message-bundle>pmResources</message-bundle>
| <locale-config>
| <default-locale>ro</default-locale>
| <supported-locale>ro</supported-locale>
| <supported-locale>en</supported-locale>
| <supported-locale>fr</supported-locale>
| </locale-config>
| </application>
The components.xml part:
<core:resource-bundle>
| <core:bundle-names>
| <value>pmResources</value>
| </core:bundle-names>
| </core:resource-bundle>
And in my page I use it with:
...
| <f:loadBundle basename="pmResources" var="bundle"/>
| ...
| <h:outputText value="Text=#{bundle.AboutUsText}"/>
Even though ro should be default, every time I load the page en is the one displayed. And I tried to use:
<h:selectOneMenu value="#{localeSelector.language}">
| <f:selectItem itemLabel="English" itemValue="en"/>
| <f:selectItem itemLabel="Francais" itemValue="fr"/>
| <f:selectItem itemLabel="Romana" itemValue="ro"/>
| </h:selectOneMenu>
| <s:button action="#{localeSelector.select}" value="ChangeLanguage"/>
>From what I know, JSF searches the properties files in the following order:
pmResources_ro.properties
pmResources_ro_RO.properties
pmResources_en.properties
pmResources_en_US.properties
pmResources_fr.properties
pmResources_fr_FR.properties
pmResources.properties
Can anyone help me with this ? Thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078601#4078601
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078601
18Â years, 8Â months