title: Liferay portlet deployment - class cast exception
body: <p>I am new to portlets and I am trying to build one from my JSF 2.0 app. I am using liferay-portal-tomcat-6.1.0-ce-b4, JSF 2.1.3 and PortletFaces bridge 2.0.1.</p>
  
  <p>When I try to install the portlet into liferay, I allways get the following exception and I really dont know why, because according to the documentation, the org.portletfaces.bridge.GenericFacesPortlet shoult implement portlet interface...</p>
  
  <blockquote>
    <p>09:31:31,709 ERROR [HotDeployUtil:114]
    com.liferay.portal.kernel.deploy.hot.HotD eployException: Error
    registering portlets for MondisVisualizer-1.3-SNAPSHOT
    com.liferay.portal.kernel.deploy.hot.HotDeployException: Error
    registering portl ets for MondisVisualizer-1.3-SNAPSHOT
            at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDe
    ployException(BaseHotDeployListener.java:46)
            at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(P
    ortletHotDeployListener.java:117)
            at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent
    (HotDeployUtil.java:111)
            at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(H
    otDeployUtil.java:188)
            at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(Ho
    tDeployUtil.java:40)
            at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit
    (PortletContextListener.java:101)
            at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePor
    talLifecycle.java:42)
            at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLif
    ecycleUtil.java:61)
            at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLif
    ecycleUtil.java:53)
            at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLife
    cycle(BasePortalLifecycle.java:50)
            at com.liferay.portal.kernel.servlet.PortletContextListener.contextIniti
    alized(PortletContextListener.java:55)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
    t.java:4723)
            at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:
    5226)
            at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:
    5221)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
    utor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:908)
            at java.lang.Thread.run(Thread.java:619) <strong>Caused by: java.lang.ClassCastException: org.portletfaces.bridge.GenericFacesPor
    tlet cannot be cast to javax.portlet.Portlet</strong>
            at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:1
    31)
            at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(Po
    rtletHotDeployListener.java:603)
            at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy
    (PortletHotDeployListener.java:385)
            at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(P
    ortletHotDeployListener.java:114)
            ... 17 more</p>
  </blockquote>
  
  <p>portlet.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
      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"&gt;
      &lt;portlet&gt;
          &lt;portlet-name&gt;Visualizer&lt;/portlet-name&gt;
          &lt;portlet-class&gt;org.portletfaces.bridge.GenericFacesPortlet&lt;/portlet-class&gt;
          &lt;init-param&gt;
              &lt;name&gt;javax.portlet.faces.defaultViewId.view&lt;/name&gt;
              &lt;value&gt;/index.xhtml&lt;/value&gt;
          &lt;/init-param&gt;
          &lt;supports&gt;
              &lt;mime-type&gt;text/html&lt;/mime-type&gt;
              &lt;portlet-mode&gt;view&lt;/portlet-mode&gt;
          &lt;/supports&gt;
          &lt;portlet-info&gt;
              &lt;title&gt;Mondis Visualizer&lt;/title&gt;
          &lt;/portlet-info&gt;
      &lt;/portlet&gt;
  &lt;/portlet-app&gt;
  </code></pre>
  
  <p>liferay-portlet.xml:</p>
  
  <pre><code>&lt;liferay-portlet-app&gt;
      &lt;portlet&gt;
          &lt;portlet-name&gt;Visualizer&lt;/portlet-name&gt;
          &lt;instanceable&gt;true&lt;/instanceable&gt;
          &lt;remoteable&gt;false&lt;/remoteable&gt;
          &lt;ajaxable&gt;false&lt;/ajaxable&gt;
          &lt;!-- &lt;header-portlet-css&gt;/resources/styles/bookCatalog.css&lt;/header-portlet-css&gt;
          &lt;header-portlet-javascript&gt;/resources/scripts/jsf.js&lt;/header-portlet-javascript&gt; --&gt;
      &lt;/portlet&gt;
  &lt;/liferay-portlet-app&gt;
  </code></pre>
  
  <p>liferay-display.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.0.0//EN" "http://www.liferay.com/dtd/liferay-display_6_0_0.dtd"&gt;
  
   &lt;display&gt;
      &lt;category name="category.mondis.visualizer"&gt;
          &lt;portlet id="Visualizer" /&gt;
      &lt;/category&gt;
   &lt;/display&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>