1 Reply Latest reply on Feb 26, 2007 5:14 PM by Thomas Heute

    Apache JSF Bridge - No content type defined

    Larry Compton Newbie

      I'm having problems getting a JSF portlet to run using the Apache Portals JSF Bridge. I'm using JBoss Portal 2.6 ALPHA 2. The configuration files are found below. The JSF application is very simple. It consists of two pages that contain command links to each other. Any help would be appreciated.

      Error:

      20:35:17,673 ERROR [CommandFilter] Exception in command invocation
      org.apache.jasper.JasperException: No content type defined
       at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.portal.portlet.impl.jsr168.PortletRequestDispatcherImpl.execute(PortletRequestDispatcherImpl.java:85)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.portal.server.servlet.CommandFilter.doFilter(CommandFilter.java:66)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
       at org.jboss.portal.portlet.impl.jsr168.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:106)
       at org.apache.portals.bridges.jsf.PortletExternalContextImpl.dispatch(PortletExternalContextImpl.java:409)
       at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
       at org.apache.portals.bridges.jsf.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:132)
       at org.apache.portals.bridges.jsf.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:132)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
       at org.apache.portals.bridges.jsf.FacesPortlet.process(FacesPortlet.java:455)
       at org.apache.portals.bridges.jsf.FacesPortlet.doView(FacesPortlet.java:277)
       at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:133)
       at javax.portlet.GenericPortlet.render(GenericPortlet.java:306)
      


      portlet.xml excerpt:
       <portlet>
       <init-param>
       <name>default-view</name>
       <value>/sample-jsf/main.jsp</value>
       </init-param>
       <init-param>
       <name>ViewPage</name>
       <value>/sample-jsf/main.jsp</value>
       </init-param>
       <portlet-name>JSFBridgePortlet</portlet-name>
       <portlet-class>
       org.apache.portals.bridges.jsf.FacesPortlet
       </portlet-class>
      
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       <portlet-mode>EDIT</portlet-mode>
       </supports>
      
       <portlet-info>
       <title>JSF Bridge Portlet</title>
       </portlet-info>
       </portlet>
      


       <deployment>
       <instance>
       <instance-id>JSFBridgePortletInstance</instance-id>
       <portlet-ref>JSFBridgePortlet</portlet-ref>
       </instance>
       </deployment>
      


      <deployments>
       <deployment>
       <if-exists>overwrite</if-exists>
       <parent-ref>default.default</parent-ref>
       <window>
       <window-name>JSFBridgePortletWindow</window-name>
       <instance-ref>JSFBridgePortletInstance</instance-ref>
       <region>center</region>
       <height>1</height>
       </window>
       </deployment>
      </deployments>
      


      faces-config.xml:
      <?xml version="1.0"?>
      <!DOCTYPE faces-config PUBLIC
       "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
       "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
      <faces-config>
       <navigation-rule>
       <navigation-case>
       <from-action>main</from-action>
       <to-view-id>/sample-jsf/main.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      
       <navigation-rule>
       <navigation-case>
       <from-action>results</from-action>
       <to-view-id>/sample-jsf/results.jsp</to-view-id>
       </navigation-case>
       </navigation-rule>
      </faces-config>