[jboss-user] [JBoss Portal] - Re: JSF 1.2 + Woodstock
viggo.navarsete
do-not-reply at jboss.com
Wed Aug 8 07:20:01 EDT 2007
I've done some research:
1. Downloaded source for ajax4jsf and richfaces and built it according to http://labs.jboss.com/wiki/HowToBuildRichFacesSnapshotManually
2. Created a JSF portlet where I
- bundled with the JSF Portletbridge from Sun, the richfaces-ui, richfaces-impl, richfaces-api. Also had to bundle the commons-digester and commons-beanutils for some reason.
- My web.xml look like this:
<?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
| <context-param>
| <param-name>com.sun.faces.verifyObjects</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>
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <!-- RichFaces and ajax4jsf settings -->
| <context-param>
| <param-name>org.ajax4jsf.SKIN</param-name>
| <param-value>blueSky</param-value>
| </context-param>
| <filter>
| <display-name>Ajax4jsf Filter</display-name>
| <filter-name>ajax4jsf</filter-name>
| <filter-class>org.ajax4jsf.Filter</filter-class>
| </filter>
| <filter-mapping>
| <filter-name>ajax4jsf</filter-name>
| <servlet-name>Faces Servlet</servlet-name>
| <dispatcher>REQUEST</dispatcher>
| <dispatcher>FORWARD</dispatcher>
| <dispatcher>INCLUDE</dispatcher>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>/faces/*</url-pattern>
| </servlet-mapping>
| <session-config>
| <session-timeout>
| 30
| </session-timeout>
| </session-config>
| <welcome-file-list>
| <welcome-file>faces/welcomeJSF.jsp</welcome-file>
| </welcome-file-list>
| </web-app>
-my portlet.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
| <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| version="1.0">
|
| <portlet>
| <description>Search</description>
| <portlet-name>Search</portlet-name>
| <display-name>Search</display-name>
| <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
| <!-- This is a required parameter and must point to the first page of the JSF Application -->
| <init-param>
| <description>Portlet init view page</description>
| <name>com.sun.faces.portlet.INIT_VIEW</name>
| <value>/WEB-INF/jsp/Search.jsp</value>
| </init-param>
| <expiration-cache>0</expiration-cache>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>Search</title>
| <short-title>Search</short-title>
| </portlet-info>
| </portlet>
| </portlet-app>
- my jsp looks like this:
<%@page contentType="text/html"%>
| <%@page pageEncoding="UTF-8"%>
|
| <%-- RichFaces taglibs --%>
| <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
|
| <%-- JSF taglibs --%>
| <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
| <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
|
| <%-- portlet taglibs --%>
| <%@ page import="javax.portlet.*"%>
| <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
|
|
| <portlet:defineObjects />
| <%PortletPreferences prefs = renderRequest.getPreferences();%>
|
| <f:view>
| <rich:panel>
| <f:facet name="header">
| <h:outputText value="Olympus EVOLT E-500"/>
| </f:facet>
| </rich:panel>
| </f:view>
|
When I create a portlet instance in JBoss Portal 2.6.0.GA (running on JBoss AS 4.2.0GA) and try to access the portlet I get this stacktrace:
13:06:48,011 WARN [SkinFactoryImpl] Init parameter for a skin name changed to org.richfaces.SKIN
| 13:06:54,827 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| java.lang.ClassCastException: org.apache.catalina.core.ApplicationContextFacade
| at com.sun.faces.portlet.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:64)
| at org.jboss.portal.faces.portlet.JSFMetaBridgeFacesContextFactoryImpl.getFacesContext(JSFMetaBridgeFacesContextFactoryImpl.java:47)
| at org.ajax4jsf.resource.InternetResourceService.getFacesContext(InternetResourceService.java:317)
| at org.ajax4jsf.resource.InternetResourceService.getResourceContext(InternetResourceService.java:251)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:162)
| at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:144)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:259)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:595)
|
Anyone knows what is wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071953#4071953
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071953
More information about the jboss-user
mailing list