Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Jimzhou  
#1 Posted : Wednesday, July 23, 2008 6:54:58 PM(UTC)
Jimzhou

Rank: Newbie

Groups: Member
Joined: 7/23/2008(UTC)
Posts: 1

System windows xp sp2
Tomcat 5.0.24
JDK jdk1.5.0_08


exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /BasicDemo/upload.jsp

Generated servlet error:
[javac] Compiling 1 source file

D:\soft\webserver\Tomcat5\work\Catalina\localhost\imageUpload\org\apache\jsp\BasicDemo\upload_jsp.java:54: ?????
??? ?? getFeature(java.lang.String,java.lang.String)
??? ?? org.w3c.dom.DOMImplementation
DOMImplementationLS implementationLS = (DOMImplementationLS) implementation.getFeature("LS", "3.0");
^
???D:\soft\webserver\Tomcat5\work\Catalina\localhost\imageUpload\org\apache\jsp\BasicDemo\upload_jsp.java ?????????? API?
?????????????? -Xlint:deprecation ?????
???D:\soft\webserver\Tomcat5\work\Catalina\localhost\imageUpload\org\apache\jsp\BasicDemo\upload_jsp.java ???????????????
?????????????? -Xlint:unchecked ?????
1 ??


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:306)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:398)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
Fedor  
#2 Posted : Sunday, July 27, 2008 6:24:28 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,572

Thanks: 5 times
Was thanked: 64 time(s) in 63 post(s)
I need to install Tomcat 5.x to reproduce the problem. I will do it tomorrow and let you know about the results.
Best regards,
Fedor Skvortsov
Fedor  
#3 Posted : Saturday, August 2, 2008 12:34:05 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,572

Thanks: 5 times
Was thanked: 64 time(s) in 63 post(s)
I am sorry for delays. I have installed Tomcat 5.5 and can not reproduce the problem.

The only change I have done to run the sample on Tomcat 5.5 is in gallery.jsp:

Code:
org.w3c.dom.Document descriptions = builder.parse(absGalleryPath + File.separator + "Descriptions.xml");


to:

Code:
org.w3c.dom.Document descriptions = builder.parse("file:///" + absGalleryPath + File.separator + "Descriptions.xml");


I will install version 5.1 and check on it.

Best regards,
Fedor Skvortsov
Fedor  
#4 Posted : Monday, August 18, 2008 9:55:20 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,572

Thanks: 5 times
Was thanked: 64 time(s) in 63 post(s)
I am sorry for a long answer. Just open upload.jsp file and modify saveXml method:

Code:
private void saveXml(Document document, String path) throws IOException {
/*    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) implementation.getFeature("LS", "3.0");
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
*/

    // use specific Xerces class to write DOM-data to a file:
    org.apache.xml.serialize.XMLSerializer serializer = new org.apache.xml.serialize.XMLSerializer();
    serializer.setOutputCharStream(
      new java.io.FileWriter(path));
    serializer.serialize(document);
}
Best regards,
Fedor Skvortsov
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.