Need help with s:viewAction
assen-todorov Jun 16, 2011 3:34 AMHi,
I cannot get s:viewAction work. I try to use it exactly as specified in the seam 3 documentation, but without success.
This is my page
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.org/seam/faces" xmlns:dms="http://www.ligatus.com/jsf/tags" template="../../resources/templates/default.xhtml"> <ui:define name="metadata"> <f:metadata> <f:viewParam name="id" value="#{selectedId}"/> <s:viewAction action="#{engine.selectedItem(selectedId)}"/> </f:metadata> </ui:define> ...
and this is my template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"> <f:view> <ui:insert name="metadata"/> <h:head> <title>DA Engine</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" href="/resources/css/default.css" type="text/css" media="screen"/> </h:head> <h:body> ... </h:body> </f:view> </html>
After successful deploy I get this exception if I click on the link that goes to this page
09:23:10,682 SCHWERWIEGEND [javax.enterprise.resource.webcontainer.jsf.application] JSF1068: Komponente mit Komponententyp org.jboss.seam.faces.ViewAction kann nicht instanziiert werden. 09:23:10,697 FATAL [org.jboss.seam.faces.view.SeamViewMetadata] Ausdrucksfehler: Benanntes Objekt org.jboss.seam.faces.ViewAction nicht gefunden. 09:23:10,697 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/engine].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalArgumentException: null source at java.util.EventObject.<init>(EventObject.java:38) [:1.6.0_12] at javax.faces.event.SystemEvent.<init>(SystemEvent.java:67) [:2.0.3-] at javax.faces.event.ComponentSystemEvent.<init>(ComponentSystemEvent.java:69) [:2.0.3-] at javax.faces.event.PostRestoreStateEvent.<init>(PostRestoreStateEvent.java:69) [:2.0.3-] at com.sun.faces.lifecycle.RestoreViewPhase.deliverPostRestoreStateEvent(RestoreViewPhase.java:256) [:2.0.3-] at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:245) [:2.0.3-] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-] at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107) [:2.0.3-] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) [:2.0.3-] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) [:2.0.3-] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final] at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final] at java.lang.Thread.run(Thread.java:619) [:1.6.0_12] 09:23:10,713 ERROR [org.jboss.web.tomcat.service.jca.CachedConnectionValve] Application error: Faces Servlet did not complete its transaction
The exception basically says that org.jboss.seam.faces.ViewAction could not be found.
I deploy an ear-file and seam-faces 3.0.0.Final is definitely in the lib directory in the ear-file along with other seam 3 artefacts.
Can someone help mi with this issue?