7 Replies Latest reply on Dec 27, 2005 2:32 PM by Maximiliano Carrizo

    java.io.UnsupportedEncodingException: null when using facele

    Suresh Gajulapalli Newbie

      Please help I have this error when using ADF, Seam on JBoss

      com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View
      java.io.UnsupportedEncodingException: null

      I am using JBoss AS 4.0.3SP1, Jboss Seam 1.0beta1, Oracle adf-faces-ea19. My configuration and stack trace is below:

      (1) jboss-4.0.3/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml has:

      <init-param>
       <description>MyFaces TLDs</description>
       <param-name>tagLibJar0</param-name>
       <param-value>jsf-libs/myfaces-impl.jar</param-value>
       </init-param>
       <init-param>
       <description>JSTL TLDs</description>
       <param-name>tagLibJar1</param-name>
       <param-value>jsf-libs/standard.jar</param-value>
       </init-param>
       <init-param>
       <description>ADF Faces TLDs</description>
       <param-name>tagLibJar2</param-name>
       <param-value>jsf-libs/adf-faces-impl-ea19.jar</param-value>
       </init-param>
      

      (2) jboss-4.0.3/server/all/deploy/jbossweb-tomcat55.sar/jsf-libs has

      adf-faces-api-ea19.jar
      adf-faces-impl-ea19.jar
      adfshare-3218.jar
      commons-beanutils.jar
      commons-codec-1.2.jar
      commons-collections.jar
      commons-digester-1.6.jar
      jboss-seam.jar
      jstl.jar
      myfaces-api.jar
      myfaces-impl.jar
      standard.jar


      (adfshare-3218.jar extracted from Oracle's adf-faces-ea19/adf-faces-demo.war. The other two

      adf jars from adf-faces-ea19/lib.)

      On using jbossweb-tomcat55.sar, see JamesWoodward post in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=70681


      (3) WEB.XML

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4"
       xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
      
      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
      
       <context-param>
       <param-name>org.jboss.seam.core.manager.conversationTimeout</param-name>
       <param-value>120000</param-value>
       </context-param>
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       <!--param-value>server</param-value-->
       </context-param>
      
       <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>
       <servlet-name>faces</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>faces</servlet-name>
       <url-pattern>*.jsf</url-pattern>
       </servlet-mapping>
      
       <listener>
      
      
      <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
       </listener>
      
       <context-param>
       <param-name>oracle.adf.view.faces.ALTERNATE_VIEW_HANDLER</param-name>
       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
       </context-param>
      
       <filter>
       <filter-name>adfFaces</filter-name>
       <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>adfFaces</filter-name>
       <servlet-name>faces</servlet-name>
       </filter-mapping>
      
       <servlet>
       <servlet-name>resources</servlet-name>
       <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>resources</servlet-name>
       <url-pattern>/adf/*</url-pattern>
       </servlet-mapping>
      
      </web-app>
      
      


      (4) FACES-CONFIG.XML


      <faces-config>
      
       ... ...
      
       <!-- Using ADF
       <application>
       <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
       </application>
       -->
      
       <application>
       <variable-resolver>
       org.jboss.seam.jsf.SeamVariableResolver
       </variable-resolver>
       </application>
      
       <application>
       <default-render-kit-id>oracle.adf.core</default-render-kit-id>
       </application>
      
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>
      </faces-config>


      (5) Only thing under WEB-INF/lib are el-api.jar, el-ri.jar, jsf-facelets.jar

      (6) The .xtml that gives error is

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html">
      <head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
       <title>My Title</title>
      </head>
      
      <body>
      
       <h:outputText value="hello World" />
      
      </body>
      </html>
      


      (7) The error is

      02:25:36,201 INFO [STDOUT] Dec 3, 2005 2:25:36 AM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View
      java.io.UnsupportedEncodingException: null
       at sun.io.Converters.getConverterClass(Converters.java:218)
       at sun.io.Converters.newConverter(Converters.java:251)
       at sun.io.CharToByteConverter.getConverter(CharToByteConverter.java:68)
       at sun.nio.cs.StreamEncoder$ConverterSE.<init>(StreamEncoder.java:189)
       at sun.nio.cs.StreamEncoder$ConverterSE.<init>(StreamEncoder.java:172)
       at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:72)
       at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:82)
       at org.apache.tomcat.util.buf.WriteConvertor.<init>(C2BConverter.java:167)
       at org.apache.tomcat.util.buf.C2BConverter.<init>(C2BConverter.java:46)
       at org.apache.catalina.connector.OutputBuffer.setConverter(OutputBuffer.java:579)
       at org.apache.catalina.connector.OutputBuffer.checkConverter(OutputBuffer.java:545)
       at org.apache.catalina.connector.Response.getWriter(Response.java:614)
       at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:186)
       at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
       at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
       at com.sun.facelets.FaceletViewHandler.createResponseWriter(FaceletViewHandler.java:374)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:438)
       at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:35
      )
       at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:325)
       at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:190)
       at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       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.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.j
      va:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      02:25:36,201 INFO [STDOUT] Dec 3, 2005 2:25:36 AM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Took Type: org.apache.catalina.connector.CoyoteWriter