• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Xalan2 example?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i run a servlet example but couldn't work the error is as follows: -
java.lang.IncompatibleClassChangeError: Unimplemented interface method
at org.apache.xalan.processor.XSLTSchema.class$(XSLTSchema.java:69)
at org.apache.xalan.processor.XSLTSchema.build(XSLTSchema.java:253)
at org.apache.xalan.processor.XSLTSchema.(XSLTSchema.java:77)
at org.apache.xalan.processor.StylesheetHandler.(StylesheetHandler.java:1228)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplatesHandler(TransformerFactoryImpl.java:434)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:742)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:669)
at invoice.service(invoice.java:33)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java)
at org.apache.tomcat.core.Handler.service(Handler.java)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java)
at java.lang.Thread.run(Thread.java)
and my servlet code are:-
import java.io.*;
public class invoice extends javax.servlet.http.HttpServlet {
// Respond to HTTP GET requests from browsers.
public void service (javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws javax.servlet.ServletException, java.io.IOException
{
// Set content type for HTML.
response.setContentType("text/html; charset=UTF-8");
// Output goes to the response PrintWriter.
java.io.PrintWriter out = response.getWriter();
File fo1 = new File("/home/darryl/invoice.xml");
File fo2 = new File("/home/darryl/invoice.xsl");
try
{
javax.xml.transform.TransformerFactory tFactory =
javax.xml.transform.TransformerFactory.newInstance();
// Get the XML input document and the stylesheet, both in the servlet
// engine document directory.
javax.xml.transform.Source xmlSource =
new javax.xml.transform.stream.StreamSource(fo1);
// (new
// FileInputStream("/home/osbmaster/www/invoice/invoice.xml"));
javax.xml.transform.Source xslSource =
new javax.xml.transform.stream.StreamSource(fo2);
// (new
// FileInputStream("/home/osbmaster/www/invoice/invoice.xsl"));
// Generate the transformer.
javax.xml.transform.Transformer transformer = tFactory.newTransformer(xslSource);
// Perform the transformation, sending the output to the response.
transformer.transform(xmlSource,
new javax.xml.transform.stream.StreamResult(out));
}
// If an Exception occurs, return the error to the client.
catch (Exception e)
{
out.write(e.getMessage());
e.printStackTrace(out);
}
// Close the PrintWriter.
out.close();
}
}
~~
Can anybody tell me wat's wrong with the servlet code above?
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try moving the jar files to JREROOT\lib\ext directory.
 
Darryl Andrew
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i'm using manta Linux, and can't find the JRE/lib/root directory. Pls help. Thanx.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You have a previous version of the JDK installed.
Get the latest version of java1.2 from SUN.
Sukumar

Originally posted by Darryl Andrew:
Hi, i run a servlet example but couldn't work the error is as follows: -
java.lang.IncompatibleClassChangeError: Unimplemented interface method
at org.apache.xalan.processor.XSLTSchema.class$(XSLTSchema.java:69)
at org.apache.xalan.processor.XSLTSchema.build(XSLTSchema.java:253)
at org.apache.xalan.processor.XSLTSchema.(XSLTSchema.java:77)
at org.apache.xalan.processor.StylesheetHandler.(StylesheetHandler.java:1228)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplatesHandler(TransformerFactoryImpl.java:434)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:742)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:669)
at invoice.service(invoice.java:33)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java)
at org.apache.tomcat.core.Handler.service(Handler.java)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java)
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java)
at java.lang.Thread.run(Thread.java)
and my servlet code are:-
import java.io.*;
public class invoice extends javax.servlet.http.HttpServlet {
// Respond to HTTP GET requests from browsers.
public void service (javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
throws javax.servlet.ServletException, java.io.IOException
{
// Set content type for HTML.
response.setContentType("text/html; charset=UTF-8");
// Output goes to the response PrintWriter.
java.io.PrintWriter out = response.getWriter();
File fo1 = new File("/home/darryl/invoice.xml");
File fo2 = new File("/home/darryl/invoice.xsl");
try
{
javax.xml.transform.TransformerFactory tFactory =
javax.xml.transform.TransformerFactory.newInstance();
// Get the XML input document and the stylesheet, both in the servlet
// engine document directory.
javax.xml.transform.Source xmlSource =
new javax.xml.transform.stream.StreamSource(fo1);
// (new
// FileInputStream("/home/osbmaster/www/invoice/invoice.xml"));
javax.xml.transform.Source xslSource =
new javax.xml.transform.stream.StreamSource(fo2);
// (new
// FileInputStream("/home/osbmaster/www/invoice/invoice.xsl"));
// Generate the transformer.
javax.xml.transform.Transformer transformer = tFactory.newTransformer(xslSource);
// Perform the transformation, sending the output to the response.
transformer.transform(xmlSource,
new javax.xml.transform.stream.StreamResult(out));
}
// If an Exception occurs, return the error to the client.
catch (Exception e)
{
out.write(e.getMessage());
e.printStackTrace(out);
}
// Close the PrintWriter.
out.close();
}
}
~~
Can anybody tell me wat's wrong with the servlet code above?


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic