[jboss-user] [JBoss Portal] - Re: How to deploy a Seam Portlet?

m.paranjape do-not-reply at jboss.com
Wed Jul 30 01:43:31 EDT 2008


I am using jboss-portletbridge in my application. I have the portletbridge-api-1.0.0.B3.jar and portletbridge-impl-1.0.0.B3.jar in my classpath. When the portlet is deployed in jboss server it gives a ClassCastException.

17:35:40,972 ERROR [STDERR] Caused by: java.lang.ClassCastException: javax.portlet.faces.GenericFacesPortlet 
17:35:40,972 ERROR [STDERR] at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:231) 
17:35:40,972 ERROR [STDERR] ... 73 more 

My web.xml is as follows.

---------------- 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" version="2.5">
  <display-name>Seam Booking Example</display-name>
  <context-param>
        <param-name>javax.portlet.faces.BridgeImplClass</param-name>
        <param-value>org.apache.myfaces.portlet.faces.bridge.BridgeImpl</param-value>
    </context-param>
  
   <context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>
            org.jboss.portletbridge.application.FaceletPortletViewHandler
        </param-value>
  </context-param>
  <context-param>
    <param-name>org.jboss.portletbridge.ExceptionHandler</param-name>
    <param-value>
            org.jboss.portletbridge.SeamExceptionHandlerImpl
        </param-value>
  </context-param>
  <context-param>
     <param-name>javax.faces.LIFECYCLE_ID</param-name>
     <param-value>SEAM_PORTLET</param-value>
  </context-param>
  <context-param>
    <param-name>javax.portlet.faces.renderPolicy</param-name>
    <param-value>ALWAYS_DELEGATE</param-value>
  </context-param>
  <context-param>
    <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
    <param-value>rfRes</param-value>
  </context-param>
  <context-param>
    <param-name>org.richfaces.LoadStyleStrategy</param-name>
    <param-value>DEFAULT</param-value>
  </context-param>
  <context-param>
    <param-name>org.richfaces.LoadScriptStrategy</param-name>
    <param-value>NONE</param-value>
  </context-param>
  <context-param>
    <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
    <param-value>false</param-value>
  </context-param>
  
    <listener-class>
            org.jboss.seam.servlet.SeamListener
        </listener-class>
  
  
    <servlet-name>Seam Resource Servlet</servlet-name>
    <servlet-class>
            org.jboss.seam.servlet.SeamResourceServlet
        </servlet-class>
  
  <servlet-mapping>
    <servlet-name>Seam Resource Servlet</servlet-name>
    <url-pattern>/seam/resource/*</url-pattern>
  </servlet-mapping>
  
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
  
  <filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    FORWARD
    REQUEST
    INCLUDE
  </filter-mapping>
  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
  </context-param>
  <context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>true</param-value>
  </context-param>
  
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.seam</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>10</session-timeout>
  </session-config>
</web-app>

My portlet.xml is as follows 
------------------ portlet.xml ----------------------------------
<portlet-app version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/portlet"
  xmlns="http://java.sun.com/xml/ns/portlet">
  
    <portlet-name>seamFinalPortlet</portlet-name>
    <portlet-class>
      javax.portlet.faces.GenericFacesPortlet
    </portlet-class>

    <init-param>
      javax.portlet.faces.defaultViewId.view
      /index.html
    </init-param>
    <init-param>
      javax.portlet.faces.preserveActionParams
      true
    </init-param>
    <expiration-cache>-0</expiration-cache>
    <portlet-info>
       Seam Final Example Portlet
    </portlet-info>
    
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
    
  
</portlet-app>

--------------------- portlet-instance.xml ---------------
<?xml version="1.0" encoding="utf-8" standalone="yes"?>

	
		
			<instance-id>SeamFinalPortletInstance</instance-id>
			<portlet-ref>seamFinalPortlet</portlet-ref>
		
	
	
		
			<instance-id>SeamFinalPortletSecondInstance</instance-id>
			<portlet-ref>seamFinalPortlet</portlet-ref>
		
	



-------------------- *-object.xml --------------------------------
<?xml version="1.0" encoding="UTF-8"?>

  
    <parent-ref>default</parent-ref>
    <if-exists>overwrite</if-exists>
    
      <instance-name>SeamFinalPortletInstance</instance-name>
      <component-ref>seamFinalPortletApp.seamFinalPortlet</component-ref>
    
  
  
     <parent-ref>default</parent-ref>
     <if-exists>overwrite</if-exists>
     
  	<page-name>SeamTesting</page-name>
        
            <window-name>seamBookingPortletWindow</window-name>
            <instance-ref>SeamFinalPortletInstance</instance-ref>
            center
            0
            <initial-window-state>maximized</initial-window-state>
            
               
                  theme.renderSetId
                  emptyRenderer
                
            
      
    
  


------------------------------------------------------------------------------------

I have build my sample app based on an exmaple provided by the portlet bridge download. The exmple contains a EAR file which when deployed in Jboss works but if I deploy just the portlet war file in Jboss it doesnt work... 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167498#4167498

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167498



More information about the jboss-user mailing list