JSTL, WLS 8.1 and UTF-8 problem - Weblogic

This is a discussion on JSTL, WLS 8.1 and UTF-8 problem - Weblogic ; Hi, I am using JSTL with WLS 8.1 SP1 on Windows 2000. I am getting the error "The taglib validator rejected the page: java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence." whenever I view a page with JSTL tags in ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: JSTL, WLS 8.1 and UTF-8 problem

  1. JSTL, WLS 8.1 and UTF-8 problem


    Hi,

    I am using JSTL with WLS 8.1 SP1 on Windows 2000. I am getting the error "The
    taglib validator rejected the page: java.io.UTFDataFormatException: Invalid byte
    1 of 1-byte UTF-8 sequence." whenever I view a page with JSTL tags in it.

    I am not sure why this is happening, the same code works on Tomcat fine.

    Thanks in advance,

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

    #### '13' for queue: 'weblogic.kernel.Default'> <> <> <[ServletContext(id=8072489,name=/,context-path=)]
    /*: init>

    #### '13' for queue: 'weblogic.kernel.Default'> <> <> <[ServletContext(id=8072489,name=/,context-path=)]
    /*: Using standard I/O>

    #### '13' for queue: 'weblogic.kernel.Default'> <> <> <[ServletContext(id=8072489,name=/,context-path=)]
    resolved taglib uri 'http://java.sun.com/jstl/core' to taglib-location /WEB-INF/tags/c.tld:>

    #### '13' for queue: 'weblogic.kernel.Default'> <> <> <[ServletContext(id=8072489,name=/,context-path=)]
    Servlet failed with IOException

    java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected
    the page: "java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.,
    "

    at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.jav a:125)

    at weblogic.utils.compiler.CodeGenerator.generate(Cod eGenerator.java:258)

    at weblogic.servlet.jsp.JspStub.compilePage(JspStub.j ava:364)

    at weblogic.servlet.jsp.JspStub.prepareServlet(JspStu b.java:220)

    at weblogic.servlet.jsp.JspStub.prepareServlet(JspStu b.java:172)

    at weblogic.servlet.internal.ServletStubImpl.getServl et(ServletStubImpl.java:504)

    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:349)

    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:431)

    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:305)

    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6310)

    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)

    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)

    at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3622)

    at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2569)

    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)

    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)

    >




  2. Re: JSTL, WLS 8.1 and UTF-8 problem

    Whats the pageEncoding/contentType charset of the jsp? Are you using any
    specific one? Can you post a sample jsp as a reproducer. Looks like the
    default encoding of the xml parser being utf-8 is causing some issue here..

    --
    Nagesh

    "Burak Bayramli" wrote in message
    news:3f4c3273$1@newsgroups.bea.com...
    >
    > Hi,
    >
    > I am using JSTL with WLS 8.1 SP1 on Windows 2000. I am getting the error

    "The
    > taglib validator rejected the page: java.io.UTFDataFormatException:

    Invalid byte
    > 1 of 1-byte UTF-8 sequence." whenever I view a page with JSTL tags in it.
    >
    > I am not sure why this is happening, the same code works on Tomcat fine.
    >
    > Thanks in advance,
    >
    > -------------------------
    >
    > ####


    > '13' for queue: 'weblogic.kernel.Default'> <> <>
    <[ServletContext(id=8072489,name=/,context-path=)]
    > /*: init>
    >
    > ####


    > '13' for queue: 'weblogic.kernel.Default'> <> <>
    <[ServletContext(id=8072489,name=/,context-path=)]
    > /*: Using standard I/O>
    >
    > ####


    > '13' for queue: 'weblogic.kernel.Default'> <> <>
    <[ServletContext(id=8072489,name=/,context-path=)]
    > resolved taglib uri 'http://java.sun.com/jstl/core' to taglib-location

    /WEB-INF/tags/c.tld:>
    >
    > ####


    > '13' for queue: 'weblogic.kernel.Default'> <> <>
    <[ServletContext(id=8072489,name=/,context-path=)]
    > Servlet failed with IOException
    >
    > java.io.IOException: javax.servlet.jsp.JspException: The taglib validator

    rejected
    > the page: "java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8

    sequence.,
    > "
    >
    > at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.jav a:125)
    >
    > at

    weblogic.utils.compiler.CodeGenerator.generate(Cod eGenerator.java:258)
    >
    > at weblogic.servlet.jsp.JspStub.compilePage(JspStub.j ava:364)
    >
    > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStu b.java:220)
    >
    > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStu b.java:172)
    >
    > at

    weblogic.servlet.internal.ServletStubImpl.getServl et(ServletStubImpl.java:50
    4)
    >
    > at

    weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java
    :349)
    >
    > at

    weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java
    :431)
    >
    > at

    weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java
    :305)
    >
    > at

    weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(W
    ebAppServletContext.java:6310)
    >
    > at

    weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubjec
    t.java:317)
    >
    > at

    weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
    >
    > at

    weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletCo
    ntext.java:3622)
    >
    > at

    weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java
    :2569)
    >
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    >
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    >
    > >

    >
    >




  3. Re: JSTL, WLS 8.1 and UTF-8 problem



    Sorry for misunderstanding, let me try again. The encoding trick seems to have
    fixed UTF-8 sequence error. Now I have a different error (progressing down the
    line of errors ), and I looked up this one seperately, for which everyone
    seems to suggest the fix is in CR094190.

    Thanks for the encoding mapping info, I will use it.

    BTW: WL pages suggest that SP2 (which contains CR094190) is not out yet. How do
    we get this patch? Can reverting back to WL version 7 fix the problem?

    Thanks,

    Nagesh Susarla wrote:
    >Burak Bayramli wrote:
    >
    >> Naesh, thanks for the insight. This snippet below "kind of fixed" the

    >problem,
    >> although the problem becomes something else, this new problem apparently

    >is addressed
    >> under patch CR094190.
    >>
    >> <%@ page language="java" contentType="text/html; charset=ISO-8859-9"
    >> pageEncoding="ISO-8859-9"
    >> %>
    >>
    >> Regards,
    >>
    >> "Nagesh Susarla" wrote:
    >>
    >>>Whats the pageEncoding/contentType charset of the jsp? Are you using
    >>>any
    >>>specific one? Can you post a sample jsp as a reproducer. Looks like

    >the
    >>>default encoding of the xml parser being utf-8 is causing some issue
    >>>here..
    >>>

    >
    >I'm not sure CR094190 fixes the issue in question. It seems like when
    >
    >you add an encoding (via pageEncoding or contentType charset) the xml
    >
    >stream passed to the TagLibValidator.validate() is encoded in UTF-8
    >which is the default for the xml parsers (if not specified). If you have
    >
    >characters other than ISO-8859-1 on your page then the pageEncoding
    >needs to be specified failing which the xml stream will be corrupted.
    >
    >(Even if this phase were to pass, somewhere down the line the response
    >
    >to the browser may be incorrect since it assumes iso-8859-1 instead of
    >
    >iso-8859-9 in your case)
    >
    >Aside: If you feel its too cumbersome to add this pageEncoding to each
    >
    >page then you can globally map an encoding to all jsps in the weblogic.xml
    >
    >
    >
    > encoding
    > ISO-8859-9
    >

    >

    >--
    >Nagesh
    >



+ Reply to Thread