6 Replies Latest reply on Feb 19, 2007 6:24 PM by Chris Lowe

    Another Seam, Myfaces, Facelets, Ajax4JSF and Trinidad probl

    Tomas Wahlgren Newbie

      Hi,
      I m using Seam 1.1.6
      , Myfaces 1.1.4
      , Facelets 1.1.12
      , Ajax4JSF 1.0.6
      , Trinidad incubator-m1-SNAPSHOT

      , but cant get it to run with the trinidad part.

      I have tried to follow all the example apps the a4j, seam and trinidad sites have posted, but still get the error below.

      My web.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

      <display-name>Moox Web Application</display-name>
      <description>Moox Web Application.</description>

      <context-param>
      <!-- Use: Specifies paths to JSF application configuration resource files.
      Value: A comma-separated list of application-context-relative paths. -->
      <param-name>javax.faces.CONFIG_FILES</param-name>
      <param-value>/WEB-INF/navigation.xml</param-value>
      </context-param>

      <!-- Ajax4jsf (must come first!) -->
      <filter>
      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      <init-param>
      <param-name>forceparser</param-name>
      <param-value>false</param-value>
      </init-param>
      </filter>
      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <url-pattern>*.jspx</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

      <!-- Trinidad -->
      <context-param>
      <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      </context-param>
      <context-param>
      <param-name>facelets.VIEW_MAPPINGS</param-name>
      <param-value>*.jspx</param-value>
      </context-param>
      <context-param>
      <param-name>
      org.apache.myfaces.trinidad.CACHE_VIEW_ROOT
      </param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <param-name>com.sun.faces.validateXml</param-name>
      <param-value>true</param-value>
      </context-param>

      <!-- Seam -->
      <context-param>
      <param-name>org.jboss.seam.core.init.debug</param-name>
      <param-value>true</param-value>
      </context-param>

      <listener>
      <listener-class>
      org.jboss.seam.servlet.SeamListener
      </listener-class>
      </listener>

      <!-- Enable Seam to propagate the conversation context across the browser redirects (JSF post-then-redirect) -->
      <filter>
      <filter-name>Seam Redirect Filter</filter-name>
      <filter-class>
      org.jboss.seam.servlet.SeamRedirectFilter
      </filter-class>
      </filter>
      <filter-mapping>
      <filter-name>Seam Redirect Filter</filter-name>
      <url-pattern>*.jspx</url-pattern>
      </filter-mapping>


      <!-- Servlet config -->
      <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      <!-- Faces Servlet Mapping -->
      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.jspx</url-pattern>
      </servlet-mapping>


      <!-- JSF -->
      <context-param>
      <!-- Use: Specifies a file extension (suffix) for JSP pages that contain JSF components. The default is .jsp.
      Value: A file extension. -->
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.jspx</param-value>
      </context-param>
      <context-param>
      <!-- Use: Selects a state saving method.
      Value: Either server or client.
      The default is server, which stores the application's view state on the server.
      If you select client, JSF stores the view state on the browser client. -->
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>facelets.REFRESH_PERIOD</param-name>
      <param-value>2</param-value>
      </context-param>


      <!-- MyFaces -->
      <context-param>
      <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
      <param-value>false</param-value>
      </context-param>
      <context-param>
      <!-- Use: Select whether a list should maintain its scroll position after postback.
      Value: true or false -->
      <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
      <param-value>true</param-value>
      </context-param>
      <context-param>
      <param-name>
      org.apache.myfaces.CHECK_EXTENSIONS_FILTER
      </param-name>
      <param-value>true</param-value>
      </context-param>
      <!-- context-param>
      <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
      <param-value>
      org.apache.myfaces.renderkit.html.util.DefaultAddResource
      </param-value>
      </context-param-->

      <!-- trinidad -->
      <filter>
      <filter-name>trinidad</filter-name>
      <filter-class>
      org.apache.myfaces.trinidad.webapp.TrinidadFilter
      </filter-class>
      </filter>
      <filter-mapping>
      <filter-name>trinidad</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      </filter-mapping>
      <servlet>
      <servlet-name>resources</servlet-name>
      <servlet-class>
      org.apache.myfaces.trinidad.webapp.ResourceServlet
      </servlet-class>
      </servlet>
      <servlet-mapping>
      <servlet-name>resources</servlet-name>
      <url-pattern>/adf/*</url-pattern>
      </servlet-mapping>


      <listener>
      <listener-class>
      org.apache.myfaces.webapp.StartupServletContextListener
      </listener-class>
      </listener>


      <!-- SPRING -->
      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>WEB-INF/classes/applicationcontext.xml</param-value>
      </context-param>

      <listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>


      <!-- Startpage -->
      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      </welcome-file-list>
      </web-app>



      My faces-config.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE faces-config
      PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
       "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
      <faces-config>
      
       <application>
       <!-- Enable Spring bean injection in Seam components (with @In("#{springBean}") annotation) -->
       <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
       <locale-config>
       <default-locale>no</default-locale>
       </locale-config>
       </application>
      
       <application>
       <!-- Use the Trinidad RenderKit -->
       <default-render-kit-id>
       org.apache.myfaces.trinidad.core
       </default-render-kit-id>
       </application>
      
      
       <lifecycle>
       <!-- Enable Seam -->
       <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>
      
      </faces-config>



      The error I get:

      2007-feb-19 13:58:37 com.sun.facelets.FaceletViewHandler handleRenderException
      ALLVARLIG: Error Rendering View[/start.jspx]
      com.sun.facelets.tag.TagAttributeException: /menu.jspx @34,173 action="#{mainBean.setCurrentObject(listItem)}" Error Parsing: #{mainBean.setCurrentObject(listItem)}
      at com.sun.facelets.tag.TagAttribute.getMethodExpression(TagAttribute.java:144)
      at com.sun.facelets.tag.jsf.ActionSourceRule$ActionMapper.applyMetadata(ActionSourceRule.java:50)
      at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
      at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
      at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:144)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
      at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
      at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
      at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
      at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
      at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
      at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
      at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
      at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
      at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
      at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
      at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
      at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
      at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
      at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
      at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
      at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
      at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
      at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
      at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
      at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
      at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:546)
      at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221)
      at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:210)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:167)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:140)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:93)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
      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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Unknown Source)
      Caused by: javax.el.ELException: Error Parsing: #{mainBean.setCurrentObject(listItem)}
      at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:140)
      at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:157)
      at com.sun.el.lang.ExpressionBuilder.createMethodExpression(ExpressionBuilder.java:208)
      at com.sun.el.ExpressionFactoryImpl.createMethodExpression(ExpressionFactoryImpl.java:63)
      at com.sun.facelets.tag.TagAttribute.getMethodExpression(TagAttribute.java:141)
      ... 73 more
      Caused by: com.sun.el.parser.ParseException: Encountered "(" at line 1, column 28.
      Was expecting one of:
      "}" ...
      "." ...
      "[" ...
      ">" ...
      "gt" ...
      "<" ...
      "lt" ...
      ">=" ...
      "ge" ...
      "<=" ...
      "le" ...
      "==" ...
      "eq" ...
      "!=" ...
      "ne" ...
      "&&" ...
      "and" ...
      "||" ...
      "or" ...
      "*" ...
      "+" ...
      "-" ...
      "?" ...
      "/" ...
      "div" ...
      "%" ...
      "mod" ...

      at com.sun.el.parser.ELParser.generateParseException(ELParser.java:1651)
      at com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:1531)
      at com.sun.el.parser.ELParser.DeferredExpression(ELParser.java:134)
      at com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:61)
      at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:103)
      ... 77 more
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying business process context
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing session context
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
      13:58:37,609 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
      13:58:37,625 INFO [org.apache.myfaces.shared_tomahawk.config.MyfacesConfig] No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
      14:05:31,046 DEBUG [org.jboss.seam.contexts.Lifecycle] End of session, destroying contexts

      Any help appriciated...