ParsingException: nested TokenStreamException: antlr.TokenStreamIOException

[nobr]hi,

i am getting this parsing exception whenver i add some html code to my jsp. i am placing my jsp.

<%--

<%@ page language="java" contentType="text/html; charset=UTF-8" %>

<%-- Imports the relevant KLI classes --%>

<%@ pageimport ="com.wk.kli.*"%>

<%-- Include the userAuthorization page to authorize the user --%>

<%@ include file="/include/userAuthorization.jsp" %>

<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html lang ="en">

<!-- This includes header in the current jsp page. -->

<jsp:include page ='<%= KLIPortalConst.JSPFiles.HEADER_PAGE %>'

flush ="true"/>

<jsp:include page ='<%= KLIPortalConst.JSPFiles.GLOBALNAV_PAGE %>'

flush ="true"/>

<head>

<meta http-equiv=Content-Type content="text/html; charset=windows-1252">

<meta name=ProgId content=Word.Document>

<meta name=Generator content="Microsoft Word 11">

<meta name=Originator content="Microsoft Word 11">

<link rel=File-List

href="Terms%20and%20Conditions%20Litigation.com%20v.%20Feb%202007_files/filelist.xml">

<title>General Terms & Conditions</title>

</head>

<body link=blue vlink=purple style='tab-interval:36.0pt'>

<div class=Section1>

<p class=MsoNormal align=center style='text-align:center'><span lang=EN-GB

style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Trebuchet MS"'> </span>

<p class=MsoNormal align=center style='text-align:center'><span lang=EN-GB

style='font-size:14.0pt;mso-bidi-font-size:10.0pt;font-family:"Trebuchet MS"'> </span>

<p class=MsoNormal align=left style='text-align:left'><span lang=EN-GB

style='font-size:12.0pt;font-family:"Trebuchet MS"'>Terms and Conditions: <a

href="http://www.kluwerlitigation.com/">www.KluwerLitigation.com</a> </span>

<p class=MsoNormal><span lang=EN-GB style='font-family:"Trebuchet MS"'> </span>

</div>

<span lang=EN-GB style='font-size:8.0pt;mso-bidi-font-size:10.0pt;font-family:

"Trebuchet MS";mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:

"Times New Roman";mso-ansi-language:EN-GB;mso-fareast-language:EN-US;

mso-bidi-language:AR-SA'><br clear=all >

</span>

</div>

</body>

</html>

whenever i place this html code in this jsp , i am getting parsing exception. please suggest .

<div class=Section2>

<h3><span lang=EN-GB style='font-family:"Trebuchet MS"'>1.<span

style='mso-tab-count:1'></span>APPLICABILITY AND DEFINITIONS</span></h3>

<p class=dgindent align=left style='text-align:left'><span lang=EN-GB

style='font-family:"Trebuchet MS"'>1.1 The Agreement means the agreement

between on the one hand Kluwer Law International bv ( 揕icensor? and on the

other hand the customer (揕icensee? on the basis of the Order Form as defined

herein, the Acceptance as defined herein and the present Terms and Conditions.

The Terms and Conditions shall apply on any offer or agreement with the

exclusion of any terms and conditions used by the Licensee.</span>

</div>

Message was edited by:

bobz[/nobr]

[4557 byte] By [bobza] at [2007-11-26 22:40:27]
«« Sorting
»» Sorting
# 1
I'm guessing these double quotes might be the problem : 揕icensor?they don't look like the double quotes you find on the keyboard, try replacing them in both Licensor and Licensee text. Also post the full stack trace of the exception. Look in the log files.
appy77a at 2007-7-10 11:54:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

here is the stack trace

Error 500--Internal Server Error

weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamIOException

at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:965)

at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)

at weblogic.servlet.jsp.JspParser.parse(JspParser.java:230)

at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)

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

at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:367)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:223)

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

at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:518)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:362)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at com.wk.kli.user.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:135)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6356)

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

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

at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)

at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)

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

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

bobza at 2007-7-10 11:54:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

A few people on the Weblogic forum have posted solutions to this Exception:

http://forums.bea.com/bea/message.jspa?messageID=600006505&tstart=0

As I've mentioned before , I think the *special double quotes* , instead of the normal double quotes found on the keyboard -- might be the cause of this Exception. Did you try removing them from the message?

Check for any other unacceptible special characters.

Usually when you copy text from a Rich Text Editor like MS Word in inserts those special characters which cause problems in parsing.

You can either replace them with normal characters found on the keyboard or use entity references.

A similar reply is posted here also:

http://www.webdeveloper.com/forum/showthread.php?t=142700

appy77a at 2007-7-10 11:54:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
i have removed this line of code from the jsp. its working very fine though i dont know the exact reasoning for this.<%@ page language="java" contentType="text/html; charset=UTF-8" %>
bobza at 2007-7-10 11:54:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
And what about this line at the very top?<%--
BalusCa at 2007-7-10 11:54:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...