OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Parsing with XSD Validation in Weblogic

[ Lists Home | Date Index | Thread Index ]

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.

_________________________________________________________________






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS