Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with XALAN under JRun 3.0 1

Status
Not open for further replies.

thebigf

Programmer
Dec 12, 2000
14
AT
I'm writting the ordering system of an e-shop. All orders are in XML. I'm using the XALAN package with my JSP to transform XML with XSL. The result is sent via email.

Everything works great as an application, or as a JSP in tomcat. But we use JRun for our shop (because tomcat does not support filtering/chaining). And there I get the following:

javax.xml.transform.TransformerConfigurationException: Namespace not supported by SAXParser
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:749)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:601)
at com.anecon.xmltools.TodoListUtils.getTransformationResult(TodoListUtils.java:37)
at jrun__ExecTodoList2ejsp11._jspService(jrun__ExecTodoList2ejsp11.java:59)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
---------
org.xml.sax.SAXException: Namespace not supported by SAXParser
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:714)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:601)
at com.anecon.xmltools.TodoListUtils.getTransformationResult(TodoListUtils.java:37)
at jrun__ExecTodoList2ejsp11._jspService(jrun__ExecTodoList2ejsp11.java:59)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
---------
javax.xml.parsers.ParserConfigurationException: Namespace not supported by SAXParser
at com.sun.xml.parser.SAXParserImpl.<init>(SAXParserImpl.java:60)
at com.sun.xml.parser.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:57)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:708)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:601)
at com.anecon.xmltools.TodoListUtils.getTransformationResult(TodoListUtils.java:37)
at jrun__ExecTodoList2ejsp11._jspService(jrun__ExecTodoList2ejsp11.java:59)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
java.lang.NullPointerException
at javax.mail.internet.MimeUtility.checkAscii(MimeUtility.java:877)
at javax.mail.internet.MimeBodyPart.setText(MimeBodyPart.java:748)
at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1146)
at javax.mail.internet.MimeMessage.setText(MimeMessage.java:1134)
at com.anecon.xmltools.TodoListUtils.sendMsg(TodoListUtils.java:66)
at jrun__ExecTodoList2ejsp11._jspService(jrun__ExecTodoList2ejsp11.java:64)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)


Any help why this is would be great.
thx thebigf
 
The problem is that JRun has an xml-processor and xsl-processor(XT) of it's own that is not compatible with Xalan. I tried to remove the jars from jrun that cointains the xml-related stuff, but then JRun refused to start :) Anyone with better luck?

Mikael Ernholm (mikael.ernholm@sdd.se)
 
Now I've got it up working. Just remove xt.jar in jrun/lib and parser.jar and jaxp.jar int jrun/lib/ext and place xerces.jar(comes with xalan) in jrun/lib/ext, and voila!

Mikael Ernholm(mikael.ernholm@sdd.se)
 
You beauty!

Been trying to figure that one out for a while!

Tiz
 
So Tiz,

Did you get that to work? I just tried it and am still getting the &quot;Namespace not supported by SAXParser&quot; error.

included below is the jsp I'm trying to use as a test

Thanks,
-Scott

<%@ page import=&quot;javax.xml.transform.*;&quot;%>
<%@ page import=&quot;javax.xml.transform.sax.*;&quot;%>
<%@ page import=&quot;javax.xml.transform.stream.*;&quot;%>
<%@ page import=&quot;org.xml.sax.*;&quot;%>

<html>
<head>
<title>Untitled</title>
</head>

<body>
<% // 1. Instantiate the TransformerFactory.
javax.xml.transform.TransformerFactory tFactory =
javax.xml.transform.TransformerFactory.newInstance();
// 2a. Get the stylesheet from the XML source.
String media = null , title = null, charset = null;
javax.xml.transform.Source stylesheet = tFactory.getAssociatedStylesheet
(new StreamSource(&quot;foo.xml&quot;),media, title, charset);

// 2b. Process the stylesheet and generate a Transformer.
Transformer transformer = tFactory.newTransformer(stylesheet);

// 3. Use the Transformer to perform the transformation and send the
// the output to a Result object.
transformer.transform
(new javax.xml.transform.stream.StreamSource(&quot;foo.xml&quot;),
new StreamResult (new java.io.FileOutputStream(&quot;foo.out&quot;)));
%>

<%= &quot;<br>..........................................................&quot; %>
</body>
</html>
 
Hi, i have been looking for the source code to transform my xsl and xml files into html using Xalan.

Thanx alot!!!!!
 
Thanks,

I haven't tried to mess with it since then, I was under the gun on a deadline (built a bugtracker w/ servlets/XSL), and ended up pushing it out with apache/jserv instead of Jrun. I'll go revisit it when I get some free time, I'd rather switch to IIS, since a lot of the intranet apps we have are in ASP and I'd like to run the stuff on the same server.

-Scott
 
I've run into this problem, too, but when I remove the parser.jar and jaxp.jar from the jrun/lib/ext, the servers (admin and default) won't start up.

It appears that JRun and Xalan aren't getting along. :)

Karen Fox
Technical Assistant
kfox@mitre.org
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top