Re: Exception from service object: org.apache.xerces.framework.XMLParser

"Scott Nichol" <[email protected]> Mon, 24 Jan 2005 16:22:47 -0500
Newsgroups gmane.text.xml.soap.user
Message-ID <0e2901c5025a$da2a88e0$6401a8c0@northgate>
I do not think I can be of much help, but I have a comment.  The code you show has the very unfortunate side-effect of destroying the exact information you need to explore this problem.  I specifically mean the exception handling.  When the code catches an exception and does

    throw new com.ibm.tct.api.exception.ServerException(fe.getMessage());

all that remains of the real exception is the message, in this case the not-so-helpful 
org.apache.xerces.framework.XMLParser.  Your best bet for investigating the exception further would be to change the code.  Ideally, com.ibm.tct.api.exception.ServerException would support exception chaining, but my guess is that it was written before the JDK directly supported chaining (with the constructors like public Exception(String message, Throwable cause)).  Assuming this class does not support chaining, I would either comment out exception handling code (for debugging the problem) or change the constructor call parameter to be the full stack trace of the original exception

    StringWriter sw = new StringWriter(2048);
    PrintWriter pw = new PrintWriter(sw);
    fe.printStackTrace(pw);
    pw.flush();
    throw new com.ibm.tct.api.exception.ServerException(sw.toString());

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Tao Jiang" <[email protected]>
To: <[email protected]>
Sent: Monday, January 24, 2005 3:27 AM
Subject: Exception from service object: org.apache.xerces.framework.XMLParser


> Hi, 
> 
>   I deploy a soap server side as a web application in WAS5.1, and when i 
> called the client side 
> it appears the exception like the title, anyone's help is appreciated. 
> 
>   This is the place to throw this exception, i googled and found no any 
> useful infos, 
> 
>     /**
>      * to parse the file to java doc created date:(2002-11-30 14:32:21)
>      * 
>      * @param xmlPath
>      *            java.lang.String
>      * @exception om.ibm.tct.api.exception.ServerException
>      * 
>      */
>     private void parserXML(String newXmlPath)
>             throws com.ibm.tct.api.exception.ServerException {
>         try {
>             DOMParser parser = new DOMParser();
>             File xmlFile = new File(newXmlPath);
>             InputStream fileStream = new FileInputStream(xmlFile);
>             Reader streamReader = new InputStreamReader(fileStream, 
> ENCODE);
>             InputSource inputSource = new InputSource(streamReader);
>             parser.parse(inputSource);
>             doc = parser.getDocument();
> 
>         } catch (FileNotFoundException fe) {
> 
>             throw new 
> com.ibm.tct.api.exception.ServerException(fe.getMessage());
>         } catch (UnsupportedEncodingException ce) {
> 
>             throw new 
> com.ibm.tct.api.exception.ServerException(ce.getMessage());
>         } catch (SAXException se) {
> 
>             throw new 
> com.ibm.tct.api.exception.ServerException(se.getMessage());
>         } catch (IOException ioe) {
> 
>             throw new com.ibm.tct.api.exception.ServerException(ioe
>                     .getMessage());
>         } catch (Exception e) {
> 
>             throw new 
> com.ibm.tct.api.exception.ServerException(e.getMessage());
>         }
>     }
> 
> 
> Thanks
> Tao