File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Jsp Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp Error" Watch "Jsp Error" New topic

Jsp Error

Asim Aryabhatta

Joined: Dec 16, 2011
Posts: 1
Hello All,

I am getting the below error while trying to run the jsp file?

The Error I am getting is: PWC6260: Invalid byte 1 of 1-byte UTF-8 sequence.
at org.apache.jasper.xmlparser.UTF8Reader.invalidByte(
at org.apache.jasper.xmlparser.XMLEncodingDetector.load(
at org.apache.jasper.xmlparser.XMLEncodingDetector.skipString(
at org.apache.jasper.xmlparser.XMLEncodingDetector.scanXMLDecl(
at org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(
at org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(
at org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(
at org.apache.jasper.compiler.ParserController.doParse(
at org.apache.jasper.compiler.ParserController.parse(
at org.apache.jasper.compiler.Parser.processIncludeDirective(
at org.apache.jasper.compiler.Parser.parseIncludeDirective(
at org.apache.jasper.compiler.Parser.parseDirective(
at org.apache.jasper.compiler.Parser.parseElements(
at org.apache.jasper.compiler.Parser.parse(
at org.apache.jasper.compiler.ParserController.doParse(
at org.apache.jasper.compiler.ParserController.parse(
at org.apache.jasper.compiler.Compiler.generateJava(
at org.apache.jasper.compiler.Compiler.compile(
at org.apache.jasper.JspCompilationContext.compile(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.StandardWrapper.service(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardPipeline.doInvoke(
at org.apache.catalina.core.StandardPipeline.invoke(
at com.sun.enterprise.web.WebPipeline.invoke(
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.doService(
at org.apache.catalina.connector.CoyoteAdapter.service(
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(
at com.sun.grizzly.http.ProcessorTask.doProcess(
at com.sun.grizzly.http.ProcessorTask.process(
at com.sun.grizzly.http.DefaultProtocolFilter.execute(
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(
at com.sun.grizzly.DefaultProtocolChain.execute(
at com.sun.grizzly.DefaultProtocolChain.execute(
at com.sun.grizzly.http.HttpProtocolChain.execute(
at com.sun.grizzly.ProtocolChainContextTask.doCall(
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(
at com.sun.grizzly.util.AbstractThreadPool$

Please help...

Suraj Jadhav

Joined: Mar 10, 2010
Posts: 25
I think instead of writing this code in JSP you can also make it as html file. But to resolve your error try removing line no 5 if there is not a requirement of specific encoding type(UTF-8). Also check your respective xml configuration file because from the exception it look like error is getting while parsing xml file.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

Why on earth would you be trying to set the content type of an HTML page to "image/gif"?

[Asking smart questions] [About Bear] [Books by Bear]
Stefan Evans

Joined: Jul 06, 2005
Posts: 1518
The actual error is caused because you are using <%@ include %> to include an image file.
Your computer happily does this, tries to parse the result as a JSP page, and understandably spits the dummy after finding binary crap in there.

If you want to serve a web page with an embedded image, use the html <img> tag to include the image rather than <%@ include %>

If you want to serve an image, use an ImageServlet rather than a JSP, as the text a JSP sends will just corrupt the binary data of the image.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

And only send the image data -- you can't mix HTML and image data as you are trying to do here. What's the intent of that?
I agree. Here's the link:
subject: Jsp Error
It's not a secret anymore!