You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Iwan Eising <iw...@i-ware.net> on 2000/12/10 05:01:13 UTC

Xalan in servlet, sample doesn't work

Hi,

Environment:
- XalanJ-2
- Tomcat 3.2
- Win2K SP1

I'm trying to get the Servlet sample to work. At the end of this mail I've
put my directory structure.

When I compile and deploy the servlet and I run the servlet using the URL:
http://localhost:8080/xalan2/servlet/ApplyXSLT?URL=/xalan2/Cookies.xml?xslUR
L=/xalan2/cookies.xsl&debug=true, I get an exception. I have no clue as of
why I get this exception. Is the sample correct? Shouldn't I use Tomcat 3.2?

Exception is java.net.ConnectException
2000-12-09 10:55:41 - Ctx( /xalan2 ): 404 R( /xalan2 + /servlet/ApplyXSLT +
null) <B>Connection refused: no further information
<BR>getDocument() resulted in ApplyXSLTException
<BR>debug is true
<BR>Parsing XML Document from request parameter:
http://CC779219-A/xalan2/Cookies.xml?xslURL=/xalan2/cookies.xsl
<BR></B>
<BR> <PRE> java.net.ConnectException: Connection refused: no further
information
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
        at java.net.Socket.<init>(Socket.java:273)
        at java.net.Socket.<init>(Socket.java:100)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:331)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:277)
        at sun.net.www.http.HttpClient.New(HttpClient.java:289)
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:3
79)
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
.java:472)
        at java.net.URL.openStream(URL.java:798)
        at servlet.ApplyXSLT.getDocument(ApplyXSLT.java:388)
        at servlet.ApplyXSLT.process(ApplyXSLT.java:247)
        at servlet.ApplyXSLT.doGet(ApplyXSLT.java:202)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:484)
 </PRE>

Iwan
----------------
Directory-structure

 Directory of C:\tomcat\webapps\xalan2

12/09/2000  10:03p      <DIR>          .
12/09/2000  10:03p      <DIR>          ..
12/09/2000  10:03p                 313 readme.html
12/09/2000  10:03p               1,135 cookies.xsl
12/09/2000  10:03p                 789 Cookies.xml
12/09/2000  10:03p               7,479 default2.xsl
12/09/2000  10:03p              11,935 default.xsl
12/09/2000  10:03p      <DIR>          WEB-INF
12/09/2000  10:03p      <DIR>          javadoc
               5 File(s)         21,651 bytes

 Directory of C:\tomcat\webapps\xalan2\WEB-INF

12/09/2000  10:03p      <DIR>          .
12/09/2000  10:03p      <DIR>          ..
12/09/2000  10:03p               3,911 web.xml
12/09/2000  10:03p      <DIR>          classes
12/09/2000  10:03p      <DIR>          lib
               1 File(s)          3,911 bytes

 Directory of C:\tomcat\webapps\xalan2\WEB-INF\classes

12/09/2000  10:03p      <DIR>          .
12/09/2000  10:03p      <DIR>          ..
12/09/2000  10:04p      <DIR>          servlet
               0 File(s)              0 bytes

 Directory of C:\tomcat\webapps\xalan2\WEB-INF\classes\servlet

12/09/2000  10:04p      <DIR>          .
12/09/2000  10:04p      <DIR>          ..
12/09/2000  10:48p               2,159 ApplyXSLTException.class
12/09/2000  10:48p              15,338 ApplyXSLT.class
12/09/2000  10:48p               2,245 ApplyXSLTProperties.class
12/09/2000  10:48p               1,552 ApplyXSLTListener.class
12/09/2000  10:48p               1,666 OrderedProps.class
12/09/2000  10:48p               1,129 PIA.class
12/09/2000  10:48p               5,307 DefaultApplyXSLTProperties.class
               7 File(s)         29,396 bytes

 Directory of C:\tomcat\webapps\xalan2\WEB-INF\lib

12/09/2000  10:03p      <DIR>          .
12/09/2000  10:03p      <DIR>          ..
12/09/2000  10:03p             653,153 xalan.jar
12/09/2000  10:03p           1,499,244 xerces.jar
               2 File(s)      2,152,397 bytes

 Directory of C:\tomcat\webapps\xalan2\javadoc

12/09/2000  10:03p      <DIR>          .
12/09/2000  10:03p      <DIR>          ..
               0 File(s)              0 bytes

     Total Files Listed:
              15 File(s)      2,207,355 bytes
              17 Dir(s)   1,726,472,192 bytes free

C:\tomcat\webapps\xalan2>


RE: Xalan in servlet, sample doesn't work

Posted by Iwan Eising <iw...@i-ware.net>.
Sorry,

The sample throws the exception in my original mail because Apache wasn't
running properly. Now that it does, I get the following exception:

Exception is org.xml.sax.SAXParseException
2000-12-09 11:39:12 - Ctx( /xalan2 ): 500 R( /xalan2 + /servlet/ApplyXSLT +
null) <B>Exception occurred during ctor/Transformati
on:
<BR>debug is true
<BR>Parsing XML Document from request parameter:
http://CC779219-A/Cookies.xml?xslURL=/default.xsl
<BR>calling getXSLURLfromDoc and getMedia explorer
<BR>Parsing XML Document from request parameter:
http://CC779219-A/Cookies.xml?xslURL=/default.xsl
<BR>Performing transformation...
<BR>File "null" not found.</B>
<BR> <PRE> org.xml.sax.SAXParseException: File "null" not found.
        at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1062)
        at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(Defa
ultEntityHandler.java:499)
        at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:305)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:947)
        at
org.apache.xalan.processor.StylesheetProcessor.process(StylesheetProcessor.j
ava:171)
        at servlet.ApplyXSLT.process(ApplyXSLT.java:293)
        at servlet.ApplyXSLT.doGet(ApplyXSLT.java:202)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
        at java.lang.Thread.run(Thread.java:484)
 </PRE>

Cookies.xml and default.xsl are in the Apache/htdocs directory. So I have no
idea which file could be null.

Cookies.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XML Spy v3.5 NT beta 1 build Nov 10 2000
(http://www.xmlspy.com) by Iwan Eising (private) -->
<Cookies>
	<Cookie>
		<Date>
			<Day>20</Day>
			<Month>11</Month>
			<Year>2000</Year>
		</Date>
		<Text>Friendship Is Not Expecting Anything In Return But Still Getting
It</Text>
		<Category>Misc</Category>
	</Cookie>
</Cookies>

default.xsl is the one provided in the Servlet sample.

Iwan

:> -----Original Message-----
:> From: Iwan Eising [mailto:iwan@i-ware.net]
:> Sent: Saturday, December 09, 2000 11:01 PM
:> To: Xalan-Dev
:> Subject: Xalan in servlet, sample doesn't work
:>
:>
:> Hi,
:>
:> Environment:
:> - XalanJ-2
:> - Tomcat 3.2
:> - Win2K SP1
:>
:> I'm trying to get the Servlet sample to work. At the end of this
:> mail I've
:> put my directory structure.
:>
:> When I compile and deploy the servlet and I run the servlet
:> using the URL:
:> http://localhost:8080/xalan2/servlet/ApplyXSLT?URL=/xalan2/Cookie
:> s.xml?xslUR
:> L=/xalan2/cookies.xsl&debug=true, I get an exception. I have no
:> clue as of
:> why I get this exception. Is the sample correct? Shouldn't I use
:> Tomcat 3.2?
:>
:> Exception is java.net.ConnectException
:> 2000-12-09 10:55:41 - Ctx( /xalan2 ): 404 R( /xalan2 +
:> /servlet/ApplyXSLT +
:> null) <B>Connection refused: no further information
:> <BR>getDocument() resulted in ApplyXSLTException
:> <BR>debug is true
:> <BR>Parsing XML Document from request parameter:
:> http://CC779219-A/xalan2/Cookies.xml?xslURL=/xalan2/cookies.xsl
:> <BR></B>
:> <BR> <PRE> java.net.ConnectException: Connection refused: no further
:> information
:>         at java.net.PlainSocketImpl.socketConnect(Native Method)
:>         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
:>         at
:> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
:>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
:>         at java.net.Socket.<init>(Socket.java:273)
:>         at java.net.Socket.<init>(Socket.java:100)
:>         at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
:>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:331)
:>         at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
:>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
:>         at sun.net.www.http.HttpClient.<init>(HttpClient.java:277)
:>         at sun.net.www.http.HttpClient.New(HttpClient.java:289)
:>         at
:> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnec
:> tion.java:3
:> 79)
:>         at
:> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpUR
:> LConnection
:> java:472)
:>         at java.net.URL.openStream(URL.java:798)
:>         at servlet.ApplyXSLT.getDocument(ApplyXSLT.java:388)
:>         at servlet.ApplyXSLT.process(ApplyXSLT.java:247)
:>         at servlet.ApplyXSLT.doGet(ApplyXSLT.java:202)
:>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
:>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
:>         at
:> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
:>         at org.apache.tomcat.core.Handler.service(Handler.java:286)
:>         at
:> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
:>         at
:> org.apache.tomcat.core.ContextManager.internalService(ContextMana
:> ger.java:79
:> 7)
:>         at
:> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
:>         at
:> org.apache.tomcat.service.http.HttpConnectionHandler.processConne
:> ction(HttpC
:> onnectionHandler.java:210)
:>         at
:> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
:>         at
:> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.
:> java:498)
:>         at java.lang.Thread.run(Thread.java:484)
:>  </PRE>
:>
:> Iwan
:> ----------------
:> Directory-structure
:>
:>  Directory of C:\tomcat\webapps\xalan2
:>
:> 12/09/2000  10:03p      <DIR>          .
:> 12/09/2000  10:03p      <DIR>          ..
:> 12/09/2000  10:03p                 313 readme.html
:> 12/09/2000  10:03p               1,135 cookies.xsl
:> 12/09/2000  10:03p                 789 Cookies.xml
:> 12/09/2000  10:03p               7,479 default2.xsl
:> 12/09/2000  10:03p              11,935 default.xsl
:> 12/09/2000  10:03p      <DIR>          WEB-INF
:> 12/09/2000  10:03p      <DIR>          javadoc
:>                5 File(s)         21,651 bytes
:>
:>  Directory of C:\tomcat\webapps\xalan2\WEB-INF
:>
:> 12/09/2000  10:03p      <DIR>          .
:> 12/09/2000  10:03p      <DIR>          ..
:> 12/09/2000  10:03p               3,911 web.xml
:> 12/09/2000  10:03p      <DIR>          classes
:> 12/09/2000  10:03p      <DIR>          lib
:>                1 File(s)          3,911 bytes
:>
:>  Directory of C:\tomcat\webapps\xalan2\WEB-INF\classes
:>
:> 12/09/2000  10:03p      <DIR>          .
:> 12/09/2000  10:03p      <DIR>          ..
:> 12/09/2000  10:04p      <DIR>          servlet
:>                0 File(s)              0 bytes
:>
:>  Directory of C:\tomcat\webapps\xalan2\WEB-INF\classes\servlet
:>
:> 12/09/2000  10:04p      <DIR>          .
:> 12/09/2000  10:04p      <DIR>          ..
:> 12/09/2000  10:48p               2,159 ApplyXSLTException.class
:> 12/09/2000  10:48p              15,338 ApplyXSLT.class
:> 12/09/2000  10:48p               2,245 ApplyXSLTProperties.class
:> 12/09/2000  10:48p               1,552 ApplyXSLTListener.class
:> 12/09/2000  10:48p               1,666 OrderedProps.class
:> 12/09/2000  10:48p               1,129 PIA.class
:> 12/09/2000  10:48p               5,307 DefaultApplyXSLTProperties.class
:>                7 File(s)         29,396 bytes
:>
:>  Directory of C:\tomcat\webapps\xalan2\WEB-INF\lib
:>
:> 12/09/2000  10:03p      <DIR>          .
:> 12/09/2000  10:03p      <DIR>          ..
:> 12/09/2000  10:03p             653,153 xalan.jar
:> 12/09/2000  10:03p           1,499,244 xerces.jar
:>                2 File(s)      2,152,397 bytes
:>
:>  Directory of C:\tomcat\webapps\xalan2\javadoc
:>
:> 12/09/2000  10:03p      <DIR>          .
:> 12/09/2000  10:03p      <DIR>          ..
:>                0 File(s)              0 bytes
:>
:>      Total Files Listed:
:>               15 File(s)      2,207,355 bytes
:>               17 Dir(s)   1,726,472,192 bytes free
:>
:> C:\tomcat\webapps\xalan2>
:>
:>