[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SAX Parsing with XSD Validation in Weblogic

  • To: xml-dev@l...
  • Subject: SAX Parsing with XSD Validation in Weblogic
  • From: "Khurram Chaudhary" <kc5uk@h...>
  • Date: Thu, 12 Jun 2003 10:58:12 +0100
  • Bcc:

java xsd validation
Hello Guys,

I am using XMLReader to get SAXParser by following code

XMLReader parser = 
XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");

Also I have set some properties for validation against a xsd, these 
properties are

parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error", 
true);
parser.setProperty("http://apache.org/xml/properties/schema/" +
                    "external-noNamespaceSchemaLocation",xsdLocation);

When I build an ear file and deploy it to Weblogic7, it fails to read the 
xsd file.  The reason I think is Weblogic doesn't like FileInputStream, 
because I had the same problem with reading properties file, but when we 
change the FileInputStream to InputStream and getting the file with 
getResourceAsStream(fileLocation) method it started reading the properties 
file.  Its failing with the stack trace

getLocalUserDetails.xsd (The system cannot find the path specified)
       at java.io.FileInputStream.open(Native Method)
       at java.io.FileInputStream.<init>(FileInputStream.java:59)
       at 
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
.java:64)
       at 
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:128)
       at java.net.URL.openStream(URL.java:793)
       at 
org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultRe
aderFactory.java:149)
       at 
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume
nt(DefaultEntityHandler.java:493)
       at 
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3
14)
       at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1097)
       at 
org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar
(XMLValidator.java:2823)
       at 
org.apache.xerces.validators.common.XMLValidator.parseSchemas(XMLVali
dator.java:2747)


Please help  us out on this, thanks.  the above program works fine as a 
standalone application, but when deployed to Weblogic it fails at the above 
point.

Khurram.

_________________________________________________________________
Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.