2 Replies Latest reply on Jul 30, 2008 1:43 AM by Milind Paranjape

    How to deploy a Seam Portlet?

    Milind Paranjape Newbie

      Can any one help me with deploying a seam portlet? I am trying to develope a portlet using Seam and I get the below stack trace when deployed in jboss-portal-2.6.5.

      17:35:40,925 INFO [PortletAppDeployment] Parsing /FinalSeamTesting/jboss-portlet.xml
      17:35:40,956 ERROR [STDERR] org.jboss.portal.portlet.container.PortletInitializationException: The portlet seamFinalPortlet threw a runtime exception during init
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:264)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.portlet.impl.container.PortletApplicationContextImpl.startPortletApplication(PortletApplicationContextImpl.java:135)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.portlet.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:151)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.core.deployment.jboss.PortletAppDeployment.start(PortletAppDeployment.java:96)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.server.deployment.jboss.DeploymentContext.start(DeploymentContext.java:99)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.server.deployment.jboss.PortalDeploymentInfoContext.start(PortalDeploymentInfoContext.java:211)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.server.deployment.jboss.ServerDeployer.start(ServerDeployer.java:217)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      17:35:40,972 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor243.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      17:35:40,972 ERROR [STDERR] at $Proxy214.deploy(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.server.deployment.jboss.ServerDeployer.deploy(ServerDeployer.java:259)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.server.deployment.WebAppAdapter.deploy(WebAppAdapter.java:53)
      17:35:40,972 ERROR [STDERR] at org.jboss.portal.server.deployment.WebAppIntercepter.handleNotification(WebAppIntercepter.java:159)
      17:35:40,972 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
      17:35:40,972 ERROR [STDERR] at $Proxy216.handleNotification(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadcasterSupport.java:127)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcasterSupport.java:108)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:340)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:308)
      17:35:40,972 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:482)
      17:35:40,972 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      17:35:40,972 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      17:35:40,972 ERROR [STDERR] at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      17:35:40,972 ERROR [STDERR] at $Proxy195.start(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      17:35:40,972 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at java.lang.reflect.Method.invoke(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      17:35:40,972 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      17:35:40,972 ERROR [STDERR] at $Proxy9.deploy(Unknown Source)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      17:35:40,972 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      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
      17:35:40,972 INFO [PortletAppDeployment] These instances have been found in -object.xml, you should put them in the file D:\Softwares\Jboss\App Server\jboss-portal-2.6.5.SP1-bundled\jboss-portal-2.6.5.SP1\server\default\.\tmp\deploy\tmp33856FinalSeamTesting-exp.war\WEB-INF/portlet-instances.xml
      17:35:40,972 INFO [PortletAppDeployment] <?xml version="1.0" encoding="utf-8" standalone="yes"?>



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


        • 1. Re: How to deploy a Seam Portlet?
          Egor Kolesnikov Newbie

          you should use jboss-portletbridge to develop SEAM portlets. http://www.jboss.org/portletbridge/

          • 2. Re: How to deploy a Seam Portlet?
            Milind Paranjape Newbie

            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...