dcsimg
Trying to parse an XML file under Tomcat environment : it doesn't work
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adrien_Meaudre
Posted On:   Wednesday, June 20, 2001 10:13 AM

A bean component can parse an XML file (with a Xerces DOMParser). The instructions I use here re : 1. "DOMParser leParser = new DomParser()" to create an instance of the parser 2. leParser.parse(xml_file_pathname) Calling this code from a servlet running under Tomcat, I still obtain the error "can't find file" (whatever the file pathname is). Calling the same code from a Java application outside Tomcat environment, everything goes right as far as I don't use a pathname with a drive name (pathname like X:/dir/dir/file.xml) [Notice : I'm running under Windows NT4 Workstation]. Inside or outside Tomcat I'm using the same class for the parser (org.apache.x   More>>

A bean component can parse an XML file (with a Xerces DOMParser). The instructions I use here re :

1. "DOMParser leParser = new DomParser()" to create an instance of the parser

2. leParser.parse(xml_file_pathname)



Calling this code from a servlet running under Tomcat, I still obtain the error "can't find file" (whatever the file pathname is).



Calling the same code from a Java application outside Tomcat environment, everything goes right as far as I don't use a pathname with a drive name (pathname like X:/dir/dir/file.xml) [Notice : I'm running under Windows NT4 Workstation].



Inside or outside Tomcat I'm using the same class for the parser (org.apache.xerces.parsers.DOMParser).



In the CLASSPATH built when launching Tomcat, no other directory nor jar file contain any DOMParser class.




Any idea about how I could parse an XML file inside a component called from a servlet ?



Thanks in advance for any help.

   <<Less
About | Sitemap | Contact