SAXParser - AbstractMethodError

Hi,
I'm trying to use SAX to work with some XML data but the I get an "AbstractMethodError" throw when I call de SAXParser's parse(...) method.
My code looks like this:
DefaultHandler handler = new DefaultHandler();
SAXParserFactory factory = SAXParserFactory.newInstance();
try {
SAXParser saxParser = factory.newSAXParser();
saxParser.parse(myXMLFile, handler);
What am I doing wrong?
TIA,
Walter

You are trying to combine SAX 1.0 with SAX 2.0. You'll need the Java XML Pack Fall 01 Release (http://java.sun.com/xml/downloads/javaxmlpack.html). Also tak a look at http://sax.sourceforge.net/
Then create the parser this way
(SAXParser) new org.apache.xerces.jaxp.SAXParserFactoryImpl().newSAXParser();

Similar Messages

  • Oracle.xml.parser.v2.SAXParser error

    I'm reposting this error that I recently received one more time before removing the XML transforms from my Java projects and doing them in .NET.
    Code that was working fine suddenly getting a transform error using JDeveloper.
    Get the following:
    javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: XML-22000: (Fatal Error) Error while parsing XSL file (weblogic.xml.jaxp.RegistryXMLReader cannot be cast to oracle.xml.parser.v2.SAXParser).
         at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:417)
    Seems that
    <!--
    <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <h1>Project Weekly Hours Worked</h1>
    <table>
    <c:import url="HoursWorked.xml" var="xmlHoursWorked" charEncoding="windows-1252"/>
    <c:import url="./HoursWorked3.xsl" var="xslt" charEncoding="windows-1252"/>
    <x:transform xml="${xmlHoursWorked}" xslt="${xslt}" />
    </table>
    -->
    will not transform XML to HTML via XSL in JSP anymore.
    If I run the XSL i get the HTML results I expected in an HTML test page.
    So I know the XML and XSL is sound.
    XSL and DOM parsing in Java/Oracle was a major pain in the ass in the first place and now this.
    Well I've spent hours going through Oralce/Java documentation on XML, DOM and XSL transforms.
    All that time spent and still so unstable. I don't think I was ever able to really get what I wanted
    which was to transform my XML document to HTML, update via JSP and have the XML document
    be updated and ready to view in a summary page. The XML document changes were never really
    available unless I closed the app and restarted. So all in all a failure of capabilities compared to my
    use of XML in .NET.
    So........
    Me thinks it will be a good idea to take out the transforms and have my JSP use a script to invoke a
    method in a class that extracts it from a message. Just have PL/SQL interface with XML and do the
    transform or serialize thing there.
    I don't want to give up on XML but I'm tired of trying to jam a square peg into a round hole
    with Java and JDeveloper.
    Brian

    We don't support file references ("cv1_0.dtd"). Only url type references
    are supported, of the form:
    @ <!DOCTYPE cv1 SYSTEM "http://www.oracle.com/public/cv1_0.dtd>
    Note that the url should be accessible to the world without the need to authenticate.
    you could put your dtd in the "public" area in your iFS system.
    Thanks,
    Sirisha
    null

  • AbstractMethodError while calling PreparedStatement.setBinaryStream()

    I am getting AbstractMethodError while calling PreparedStatement.setBinaryStream(int, InputStream) for a BLOB column
    I am using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit
    JDBC Driver ojdbc6.jar (downloaded from oracle website corresponding to 11.2.0.2 version)
    JDK 6
    I understand this error is due to my code calling abstract method which is not available in JDBC 3.x and it requires JDBC 4.0
    But I am not able to find any traces of usage of earlier version of driver.
    Debugging steps performed with results are as below
    1) I enabled -verbose:class VM argument that outputs all the classes loaded along with jar from which it loads. Everywhere i see ojdbc6.jar (No reference to older or any other jdbc driver jar file)
    2) Below is code segment and its output
    Connection con = getConnection(); // get connection
    DatabaseMetaData d= con.getMetaData();
    d.getDatabaseProductName(); // output: Oracle
    d.getDatabaseProductVersion(); // output: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    d.getDatabaseMajorVersion(); // output: 11
    d.getDatabaseMinorVersion(); // output: 2
    d.getDriverName(); // output: Oracle JDBC driver
    d.getDriverVersion(); // output: 11.2.0.2.0
    d.getDriverMajorVersion(); // output: 11
    d.getDriverMinorVersion(); // output: 2
    d.supportsGetGeneratedKeys(); // output: true
    3) I updated code (its third party component, so not suppose to update :( )
    Added third argument whick works fine (it means at runtime it is using older jdbc driver???)
    PreparedStatement.setBinaryStream(int, InputStream, (int)length
    Please let me know if i am missing anything here... how can i solve this issue?
    Thanks!

    From my initial post
    I am getting AbstractMethodError while calling PreparedStatement.setBinaryStream(int, InputStream) for a BLOB column
    3) I updated code (its third party component, so not suppose to update )
    Added third argument whick works fine (it means at runtime it is using older jdbc driver???)(3) will not work if correct ojdbc6.jar is used. Because third argument is int and not long. long will work with ojdbc6 but will not work with older version.
    I am using third party component and they are using - PreparedStatement.setBinaryStream(int, InputStream)
    It should work with JDK 6, Oracle 11g and ojdbc6.jar driver.
    I am sure its simple classpath issue or some configuration mismatch - just couldn't see it right now.
    I will probably create new workspace / or test on other system now
    Thanks!

  • Java Get Clob field error, message "java.lang.AbstractMethodError" in "getClob(2)"

    oracle is 8.1.6, my jdbc is /home/oracle/OraHome1/jdbc/lib/classes111.zip
    my table test_clob's struction
    id int
    content clob
    While I run my class, it report:
    Exception in thread "main" java.lang.AbstractMethodError
    at ...(Oracle_clob.java:72)
    the error line is:
    Clob clob = result.getClob(2);
    the code is :
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class Oracle_clob
    public static void main(String[] args)
    Connection con = null;
    int iRowCount = 0;
    Statement stmt = null;
    ResultSet result = null;
    String sDriver = "oracle.jdbc.driver.OracleDriver";
    String sURL = "jdbc:oracle:oci8:@orcl";
    String sUsername = "sj";
    String sPassword = "sj";
    try // Attempt to load the JDBC driver
    { // with newInstance
    Class.forName( sDriver ).newInstance();
    catch( Exception e ) // error
    System.err.println(
    "Failed to load current driver.");
    return;
    } // end catch
    try
    con = DriverManager.getConnection ( sURL,
    sUsername,
    sPassword);
    stmt = con.createStatement();
    catch ( Exception e)
    System.err.println( "problems connecting to " +
    sURL + ":" );
    System.err.println( e.getMessage() );
    if( con != null)
    try { con.close(); }
    catch( Exception e2 ) {}
    return;
    } // end catch
    try {
    String ls_sql;
    ls_sql = "select id, content from test_clob";
    result = stmt.executeQuery(ls_sql);
    String ls_field=null;
    if (result == null) {
    System.out.print("result is null");
    return ;
    if(result.next()){
    Clob clob = result.getClob(2);
    Reader char_stream = clob.getCharacterStream();
    char[] buffer = new char[1024];
    int length = 0;
    ls_field = "";
    String ls_newString;
    try{
    while((length=char_stream.read(buffer))!=-1){
    //for(int i=0; i<length; i++){
    ls_newString = String.valueOf(buffer);
    ls_field = ls_field + ls_newString;
    char_stream.close();
    catch( Exception e3 ) {
    System.out.print("error: "+ e3.getMessage());
    else
    System.out.print("next is false");
    if (ls_field== null ) ls_field = "";
    System.out.print(" field: "+ ls_field);
    result.close();
    catch(SQLException ex) {
    System.out.print("aq.executeQuery: " + ex.getMessage());
    finally
    try { stmt.close(); }
    catch( Exception e ) {}
    try { con.close(); }
    catch( Exception e ) {}
    } // end finally clause
    } // end main
    } // end class Create4JData
    What's wrong with it? Thank you advance.

    getClob is supported by JDBC2.0 which is not supported by classes111.zip. Get the classes12.zip and the corresponding OCI driver by installing oracle client update.

  • How to set SAXParser at command-line interface to create a large XML file

    Hi,
    I am trying to create a large XML file (more than 50 MB) by selecting from Oracle database but failed because of "out of memory" error. According to "Oracle XML Developer Guide", we should use SAXParser to parsing a large XML file. But there is no example to show how to set SAXParser at command-line
    Following is what I use to get xml files. It works only when the file is small.
    java OracleXML getXML -DateFormat -withDTD -rowsetTag PO_HDR -conn
    "jdbc:oracle:oci8:@server_name" -user "ID/password" "select * from table_name"
    When I set SAXParser at the way below,
    java oracle.xml.parser.v2.SAXParser OracleXML getXML -DateFormat -withDTD -rowsetTag PO_HDR -conn
    "jdbc:oracle:oci8:@server_name" -user "ID/password" "select * from table_name"
    it failed with the error message: "In class oracle.xml.parser.v2.SAXParser: void main(String argv[]) is not defined"
    Does anyone know how to solve the problem? I'll be appreciated very much for your help.
    Yi

    here are my ideas.
    register the xml schema.
    using xmldom, generate the desired xml output and return as xmltype.
    then you can use something like this to check.
    declare
    xmldoc xmltype ;
    begin
       -- populate xmldoc from you xmldom function
       -- validate against XML schema
       xmldoc.isSchemaValid(schema_url, root_element);
       if xmldoc.isSchemaValid = 1 then
            --valid schema
       else
            --invalid
       end if;
    end

  • SAXParser type declaration not found - PLEASE HELP!!

    I am using XML to parse an incoming string of XML. I want to use an SAXParser to do this, but I cannot create an object of this type. I have the jar file jaxp.jar, xalan.jar, and crimson.jar in my classpath.
    Is there anything else that I need to do in order to get the parser to work.
    This is a very urgent need so any help is appreciated. Here is the error:
    Class SAXParser not found in type declaration;

    I have figured out the issue. Thanks for the help. I do have one more issue though. I am trying to parse a string of xml data and I need to pass my parse() method an InputSource object that I guess I will make from my incoming String.
    Any thoughts on how to do this?

  • SaxParser error  parsing xml encoded string

    I'm trying to parse an XML string with Java's SaxParser. The program
    fails at the end of an element or at the beginning of a new element.
    Is my XML string okay?
    <?xml version="1.0" encoding="utf-8"
    ?><DTYPE>OVL</DTYPE><DTYPE>IMG</DTYPE>. . .
    If fails after </DTYPE> and before the next <DTYPE>
    The Sax Parser works fine on files.
    Here is the code I use to send the string to the parser :
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    InputStream is = new ByteArrayInputStream(stringToParse.getBytes());
    saxParser.parse( is, handler );
    Here is the error message I get :
    org.xml.sax.SAXParseException: Inadmissible sign at the document end<
    at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376)
    at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3370)
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:673)
    at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
    at
    org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:143)
    at EchoSaxParser.parse(EchoSaxParser.java:51)
    at StringParser.parse(StringParser.java:23)
    at Servant.stringparse(Servant.java:30)
    at TEST._TestImplBase._invoke(_TestImplBase.java:43)
    at
    com.sun.corba.se.internal.corba.ServerDelegate.dispatch(ServerDelegate.java�:353)
    at com.sun.corba.se.internal.iiop.ORB.process(ORB.java:280)
    at
    com.sun.corba.se.internal.iiop.RequestProcessor.process(RequestProcessor.ja�va:81)
    at
    com.sun.corba.se.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.ja�va:106)
    Any help would be greatly appreciated!
    Thank you!

    <?xml version="1.0" encoding="utf-8" ?><DTYPE>IMG</DTYPE><DTYPE>REF</DTYPE>Above is a short XML string that causes the problem.
    It's all one line.
    I also tried adding System.getProperty("line.separator") add the
    end of each tag so I get :
    <?xml version="1.0" encoding="utf-8" ?>
    <DTYPE>IMG</DTYPE>
    <DTYPE>REF</DTYPE>But same error. It still crashes after the first <DTYPE></DTYPE> tag.
    Any help greatly appreciated!

  • SAXParser parse method

    Hello,
    I'm trying to parse with SAX a XML file coming from remote device, but i Tomcat shows me error message as:
    Apache Tomcat/4.0.4 - HTTP Status 404 -
    http:\localhost:8080\fieldgate\output1.xml (Syntax file name or directory or volume is wrong)
    code is:
    <jsp:useBean id="parser" scope="page" class="beans.xml.sax.SAXParserBean" />
    <%  Collection elements = parser.parse("http://localhost:8080/fieldgate/output1.xml");
        Iterator it = elements.iterator();
    %>
    .........Someone can help me please?
    Thx
    Riccardo

    Ok this code is not mine but is taken from a manual:
    package beans.xml.sax;
    import java.io.FileReader;
    import org.xml.sax.Attributes;
    import java.io.IOException;
    import java.util.Vector;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.DefaultHandler;
    import org.apache.xerces.parsers.SAXParser;
    public class SAXParserBean extends DefaultHandler {
       private Vector vector = new Vector();
       private SAXElement currentElement = null;
       private String elementText;
       public Vector parse(String filename) throws SAXException,
                                                   IOException {
          XMLReader xmlReader = new SAXParser();
          FileReader fileReader = new FileReader(filename);
          xmlReader.setContentHandler(this);
          xmlReader.parse(new InputSource(fileReader));
          return vector;
       public void startElement(String uri, String localName,
                                String qName, Attributes attrs) {
          currentElement = new SAXElement(uri,localName,qName,attrs);
          vector.addElement(currentElement);
          elementText = new String();
       public void characters(char[] chars, int start, int length) {
          if(currentElement != null && elementText != null) {
             String value = new String(chars, start, length);
             elementText += value;
       public void endElement(String uri, String localName,
                              String qName) {
          if(currentElement != null && elementText != null)
             currentElement.setValue(elementText.trim());
          currentElement = null;
    }

  • Java Stored Procedure SAXParser XML Schema Validation

    Using Oracle XML Developers Kit 10.2.0.2.0 - Production.
    Attempting to validate using XML Schema in a Java stored procedure with the code:
                   if ( schemaDoc == null )
                        // Obtain default connection
                        Connection conn = new OracleDriver().defaultConnection();
                        OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement("SELECT XmlDocObj FROM XmlDoc WHERE XmlDocNbr = 2");
                        OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
                        if ( rset.next() )
                             // get the XMLType
                             XMLType schemaXml = (XMLType)rset.getObject(1);
                             XSDBuilder builder = new XSDBuilder();
                             XMLSchema schemaDoc = (XMLSchema)builder.build(new InputSource(schemaXml.getInputStream()));
                   if ( inst == null )
                        inst = new ValidateCoreRequest();
                   ErrorHandlerImpl handler = inst.getNewErrorHandler();
    SAXParser saxParser = new SAXParser();
    saxParser.setXMLSchema(schemaDoc);
    saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    saxParser.setErrorHandler(handler);
    saxParser.parse(new InputSource(new StringReader(docStr)));
    if( handler.validationError )
                        errorMsg[0] = handler.saxParseException.getMessage().substring(0, Math.min(199, handler.saxParseException.getMessage().length()));
    Never reports validation errors in the XML. Although the XDK Programmers Guide states "...you can use
    the oracle.xml.parser.schema.XSDBuilder class to build an XML schema and
    then configure the parser to use it by invoking the XMLParser.setXMLSchema()
    method. In this case, the XML parser automatically sets the validation mode to
    SCHEMA_STRICT_VALIDATION and ignores the schemaLocation and
    noNamespaceSchemaLocation attributes." No validation seems to occur. I have tried to set an xsi:noNamespaceSchemaLocation attribute on the root XML node, but this results in URL errors if the URL is not valid or schema build errors if the URL is valid, but does not point to a real location.
    It appears that without a schema location attribute, no schema validation occurs. Using setXMLSchema() with a database source does not seem to cause the schema location attributes to be ignored. At least for Java stored procedures.
    Does XML Schema validation work in the database for externally referenced schemas?
    Thank You,
    Art

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jan Vissers ([email protected]):
    I have two schemas A and B. A contains a java stored procedure which calls a java stored procedure stored in B. Upon resolving the "A" Java Stored Procedures I get the following error:
    ORA-29545: badly formed class: at offset 3093 of Adapter.TFADPBeschikbaarheid.sendAanvraag expecting a class-oracle.xml.parser.v2.XMLDocument but encountered a class-oracle.xml.parser.v2.XMLDocument.
    ... Question:
    it is expecting something which it has in fact encountered... SO!!!! What is the error.
    Thx,
    Jan<HR></BLOCKQUOTE>
    Try this:
    Edit your XSU installation script located on lib directory of Oracle XSU's distribution:
    Find the line:
    loadjava -r -v -u $USER_PASSWORD xmlparserv2.jar
    Replace by:
    loadjava -r -v -g public -u $USER_PASSWORD xmlparserv2.jar
    And installs your Oracle XSU again.
    Best regards, Marcelo.

  • How to remove/ignore the element using SAXParser

    hello all,
    I want to parse the text content in string from the existed xml file. but had problem with the parser. Does anyone have good idea, how to remove or ignore the <link> tag in tag <text>?
    IS: the output is only the rest of part text behind <link style="blue" src="www.test.com" />.
    Wanted: the whole text in <text> tags. like "Reach more customers by creating targeted micro-sites using test's multi-store retailing functionality."
    Given below is my code :
    <?xml version="1.0"?>
    <test xmlns="http://www.test.com/test">
    <title>test title</title>
    <text>Reach more customers by creating targeted micro-sites using test's<link style="blue" src="www.test.com" /> multi-store retailing functionality.</text>
    </test>java code using SAXParser
      public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
      public void endElement(String uri, String localName, String qName) throws SAXException {
        if (qName.equals("text")) {
          System.out.println("content: " + text);
      public void characters(char[] ch, int start, int length) throws SAXException {
        String str = new String(ch, start, length);
        if (str.length() > 0)
          text = text == null ? str : text + str;
    ...Edited by: lauehuang on Sep 9, 2008 4:37 AM

    i think u can't modify the xml file using SAX
    SAX is only for reading XML
    for any modifications in xml file u have to use DOM parser....
    correct me if i m wrong....
    Thanks & Regs
    Ravi

  • Blob and java.lang.AbstractMethodError

    I can't make this code (below) to work. I get an java.lang.AbstractMethodError trying. Does anyone have a clue about what might cause this error?
    My setup:
    jsdk 1.4
    Oracle 8.1.7
    Forte4J 4.0
    Thanks in advance
    Roland
    ---------- the code --------------
    conn = cp.getConnection(_database, user, password);
    conn.setAutoCommit(true);
    PreparedStatement stat = conn.prepareStatement(sql.toString());
    stat = conn.prepareStatement(sql.toString());
    stat.setLong(1, id);
    ResultSet res = stat.executeQuery();
    if(res.next()){
    setId(res.getLong("id"));
    Blob b = res.getBlob("data");
    stat.close();

    PreparedStatement stat =
    conn.prepareStatement(sql.toString());
    stat = conn.prepareStatement(sql.toString());yes there is something wrong there but if your problem is
    occurring with
    Blob b = res.getBlob("data");then the problem is that the ResultSet you are using does not implement this method. getBlob is a method that was introduced in JDBC 2.0. in fact the Blob interface itself was introduced in JDBC 2.0.
    you can try on of the following...
    get a new driver that implements getBlob. for oracle i think you will be fine. you can get a new driver here http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html
    the other option if you cannot get a new driver is to use the getBinaryStream() method of ResultSet to retrieve your data

  • AbstractMethodError on WebLogic Linux

    I am trying to migrate a web application from the WebLogic 8.1 server running on a Solaris box to a WebLogic server running on Linux. I am able to deploy the application with no problem, however I am getting the following runtime error:
    I am using the exact same startWebLogic.sh script from Solaris, but am having no luck. Has anyone encountered this error or know if this is a known issue with WebLogic 8.1 on Linux? Thanks in advance!
    java.lang.AbstractMethodError: weblogic.webservice.core.soap.SOAPEnvelopeImpl.normalize()V
    at com.sun.xml.rpc.streaming.XmlTreeReader.parse(XmlTreeReader.java:133)
    at com.sun.xml.rpc.streaming.XmlTreeReader.next(XmlTreeReader.java:103)
    at com.sun.xml.rpc.streaming.XMLReaderBase.nextContent(XMLReaderBase.java:23)
    at com.sun.xml.rpc.streaming.XMLReaderBase.nextElementContent(XMLReaderBase.java:41)
    at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:154)
    at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:443)
    at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:86)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

    Here it is
    java.lang.AbstractMethodError
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:852)
         at weblogic.ejb20.manager.BaseEntityManager.remoteScalarFinder(BaseEntityManager.java:797)
         at weblogic.ejb20.internal.EntityEJBHome.finder(EntityEJBHome.java:552)
    Rob Woollen <[email protected]> wrote:
    Can you post the AbstractMethodError? We'd need some more info to help
    you.
    -- Rob
    Chun wrote:
    Hi all
    We are trying to migrate our J2EE application from WLS 6.1 to WLS 7.After deployed
    started successfully, we keep getting java.lang.AbstractMethodError.We have recompile
    the jar, and the jar wroks fine under WLS 6. Could anybody helps? Thankyou very
    much

  • Is the java 1.5 default SAXParser thread safe.

    I used the following code to create a parser and validate my xml data.
    But the following code is causing too many open file issue.
    After doing some analysis I understood that each object of parser is open the file "file://var/app/bea/files/wfinf/xmlschema/WorkflowDecisionResponse.xsd".
    So if I comment the setProperty method it will work fine.
    My question is this parser is thread safe so that I can create single instance of parser and can be shared by all my thread?
    If not can some body suggest a better idea to validate it.
    public static boolean validate(String XMLData){
         SAXParserFactory factory = SAXParserFactory.newInstance();
         factory.setNamespaceAware(true);
         factory.setValidating(true);
         SAXParser parser = factory.newSAXParser();
         parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
         parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", "file://var/app/bea/files/wfinf/xmlschema/WorkflowDecisionResponse.xsd");
           try{
              parser.parse(new InputSource(new StringReader(XMLData)), new DummyHandlerImpl());
           }catch(Exception e) {
               return false;
           return true;
    }

    Hi There,
    I found this thread of yours with no reply from anybody.
    I'm also facing a similar issue. Did you found a solution to this.
    If yes please share.
    Regards,
    Mayank

  • JTidy in weblogic 10.3 throws AbstractMethodError

    Hi all,
    Last year a developed a portlet application that makes the transformation of a jTidy-DOM-SDK5 to an string as in the next snippet, this year I'm being asked to migrate that application to weblogic portal 10.3 with SDK6 and I'm getting an error as shown below.
    Please assist. Thank you!
                //reading HTML
                Document htmlDoc = tidy.parseDOM(in, null);          
                //more code processing the document above
                //Printing out our doc
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer trans = tf.newTransformer();
                   StringWriter sw = new StringWriter();
                   trans.transform(new DOMSource(htmlDoc), new StreamResult(sw));
    wl_page java.lang.AbstractMethodError
         at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:373)
         at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:127)
         at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:94)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:662)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)

    instead of import weblogic.security.SubjectUtils; use import weblogic.security.spi.WLSUser; and get the username as below
    Set users = subject.getPrincipals(WLSUser.class);
              Iterator iter = users.iterator();
              while (iter.hasNext()){
                   userName = ((WLSUser)iter.next()).getName();
                   System.out.println(userName);
    this returns you the username

  • Character encoding in SAXParser

    I'm doing some XML work and have a bunch of documents which are all UTF-8 encoded (stating so in their declarations).
    I'm writing a servlet which indexes the documents and produces a single XML document as a result. ATM, all the character references in the source documents are resolved when they are parsed by the SAXParser.parse() function and are therefore included in the resultant document as single, illegal characters, not character references.
    If I could force the SAXParser.parse() function into thinking that the encoding of the source documents was "us-ascii" then it would not (I assume) resolve the character entities and they would appear in the result document as-is (e.g. "&#038;", not "&").
    Does anyone know if its possible to do this? (It may not be at the point SAXParser.parse() exactly, I'm not sure).
    Thanks.

    There isn't anything that specifically converts & to &amp; or anything like that, no. If you use the JAXP classes to output your XML then you don't need to worry about that. But if you use the plain old Java I/O classes then you do. You also need to worry about encoding; if you just write to the ServletOutputStream then you are by default accepting your system's default encoding, which isn't UTF-8. Perhaps you should do this:Writer w = new OutputStreamWriter(response.getOutputStream(), "UTF-8");and then write your XML to that. Then it should be encoded correctly. You should never have to bother about converting characters like &eacute; to character entities if you are working with the system instead of against it.

Maybe you are looking for

  • Not able to Bind DPS 6.3.1

    Hey, I configured Sun Directory Server 6.3.1 on Solaris Sparc. I'm not able to bind the ldapclient. **DPS Error log says:** 17/Sep/2009:07:36:08 +0000] - BACKEND - WARN - No data source available for ADD,BIND,COMPARE,DELETE,MODIFY, in data source poo

  • Photoshop CS4 Extended 64bit Color glitchs and crashing?

    Hi, today after a few weeks of not touching Photoshop for digital painting, i went to draw with it and my Intuos 4 Wacom Tablet. Nothing was wrong, and i was very far into the process of finishing the picture, but then suddenly Photoshop started bein

  • Error in ejbc (CMP)

    Hi, I have developed an Entity Bean (CMP), which is giving the below mentioned error at the time of ejbc. Pls give me the solution of this problem. ejbc: [echo] WebLogic EJBC: Creating deployable studyevent-1_0.jar ... [java] ERROR: Error from ejbc:

  • Error code 1 installing creative cloud

    I am using Windows 7 and every time I try to download Creative Cloud I get error code 1. Help?

  • Kan de livestream van De Tour niet openen (bekijken) op mijn IPad.

    Wanneer ik de livestream van de Tour wil bekijken op mijn ipad, krijg ik de foutmelding "De bewerking kan niet worden voltooid"