๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #8936

Xerces J

#8936
From: tony
Date: Wed, 18 Jul 2001 14:56
77 lines
3531 bytes
Salut,
J'ai un probleme avec la m๏ฟฝthode parse du document builder voici mon cod
e :
String xmlData = //ma chaine xml;

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInsta
nce();
    	DocumentBuilder builder;
        Document document;
        StringBufferInputStream sbis = new StringBufferInputStream(xmlDa
ta);
        InputSource is = new InputSource(sbis);
        System.out.println(is);
        try{
            factory.setNamespaceAware(true);
            builder = factory.newDocumentBuilder();
    	}catch(ParserConfigurationException pce){
            pce.printStackTrace();
            return null;
        }
        System.out.print(xmlData);
        try{
            document = builder.parse(is);
        }catch (SAXException sxe) {
            // Error generated during parsing)
            Exception  x = sxe;
            if (sxe.getException() != null)
            x = sxe.getException();
            x.printStackTrace();
            return "";
        }catch(IOException ioe) {
            // I/O error
            ioe.printStackTrace();
            return "";
        }

----La pile d'exception-----


java.lang.NullPointerException
        at org.apache.crimson.tree.XmlDocumentBuilder.startElement(XmlDo
cumentBuilder.java:477)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1
442)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:
499)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.j
ava:433)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBui
lderImpl.java:179)
        at com.bnpparibas.control.ConfigParser.parse(ConfigParser.java:4
2)
        at com.bnpparibas.control.ConfigServlet.processRequest(ConfigSer
vlet.java:71)
        at com.bnpparibas.control.ConfigServlet.doPost(ConfigServlet.jav
a:89)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)

        at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.
java:155)
        at com.sun.web.core.InvokerServlet.service(InvokerServlet.java:1
68)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)

        at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.
java:155)
        at com.sun.web.core.Context.handleRequest(Context.java:414)
        at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.ja
va:139)


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Article poste via Voila News - http://www.news.voila.fr
Le : Wed Jul 18 16:56:29 2001 depuis l'IP : 159.50.96.225 [VIP 1152925]
Technical Details
Message-ID: <9j482t$pen$1@news.x-echo.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!oleane.net!oleane!x-echo.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 114f60,cc08cb512f8b9ffd,start
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-07-18 07:56:30 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!213.56.195.71!fr.usenet-edu.net!usenet-edu.net!oleane.net!oleane!x-echo.com!not-for-mail
From: tony <nospam@dummy.com>
Newsgroups: fr.comp.text.xml
Subject: Xerces J
Date: 18 Jul 2001 14:56:29 GMT
Organization: 159.50.96.225 via Pages News
Lines: 77
Message-ID: <9j482t$pen$1@news.x-echo.com>
NNTP-Posting-Host: news-front1-0-0.voila.fr
X-Trace: news.x-echo.com 995468189 26071 195.101.94.106 (18 Jul 2001 14:56:29 GMT)
X-Complaints-To: abuse@x-echo.com
NNTP-Posting-Date: 18 Jul 2001 14:56:29 GMT