Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Need help with Liferay JSF Portal Bridge
Hi.
I am new to this portal development, recently I started working on deploying a JSF application to Liferay Portal
using Apache jsf-portlet-bridge, able to deploy the application but I get this exception when trying to access the portlet.
13:41:56,777 ERROR [ETagFilter:136] java.lang.ClassCastException: org.apache.catalina.session.StandardSessionFacade cannot be cast to javax.portlet.PortletSession
java.lang.ClassCastException: org.apache.catalina.session.StandardSessionFacade cannot be cast to javax.portlet.PortletSession
at com.sun.faces.portlet.LifecycleImpl.restore(LifecycleImpl.java:387)
at com.sun.faces.portlet.LifecycleImpl.execute(LifecycleImpl.java:207)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
Removed some of the exception trace.
This is the jar files list, I am using
commons-beanutils.jar
commons-codec-1.3.jar
commons-collections.jar
commons-digester.jar
commons-el.jar
commons-httpclient-3.1.jar
commons-lang.jar
commons-logging.jar
jaxb-api.jar
jaxb-impl.jar
jaxb-xjc.jar
jaxb1-impl.jar
jdom-b8.jar
jsf-api.jar
jsf-impl.jar
jsf-portlet.jar
jstl.jar
portals-bridges-common-1.0.jar
portals-bridges-jsf-1.0.jar
This how my JSP page looks
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<meta http-equiv="KEYWORDS" content="shipment, tracking, trace, rail, freight, union, pacific, railroad">
<h:form id="f">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="txt"><span style="font-size: small"><ul>
<li><a href="TraceForm.jas?trace=trace"><h:outputText value="Trace"/></a></li>
<li><a href="/wet/secure/ListMaint.jas?6"><h:outputText value="Browse Lists"/></a> </li>
</ul></span>
</td>
</tr>
</table>
</div>
</h:form>
</f:view>
Portlet.xml
<?xml version="1.0"?>
<portlet-app
version="2.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
>
<portlet>
<portlet-name>Wet</portlet-name>
<display-name>Wet</display-name>
<portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class>
<init-param>
<name>ViewPage</name>
<value>WEB-INF/index.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>Wet</title>
<short-title>Wet</short-title>
<keywords>Wet</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Wet-portlet</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/faces-config.xml
</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<!-- Faces extension mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>
/WEB-INF/tld/liferay-portlet.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
I am new to this portal development, recently I started working on deploying a JSF application to Liferay Portal
using Apache jsf-portlet-bridge, able to deploy the application but I get this exception when trying to access the portlet.
13:41:56,777 ERROR [ETagFilter:136] java.lang.ClassCastException: org.apache.catalina.session.StandardSessionFacade cannot be cast to javax.portlet.PortletSession
java.lang.ClassCastException: org.apache.catalina.session.StandardSessionFacade cannot be cast to javax.portlet.PortletSession
at com.sun.faces.portlet.LifecycleImpl.restore(LifecycleImpl.java:387)
at com.sun.faces.portlet.LifecycleImpl.execute(LifecycleImpl.java:207)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
Removed some of the exception trace.
This is the jar files list, I am using
commons-beanutils.jar
commons-codec-1.3.jar
commons-collections.jar
commons-digester.jar
commons-el.jar
commons-httpclient-3.1.jar
commons-lang.jar
commons-logging.jar
jaxb-api.jar
jaxb-impl.jar
jaxb-xjc.jar
jaxb1-impl.jar
jdom-b8.jar
jsf-api.jar
jsf-impl.jar
jsf-portlet.jar
jstl.jar
portals-bridges-common-1.0.jar
portals-bridges-jsf-1.0.jar
This how my JSP page looks
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<meta http-equiv="KEYWORDS" content="shipment, tracking, trace, rail, freight, union, pacific, railroad">
<h:form id="f">
<div align="center">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="txt"><span style="font-size: small"><ul>
<li><a href="TraceForm.jas?trace=trace"><h:outputText value="Trace"/></a></li>
<li><a href="/wet/secure/ListMaint.jas?6"><h:outputText value="Browse Lists"/></a> </li>
</ul></span>
</td>
</tr>
</table>
</div>
</h:form>
</f:view>
Portlet.xml
<?xml version="1.0"?>
<portlet-app
version="2.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
>
<portlet>
<portlet-name>Wet</portlet-name>
<display-name>Wet</display-name>
<portlet-class>org.apache.portals.bridges.jsf.FacesPortlet</portlet-class>
<init-param>
<name>ViewPage</name>
<value>WEB-INF/index.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>Wet</title>
<short-title>Wet</short-title>
<keywords>Wet</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Wet-portlet</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/faces-config.xml
</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<!-- Faces extension mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>
/WEB-INF/tld/liferay-portlet.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>
Community
Company
Feedback