SAX Parser ClassCastException

Guidance on the issue described below would be appreciated.
Product Oracle Containers for J2EE Product Version 10.0.3
Platform Microsoft Windows
HOW TO OVERRIDE PARSER IN 10.0.3 OAS 10G PREVIEW 2
### Provide the full build number for the OC4J version that you are running: ###
Oracle Application Server Containers for J2EE 10g (10.0.3.0.0) - Developer
Preview (build 040227.1923)
### Which type of OC4J installation are you running? ###
standalone OC4J installation (from zip file)
### If this OC4J instance is 'standalone', where was it installed? ###
it's own dedicated ORACLE_HOME
### Provide the exact text and location for any error seen in a log file: ###
java
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
-Djavax.xml.parsers.TransformerFactory=org.apache.xalan.processor.TransformerFac
toryImpl
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerF
actoryImpl -Dorg.dom4j.verbose=true -DCRN_ROOT=f:\cognos\crn -jar oc4j.jar
04/03/23 10:51:25 Node started with id=68984609063434
04/03/23 10:51:44 log4j:WARN LogFileWatchdog: shutDownHierarchy
04/03/23 10:51:44 log4j:WARN LogIPFControl - Unknown error during initialize
04/03/23 10:51:44 log4j: Setting IPF internal debugging to true
04/03/23 10:51:45 log4j:WARN No appenders could be found for logger
(Audit.RTUsage.CAM.CRP.jcam).
04/03/23 10:51:45 log4j:WARN Please initialize the log4j system properly.
04/03/23 10:51:46 log4j: Log Server Port is: 9362
04/03/23 10:51:46 log4j: Encoding set to: false
04/03/23 10:51:46 log4j: Number of Server Worker Threads is: 10
04/03/23 10:51:46 log4j: Encoding set to: false
04/03/23 10:51:46 log4j: Relative file path set to:
F:/cognos/crn/logs/crnserver.log
04/03/23 10:51:46 log4j: Exception encountered while trying to convert
configuration document into W3C Document.
04/03/23 10:51:46 log4j:ERROR null
04/03/23 10:51:47 Warning: Caught exception attempting to use JAXP to load a
SAX XMLReader
04/03/23 10:51:47 Warning: Exception was: java.lang.ClassCastException
04/03/23 10:51:47 Warning: I will print the stack trace then carry on using the
default SAX parser
04/03/23 10:51:47 java.lang.ClassCastException
04/03/23 10:51:47 at
javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
04/03/23 10:51:47 at
org.dom4j.io.JAXPHelper.createXMLReader(JAXPHelper.java:34)
04/03/23 10:51:47 at
org.dom4j.io.SAXHelper.createXMLReaderViaJAXP(SAXHelper.java:80)
04/03/23 10:51:47 at
org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:49)
04/03/23 10:51:47 at
org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:528)
04/03/23 10:51:47 at
org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:411)
04/03/23 10:51:47 at org.dom4j.io.SAXReader.read(SAXReader.java:277)
04/03/23 10:51:47 at org.dom4j.io.SAXReader.read(SAXReader.java:201)
04/03/23 10:51:47 at org.dom4j.io.SAXReader.read(SAXReader.java:190)
04/03/23 10:51:47 at
com.cognos.cclcfgapi.CCLStartupConfiguration.getConfigDoc
(CCLStartupConfiguration.java:253)
04/03/23 10:51:47 at
com.cognos.cclcfgapi.CCLStartupConfiguration.getStartupConfigurationDocumen
t(CCLStartupConfiguration.java:136)
04/03/23 10:51:47 at
com.cognos.cclcfgapi.CCLStartupConfiguration.getStartupConfigurationDocument
(CCLStartupConfiguration.java:112)
04/03/23 10:51:47 at
com.cognos.cclcfgapi.CCLConfiguration.init(CCLConfiguration.java:209)
04/03/23 10:51:47 at
com.cognos.pogo.config.ConfigurationImpl.reconfigure(ConfigurationImpl.java:43)
04/03/23 10:51:47 at
com.cognos.pogo.services.DispatcherServices.startInititalServices(DispatcherServ
ices.java:394)
04/03/23 10:51:47 at
com.cognos.pogo.transport.PogoServlet$PogoStartup.run(PogoServlet.java:499)
04/03/23 10:51:47 at java.lang.Thread.run(Unknown Source)
04/03/23 10:51:48 Oracle Application Server Containers for J2EE 10g
(10.0.3.0.0) - Developer Preview initialized
### Describe in detail the problem you are having: ###
Trying to override the parser used by our application and getting the error
above in the console. I also have <web-app-class-loader
search-local-classes-first="true" include-war-manifest-class-path="true" />
set in the orion-web.xml for our application.
I've tried various options on the command line, this seems to get the furthest
but our app doesn't start.

Thanks, I did try that as well.....
E:\o10g\j2ee\home>java -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Dorg.xml.sax.driver=
org.apache.xerces.parsers.SAXParser -Djavax.xml.parsers.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -Xbootclasspath/a:e:\o10g\dom4j-1.
4\dom4f-1.4\lib\tool\xerces.jar -DCRN_ROOT=f:\cognos\crn -jar oc4j.jar
04/03/25 07:50:28 Node started with id=68984609063434
04/03/25 07:50:35 setting transaction-timeout to:30000
04/03/25 07:50:48 log4j:WARN LogFileWatchdog: shutDownHierarchy
04/03/25 07:50:48 log4j:WARN LogIPFControl - Unknown error during initialize
04/03/25 07:50:48 log4j: Setting IPF internal debugging to true
04/03/25 07:50:49 log4j:WARN No appenders could be found for logger (Audit.RTUsage.CAM.CRP.jcam).
04/03/25 07:50:49 log4j:WARN Please initialize the log4j system properly.
04/03/25 07:50:50 log4j: Log Server Port is: 9362
04/03/25 07:50:50 log4j: Encoding set to: false
04/03/25 07:50:50 log4j: Number of Server Worker Threads is: 10
04/03/25 07:50:50 log4j: Encoding set to: false
04/03/25 07:50:50 log4j: Relative file path set to: F:/cognos/crn/logs/crnserver.log
04/03/25 07:50:50 log4j: Exception encountered while trying to convert configuration document into W3C Document.
04/03/25 07:50:50 log4j:ERROR null
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-7 JVM used memory: 8699568
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-8 JVM used memory: 8837624
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-9 JVM used memory: 8838480
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-10 JVM used memory: 8839536
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-11 JVM used memory: 8840392
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-12 JVM used memory: 8841248
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-13 JVM used memory: 8842304
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-14 JVM used memory: 8843160
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-15 JVM used memory: 8844016
04/03/25 07:50:50 log4j: ***** Thread begin: Thread-16 JVM used memory: 8845072
04/03/25 07:50:51 Warning: Error occurred using JAXP to load a SAXParser. Will use Aelfred instead
04/03/25 07:50:52 Oracle Application Server Containers for J2EE 10g (10.0.3.0.0) - Developer Preview initialized

Similar Messages

  • How to deal with empty tags in a SAX Parser

    Hi,
    I hope someone can help me with the problem I am having!
    Basically, I have written an xml-editor application. When an XML file is selected, I parse the file with a SAX parser and save the start and end locations of all the tags and character data. This enables me to display the xml file with the tags all nicely formatted with pretty colours. Truly it is a Joy To Behold. However, I have a problem with tags in this form:
    <package name="boo"/>
    because the SAX parser treats them like this:
    <package name = boo>
    </package>
    for various complex reasons the latter is unaccetable so my question is: Is there some fiendishly clever method to detect tags of this type as they occur, so that I can treat them accordingly?
    Thanks,
    Chris

    I have spent some time on googling for code doing this, but found nothing better, than I had to write in by myself.
    So, it would be something like this. Enjoy :)
    package comd;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.Attributes;
    import java.util.Stack;
    import java.util.Enumeration;
    public class EmptyTagsHandler extends DefaultHandler {
         private StringBuilder xmlBuilder;
         private Stack<XmlElement> elementStack;
         private String processedXml;
         private class XmlElement{
              private String name;
              private boolean isEmpty = true;
              public XmlElement(String name) {
                   this.name = name;
              public void setNotEmpty(){
                   isEmpty = false;
         public EmptyTagsHandler(){
              xmlBuilder = new StringBuilder();
              elementStack = new Stack();
         private String getElementXPath(){
              StringBuilder builder = new StringBuilder();
              for (Enumeration en=elementStack.elements();en.hasMoreElements();){
                   builder.append(en.nextElement());
                   builder.append("/");
              return builder.toString();
         public String getXml(){
              return processedXml;
         public void startDocument() throws SAXException {
              xmlBuilder = new StringBuilder();
              elementStack.clear();
              processedXml = null;
         public void endDocument() throws SAXException {
              processedXml = xmlBuilder.toString();
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              if (!elementStack.empty()) {
                   XmlElement elem = elementStack.peek();
                   elem.setNotEmpty();
              xmlBuilder.append("<");
              xmlBuilder.append(qName);
              for (int i=0; i<attributes.getLength();i++){
                   xmlBuilder.append(" ");
                   xmlBuilder.append(attributes.getQName(i));
                   xmlBuilder.append("=");
                   xmlBuilder.append(attributes.getValue(i));
              xmlBuilder.append(">");
              elementStack.push(new XmlElement(qName));
         public void endElement(String uri, String localName, String qName) throws SAXException {
              XmlElement elem = elementStack.peek();
              if (elem.isEmpty) {
                   xmlBuilder.insert(xmlBuilder.length()-1, "/");
              } else {
                   xmlBuilder.append("</");
                   xmlBuilder.append(qName);
                   xmlBuilder.append(">");
              elementStack.pop();
         public void characters(char ch[], int start, int length) throws SAXException {
              if (!elementStack.empty()) {
                   XmlElement elem = elementStack.peek();
                   elem.setNotEmpty();
              String str = new String(ch, start, length);
              xmlBuilder.append(str);
         public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
              String str = new String(ch, start, length);
              xmlBuilder.append(str);
    }

  • XML - SAX Parsing Question

    Hi,
    I am parsing XML using SAX parser and fill the values into the HashTable ( like Key value pair ).. so i can get the vaues for a particular key using hash get function.
    For the following XML. There are 2 "subscriberNumber" attribute, one is under "sn:Subscriber" and the another is under "sn:SubscriberChange".
    I can able to put this values in hash table and when i print the Hash table it is printing as sn:subscriberNumber=[1234567890, 1234567890] .. But how will i know which one is from "sn:Subscriber" and which is from "sn:SubscriberChange"
    This is the XML :
    <sn:SubscriberNotification>
    <sn:notificationSubType>1120</sn:notificationSubType>
    <sn:Subscriber>
         <cng:PaymentType>PostPaid</cng:PaymentType>
         <sn:subscriberNumber>1234567890</sn:subscriberNumber>
    </sn:Subscriber>
    <sn:SubscriberChange>
         <sn:subscriberNumber>1234567890</sn:subscriberNumber>
    </sn:SubscriberChange>
    </sn:SubscriberNotification>
    Any suggestion and pointers are really helpful
    Thanks,
    -Raj..

    Try something like this:
    import java.util.Stack;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    class MyHandler extends DefaultHandler {
        Stack openTags = new Stack();
        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
            if (qName.equals("sn:subscriberNumber")) {
                String parentTag = (String)openTags.peek();
                System.out.println("Parent tag of this <sn:subscriberNumber> is : <" + parentTag + ">");
            openTags.push(qName);
        public void endElement(String uri, String localName, String qName) throws SAXException {
            openTags.pop();
    }Regards

  • Xml sax parser

    Hi all,
    I am newbie to xml. I am using SAX parser for parsing xml documents. I have to write a code which parses all types of xsd files(including which can contain inline , referenced or both). Can anyone help / guide me how to code a generic xsd parser??
    Thanks in advance,

    An XSD file is an XML file, so you can parse it using sax.
    See :
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/work/Echo02.java
    See also:
    http://www.oracle.com/technology/tech/xml/xdk/doc/production/java/doc/java/javadoc/oracle/xml/parser/schema/XMLSchema.html#getXMLSchemaNodeTable

  • XML SAX parser that support  LexicalHandler

    Hello,
    I'm looking for an XML SAX parser that support a LexicalHandler.
    I have xml files that are not well formed, ie: (&, <, >, etc...) characters within tags and I need to ignore them.
    Anyone have a link to some opensource library ??
    Thanks,
    Samir

    Don't waste your time. Using a LexicalHandler isn't going to help with parsing malformed XML. You should get the person who produced those files to replace them with correct XML.
    PC&#178;

  • Why are all the events in the XML SAX parser not activated?

    Hi everyone,
    I have written a mini server that parses XML files into SQL queries.
    Below is a segment of my code;
              try          {                                                       
                   Class.forName( JDBC_DRIVER );
                   myConnection = DriverManager.getConnection( DATABASE_URL, "username", "password");                                                  
                   EventXMLParser myEXP = new EventXMLParser(directory, myConnection);
                   File[] xmlFiles = directory.listFiles();
                   for (File xmlFile : xmlFiles)               {     
                        myEXP.XMLtoDB(xmlFile);
                        outWriter.println("File:" + xmlFile.getName() + " DONE");
              } catch (SQLException e)     {
                   System.err.println("SQLException for establishing connection");
                   e.printStackTrace();
              } catch (ClassNotFoundException e)     {
                   System.err.println("CLASS NOT FOUND EXCEPTION HERE");
                   e.printStackTrace();
              } catch (Exception e)     {
                   System.err.println(e);
                   e.printStackTrace();
              finally {
                   outWriter.println("PARSING COMPLETED");
                   outWriter.close();
         }Where the constructor EventXMLParser constructs the following:
         public EventXMLParser(File path, Connection connection)     {
              super();
              try     {
                   this.XMLpath = path;
                   this.db_connection = connection;
                   this.xr = XMLReaderFactory.createXMLReader();
                   this.XMLSAXhandler  = new DefaultHandler(); //create a new own handler
                   this.xr.setContentHandler(XMLSAXhandler);
                   this.xr.setErrorHandler(XMLSAXhandler);
                   //System.out.println("DEBUG: db_connection is " + db_connection.toString());
              catch (Exception e)     {
                   System.out.println("Constructor Error!");
                   e.printStackTrace();
         }Below are all my helper methods within EventXMLParser.java
         public void XMLtoDB(String XMLpath) throws Exception  {
              try     {
                   //Input
                   System.out.println("XMLpath is : " + XMLpath);
                   /*FileReader r = new FileReader(XMLpath); debug
                   InputSource in = new InputSource(r);
                   xr.parse(in);
                   xr.parse(XMLpath);
                   /* Note that while parsing, the end of each event, </event>
                    * will trigger sendSQL to execute the query on the database
              catch (Exception e)     {
                   throw new Exception("Error with XMLtoDB!! Exception: " + e);
         public void sendSQL(Event event, Connection sql_connection) throws SQLException     {
                   //JDBC part
                   try     {
                        System.err.println("DEBUG sendSQL");
                        Statement sql_statement = sql_connection.createStatement();
                        ResultSet resultSet = sql_statement.executeQuery( event.toSQL() );
                   catch (SQLException e)     {
                        e.printStackTrace();
         /* Parsing XML
          * From here onwards it's all designed for the SAX Parsing with different event calling methods
         public void startDocument()     {
              System.err.println("Start Document");
         public void endDocument()     {
              System.err.println("End Document");
         public void startElement(String uri, String name, String qName, Attributes atts)     {
              CurrentElement= name;
              System.out.println("This is parsing");
         public void characters(char ch[], int start, int length)     {
              SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
              StringBuffer sb = new StringBuffer();
              for (int i = start; i < start + length; i++)     
                   sb.append(ch);
              String content = sb.toString();
              if (CurrentElement.equals("eid"))
                   temp.setEventID( (Integer.valueOf(content)).intValue() ) ;
              else if (CurrentElement.equals("sd"))
                   temp.setShort_description(content);
              else if (CurrentElement.equals("ld"))
                   temp.setLong_description(content);
              else if ( (CurrentElement.equals("dt")))
                   temp.setDate_Time( formatter.parse(content, new ParsePosition(0)) );
              else if (CurrentElement.equals("repeat"))
                   temp.setRepeat_pattern( (Integer.valueOf(content)).intValue() );
              else if (CurrentElement.equals("valid"))
                   temp.setValid_period(content);
              else if (CurrentElement.equals("status"))     {
                   temp.setStatus( (Integer.valueOf(content)).intValue() );
              else {}
         public void endElement(String uri, String name, String qName)     {
              System.err.println("DEBUG" + temp.toString()); /*debug*/
              if (name.equals("event"))     {
                   try     {
                        /*debug*/ temp.setUserID(1);
                        /*debug*/ System.err.println("DEBUG: " + temp.toString());
                        sendSQL(temp, db_connection);
                        //temp = new Event();
                   catch (SQLException e)     {
                        System.err.println(e);
                   }//end catch
              }//end try
    Where event is a public class Event     {
         //fields
         private int userID = 1; // = 1 only applies for testing
         private int eventID;
         private String short_description;
         private String long_description;
         private Date date_time = null;
         private int repeat_pattern;
         private String valid_period;
         private int status;     //1 for new, 0 for modification and -1 for delete
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
         //Constructors
         //every event requires the following: userID eventID and short_Description
         public Event(int uID, int eID, String shortDescrp)     {
              setUserID(uID);
              setEventID(eID);
              setShort_description(shortDescrp);
         public Event(int uid, int eid, String sd,
                                  String ld, Date d_t, int r_p, String v_p, int s)     {
              setUserID(uid);
              setEventID(eid);
              setShort_description(sd);
              setLong_description(ld);
              setDate_Time(d_t);
              setRepeat_pattern(r_p);
              setValid_period(v_p);
              setStatus(s);
         //set
         public void setUserID (int x)                         { this.userID = x ;}
         public void setEventID (int x)                         { this.eventID = x ;}
         public void setShort_description (String x)          { this.short_description = x ;}
         public void setLong_description (String x)          { this.long_description = x ;}
         public void setDate_Time(Date x)                    { this.date_time = x ;}
         public void setRepeat_pattern (int x)               { this.repeat_pattern = x ;}
         public void setValid_period (String x)               { this.valid_period = x ;}
         public void setStatus (int x)                         { this.status = x; }
         //get
         public int           getUserID()                              { return this.userID;}
         public int           getEventID()                         { return this.eventID;}
         public String      getShort_description()               { return this.short_description;}
         public String      getLong_description()               { return this.long_description;}
         public Date        getDate_Time()                         { return this.date_time;}
         public int         getRepeat_pattern()                    { return this.repeat_pattern;}
         public String      getValid_period()                    { return this.valid_period;}
         public int           getStatus()                              { return this.status; }
         //Event to SQL statements;
         public String toSQL()     {
              StringBuffer sb = new StringBuffer();
              ///if ( status == 1)     {
                   sb.append( "INSERT INTO events SET" );
                   sb.append( " userID = " + userID + ", ");
                   sb.append( "eventID = " + eventID + ", " );
                   sb.append( "short_description = " + "\'" + short_description + "\'" + ", "); //String
                   sb.append( "long_description = " + "\'" + long_description + "\'"  + ", "); //String
                   sb.append( "date_time = " + "\'" + formatter.format(date_time) + "\'" + ", ");
                   sb.append( "repeat_pattern = " + repeat_pattern + ", " );
                   sb.append( "valid_period = " + "\'" + valid_period + "\'" ); //String
                   sb.append( ";");
              //} else if ( status == 2)      {
              System.err.println(sb.toString());
              return sb.toString();
    }     My question is: I have taken my SQL query generated by toSQL() method in events and it worked.
    Here is the funny thing:
    Everything is correct syntax wise: No complaints what soever
    The mysql part works: Tested separately.
    So I tend to think that the problem lies within the SAX parser. I have written SAX2 parsers on this machine before and they have worked too. I tried inserting println statements all over startElement endElement etc etc only to find out that the SAX parser did not call any of the methods that I overided!! Why is that so?
    Can you guys spot where my SAX parser fails?

    I see.
    I try to correct this problem by removing super();
    so right now my code looks like this:
         static Event temp = new Event(0, 0, "null", "null", new Date(), 0, "null", 0);
         static String CurrentElement = null;
         static File XMLpath;
         static Connection db_connection;
         static XMLReader xr;
         static DefaultHandler XMLSAXhandler; 
         //Constructor,      Build the SAX Parser
         public EventXMLParser(File path, Connection connection)     {
              try     {
                   this.XMLpath = path;
                   this.db_connection = connection;
                   this.xr = XMLReaderFactory.createXMLReader();
                   this.XMLSAXhandler  = new DefaultHandler(); //create a new own handler
                   this.xr.setContentHandler(XMLSAXhandler);
                   this.xr.setErrorHandler(XMLSAXhandler);
                   //System.out.println("DEBUG: db_connection is " + db_connection.toString());
              catch (Exception e)     {
                   System.out.println("Constructor Error!");
                   e.printStackTrace();
         }This time, I created a new instance of default handler() which can be referenced by as the objects's XMLSAXhandler. However, that did not solve the problem, why does the problem still persist?
    Right now, there is only one instance of a default handler created. So why does all my parsing event functions still get ignored?

  • How to Create XML file with SAX parser instead of DOM parser

    HI ALL,
    I am in need of creating an XML file by SAX parser ONLY. As far as my knowledge goes, we can use DOM for such purpose(by using createElement, creatAttribute ...). Can anyone tell me, is there any way to create an XML file using SAX Parser only. I mean, I just want to know whether SAX provides any sort of api for Creatign an element, attribute etc. I know that SAX is for event based parsing. But my requirement is to create an XML file from using only SAX parser.
    Any help would be appreciated
    Thanx in advance
    Kaushik

    Hi,
    You must write a XMLWriter class yourself, and that Class extends DefaultHandle ....., the overwrite the startElement(url, localName, qName, attributeList), startDocument(), endElement().....and so on.
    in startElement write your own logic about how to create a new element and how to create a Attribute list
    in startDocument write your own logic about how to build a document and encodeType, dtd....
    By using:
    XMLWriter out = new XMLWriter()
    out.startDocument();
    Attribute attr1 = new Atribute();
    attr1.add("name", "value");
    out.startElement("","","Element1", attr1);
    Attribute attr2 = new Atribute();
    attr2.add("name", "value");
    out.startElement("","","Element2", attr2);
    out.endElement("","","Element2");
    out.endElement("","","Element1");
    out.endDocument();

  • Error processing request in sax parser  No 'action' attribute found in XML

    Hi All,
            I am doing a FILE to JDBC Scenario.  I just want to send a data from file to Sql Db table. For this I have written a stored procedure to insert the row in a table.
    This is the message mapping for FILE to JDBC ….
    Sender                                                                   Receiver
    *FILESENDER_MT  1..1    FILESENDER_DT     * SPRECEIVER_MT    1..1
        .NO                    1..1    xsd:string                    * Statement           1..1   string
        .Name                1..1    xsd:string                      *user_PROC       1..1                                                                               
    action            1..1required
                                                                                *No                                                                               
    isInput        1..1  string
                                                                                    type           1..1  string
                                                                                *Name
                                                                                    isInput        1..1  string
                                                                                    type           1..1  string 
    Mapped Values....
    Statement is mapped with <b>FILESENDER_MT</b>
    action attribute is mapped with "<b>EXECUTE</b>" Constant
    No is mapped with <b>NO</b>
    Name is mapped with <b>Name</b>
    for both isInput is mapped with <b>TRUE</b>
    for both type is mapped with <b>CHAR</b>
    Here is the my stored procedure.....
    CREATE PROCEDURE [dbo].[user_PROC]
    @NO char(10),  @Name char(10)  AS
    insert into FILE2JDBC values('a','ab')
    GO
    when i run this stored procedure in Sql directly it was executed successfully....
    I have checked In SXMB_MONI status is showing green...
    xml messages from SXMB_MONI ....
    this is the message from payloads of Inbound Message
    <PRE> <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:FILESENDER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
      <NO>111</NO>
      <NAME>murthy</NAME>
      </ns0:FILESENDER_MT></PRE>
    this is the message from payloads of Request Message Mapping
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SPRECEIVER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
    - <Statement>
    - <user_PROC>
      <action>EXECUTE</action>
    - <NO>
      <isInput>TRUE</isInput>
      <type>CHAR</type>
      </NO>
    - <Name>
      <isInput>TRUE</isInput>
      <type>CHAR</type>
      </Name>
      </user_PROC>
      </Statement>
      </ns0:SPRECEIVER_MT>
    this is the error showing in runtime workbench>component monitoring->communication channel monitoring-->Receiver Communication Channel....
    <b>Error while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)</b>
    Can any body tell me whether the problem is in Mapping or in Data Type Structure..
    Please resolve this issue....
    Thanks in Advance,
    Murthy.

    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SPRECEIVER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
    - <Statement>
    <b>- <user_PROC>
    <action>EXECUTE</action></b>
    - <NO>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </NO>
    - <Name>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </Name>
    </user_PROC>
    </Statement>
    </ns0:SPRECEIVER_MT>
    The Action should be a Attribute of Element user_Proc as,
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:SPRECEIVER_MT xmlns:ns0="http://www.prospectadelhi.com/DELHI_FILE2JDBC">
    - <Statement>
    <b>- <user_PROC action="Execute"></b>- <NO>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </NO>
    - <Name>
    <isInput>TRUE</isInput>
    <type>CHAR</type>
    </Name>
    </user_PROC>
    </Statement>
    </ns0:SPRECEIVER_MT>
    Likewise isInput and Type should be Attributes and not Elements .
    Regards
    Bhavesh

  • Sax parser problem

    hi,
    i am assuming the problem is with sax parser but i cant be sure. I am parsing a xml file (about 1.4MB) with some data in it. the parser i have created reads the xml file correctly for the most part but when at some point the
    "public void characters(char buf[], int offset, int len) throws SAXException"
    function stops working correctly....i.e it doesnt fully read read the data between the "<start>" and "</start>" element. say it reads about 100 id's correctly---for 101 ID it does this. This is just an example. Since, the problem might be with how :
    "public void characters(char buf[], int offset, int len) throws SAXException"
    function is reading the data i was wondering if anybody else had encountered this problem or please let me know if i need to change something in the code: here's a part of the code :
    Bascially i have created three classes to enter data into three mysql tables and as i parse the data i fill up the columns by matching the column header with the tagName.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.*;
    import java.io.*;
    import java.util.ArrayList;
    import java.lang.Object;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import java.util.*;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    public class Echo03 extends DefaultHandler
    StringBuffer textBuffer;
    int issuedValue, prodValue;
    OrdHeader header = new OrdHeader();
    OrdDetail detail = new OrdDetail();
    Member memInfo = new Member();
    //new addition to store the dynamic value of the products
    TestOrdheader prod = new TestOrdheader();
    int counter;
    String tag, newTag;
    SetValue setVal = new SetValue();
    String test;
    public static void main(String argv[])
    if (argv.length != 1) {
    System.err.println("Usage: cmd filename");
    System.exit(1);
    // Use an instance of ourselves as the SAX event handler
    DefaultHandler handler = new Echo03();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    // Set up output stream
    out = new OutputStreamWriter(System.out, "UTF8");
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse( new File(argv[0]), handler);
    } catch (Throwable t) {
    t.printStackTrace();
    System.exit(0);
    static private Writer out;
    private String indentString = " "; // Amount to indent
    private int indentLevel = 0;
    //===========================================================
    // SAX DocumentHandler methods
    //===========================================================
    public void startDocument()
    throws SAXException
    nl();
    nl();
    emit("START DOCUMENT");
    nl();
    emit("<?xml version='1.0' encoding='UTF-8'?>");
    header.assign();
    public void endDocument()
    throws SAXException
    nl(); emit("END DOCUMENT");
    try {
    nl();
    out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    public void startElement(String namespaceURI,
    String lName, // local name
    String qName, // qualified name
    Attributes attrs)
    throws SAXException
    indentLevel++;
    nl(); //emit("ELEMENT: ");
    String eName = lName; // element name
    if ("".equals(eName)) eName = qName; // namespaceAware = false
    if (qName.equals("Billing")){
    issuedValue = 1;
    }else if (qName.equals("Shipping")){
    issuedValue = 2;
    }else if (qName.equals("ShippingTotal")){
    issuedValue = 3;
    //check to see if "Product" is the name of the element thats coming next
    if (qName.equals("Product")){
    if (issuedValue != 3){
    prodValue = 1;
    prod.addCounter();
    }else{
    prodValue = 0;
    tag = eName;
    if (attrs != null) {
    for (int i = 0; i < attrs.getLength(); i++) {
    String aName = attrs.getLocalName(i); // Attr name
    if ("".equals(aName)) aName = attrs.getQName(i);
    nl();
    emit(" ATTR: ");
    emit(aName);
    emit("\t\"");
    emit(attrs.getValue(i));
    emit("\"");
    if (attrs.getLength() > 0) nl();
    public void endElement(String namespaceURI,
    String sName, // simple name
    String qName // qualified name
    throws SAXException
    nl();
    String eName = sName; // element name
    if ("".equals(eName)){
    eName = qName; // not namespaceAware
    if ("Order".equals(eName)){          
    //enter into database
         databaseEnter();
    textBuffer = null;
    indentLevel--;
    public void characters(char buf[], int offset, int len)
    throws SAXException
    nl();
    try {
    String s = new String(buf, offset, len);
    if (!s.trim().equals("")){
    settag(tag, s);
    s = null;
    }catch (NullPointerException E){
    System.out.println("Null pointer Exception:"+E);
    //===========================================================
    // Utility Methods ...
    //===========================================================
    // Wrap I/O exceptions in SAX exceptions, to
    // suit handler signature requirements
    private void emit(String s)
    throws SAXException
    try {
    out.write(s);
    out.flush();
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    // Start a new line
    // and indent the next line appropriately
    private void nl()
    throws SAXException
    String lineEnd = System.getProperty("line.separator");
    try {
    out.write(lineEnd);
    for (int i=0; i < indentLevel; i++) out.write(indentString);
    } catch (IOException e) {
    throw new SAXException("I/O error", e);
    ===================================================================
    ///User defined methods
    ===================================================================
    private String strsplit(String splitstr){
    String delimiter = new String("=");
    String[] value = splitstr.split(delimiter);
    value[1] = value[1].replace(':', ' ');
    return value[1];
    public void settag(String tag, String s){         
    String pp_transid = null, pp_respmsg = null,pp_authid = null, pp_avs = null, pp_avszip = null;
    if ((tag.equals("OrderDate")) || (tag.equals("OrderProcessingInfo"))){
    if (tag.equals("OrderDate")){
    StringTokenizer st = new StringTokenizer(s);
    String orddate = st.nextToken();
    String ordtime = st.nextToken();
    header.put("ordDate", orddate);
    header.put("ordTime", ordtime);
    }else if (tag.equals("OrderProcessingInfo")){
    StringTokenizer st1 = new StringTokenizer(s);
    int tokenCount = 1;
    while (tokenCount <= st1.countTokens()){
    switch(tokenCount){
    case 1:
    String extra = st1.nextToken();
    break;
    case 2:
    String Opp_transid = st1.nextToken();
    pp_transid = strsplit(Opp_transid);
    break;
    case 3:
    String Opp_respmsg = st1.nextToken();
    pp_respmsg = strsplit(Opp_respmsg);
    break;
    case 4:
    String Opp_authid = st1.nextToken();
    pp_authid = strsplit(Opp_authid);
    break;
    case 5:
    String Opp_avs = st1.nextToken();
    pp_avs = strsplit(Opp_avs);
    break;
    case 6:
    String Opp_avszip = st1.nextToken();
    pp_avszip = strsplit(Opp_avszip);
    break;
    tokenCount++;
    header.put("pp_transid", pp_transid);
    header.put("pp_respmsg", pp_respmsg);
    header.put("pp_authid", pp_authid);
    header.put("pp_avs", pp_avs);
    header.put("pp_avszip", pp_avszip);
    }else{
    newTag = new String(setVal.set_name(tag, issuedValue));
    header.put(newTag, s);
    //detail.put(newTag, s);
    prod.put(newTag, s);
    memInfo.put(newTag,s);
    //Check to see-- if we should add this product to the database or not
    boolean check = prod.checkValid(newTag, prodValue);
    if (check){
    prod.addValues(s);
    setVal.clearMod();
    ==================================================================
    Here's the error that i get:
    java.util.NoSuchElementException
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
    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:281)
    at Echo03.main(Echo03.java:47)

    I haven't gone through your code but I also had a similar error....and the exception in my was because of an "&" instead of the entity reference & in one of the element values. I use a non-validating parser but if you use a validating one then this might not be the reason for your exception.

  • SAX Parser

    I am using the sax parser provided by the package javax.xml.parsers to parse an XML file. It works fine as long as I have an XML file which has English characters. When I use it for parsing a file which has Korean characters in it, the parser fails to recognize them.
    It used to throw an error "Line too long" on reading the Korean characters. Then I added an XML directive encoding="EUC-KR" and now it reads the file but does not recognize the characters correctly. It reads all the korean characters as question marks ('??').
    Any pointers on what can be done to fix this problem.
    Thanks,
    RahulJ

    Hi,
    We've got a very similar problem. I'm parsing with SAX and DOM but the MS special characters keep appearing as ? or ??.
    If the encoding is not specified in the XML file there are Parser Exceptions. If I set the encoding to "JISAutoDetect", "JIS", "MS932", "Cp1250 to Cp1258" or "ISO8859-1" then there are no exceptions but the stray characters still appear as ?s.
    I managed to display the left and the right quotation marks in a servlet by setting the response Content Type to "text/html; charset=Shift_JIS" and the encoding="Cp1252" in the XML file. But I still have problems with the rest of the characters.
    What kind of output do you use? Do you display in a web page or you just write to a file?
    Thanks,
    Ross

  • Using the SAX Parser

    As I reported in this thread: Carriage Returns in XSLT output I am trying to produce a text output file with each line terminating in cr-lf (using the output from ViewObject.writeXML() passed through the XSLProcessor.processXSL() method to apply a XSLT stylesheet transformation to it), but the cr characters in the stylesheet are being converted to nl characters, so I am ending up with two nl characters at the end of each line.
    I found a 2002 query (here: http://www.xslt.com/html/xsl-list/2002-04/msg00193.html) by someone with the same problem, and a reply by Steve Muench explaining it and stating that the Oracle SAX parser does not have the same problem.
    So my question now is - does the SAX parser still retain cr characters (or is it too now converting them to nl) and if it does, how do I make XSLProcessor.processXSL() use it rather than the default XML parser? Can I do it from within my code, or does it need to be set in some sort of environment variable? We are on version 9.0.5.2 of JDeveloper(10g)

    Repost

  • JDBC receiver adapter - Error processing request in sax parser

    Hello,
    I want to INSERT idoc data via JDBC adapter into a MS SQL database. After digging through SAP Help, numerous blogs and forum discussions on SDN and even posting an OSS message I still get the same error:
    'Error: TransformException error in xml processor class: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)'
    When testing my mapping in the Integration Repository the resulting XML message is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Employee xmlns:ns0="http://prodrive.nl/xi/HRMasterdata/HRMD_A_2_d_bcommerp">
       <STATEMENT>
          <T_PD_Employees action="INSERT">
             <access>
                <KeyTag>00088888</KeyTag>
                <PerNo>00088888</PerNo>
             </access>
          </T_PD_Employees>
       </STATEMENT>
    </ns0:Employee>
    The connection to the database is fine, Sender adapter with a SELECT * works perfect.
    Can anyone help me solve this problem? I'm lost.
    Best regards,
    Roelof Jan Bouwknegt

    Hi Bhavesh,
    I have tried out the change you suggested. Without success. Message I get back is
    - 2006-12-28 10:34:08 CET: Error: TransformException error in xml processor class: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)
    structure in testtool:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Employee xmlns:ns0="http://prodrive.nl/xi/HRMasterdata/HRMD_A_2_d_bcommerp">
       <STATEMENT>
          <T_PD_Employees action="INSERT">
             <ACCESS>
                <KEYTAG>00088888</KEYTAG>
                <PERNO>00088888</PERNO>
             </ACCESS>
          </T_PD_Employees>
       </STATEMENT>
    </ns0:Employee>
    Somehow the SAX  parser doesn't like the result of my mapping. Maybe there is something wrong with the structure cardinality. Let me describe what I have built:
    XSD:
    WA_T_PD_Employees - Complex Type
    > STATEMENT - Element - Occurence = 1
    >> T_PD_Employees - Element - Occurence = 1
    >>> STATEMENT - Attribute - Occurence = optional
    >>> access - Element - Occurence = 1..Unbounded
    Best regards Roelof Jan and thanks for your quick response

  • Error processing request in sax parser

    Hi all,
    I am doing an asynchronous interface.
    It is an interface from IDOC to JDBC. While testing the interface,am getting the following error
    "Error processing request in sax parser: Error when executing statement for table/stored proc. 'put_delivery' (structure 'Statement_Delivery'): java.lang.NumberFormatException: null"
    Any kind of help is appreciated.
    Regards,
    Thireesha.

    Hello,
    Please refer to SAP NOTE 801367.
    In advanced tab, use logSQLQuery-->true. Tt will display the actual sql statement in audit log instead of xml format.
    You can copy this sql statement and execute directly in database to check the problem.
    -Rahul

  • Error processing request in sax parser...Excepciu00F3n de E/S: Connection reset

    Hello,
    I've RFC to JDBC interface.
    Sometimes in the RWB me the following error message,
    <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'LISMATWQ' (structure 'STATEMENT'): java.sql.SQLException: Excepción de E/S: Connection reset</SAP:AdditionalText>
    <SAP:ApplicationFaultMessage namespace="" />
    How can I prevent?
    Thanks very much,

    Hello,
    the error does not always appear, sometimes the interface works well and others do not (even when the data are the same) I find no solution to this error,
    anyone have any idea?
    thanks very much

  • Error processing request in sax parser: Error when executing statement...

    Hello,
    I want to INSERT data from R/3 System to AS400 via JDBC adapter into a DB2 database. The interfaces from R/3 are Ok. but i have some problems to use the JDBC in DB2 Systems. The message in comunitation channel is:
    " Error processing request in sax parser: Error when executing statement for table/stored proc. 'SPE106TST' (structure 'STATEMENT'): java.sql.SQLException: SPE106TST de SADMT1 no válido para la operación."
    in the SXMB_MONI -> Request Message Mapping payloads this:
    The connection to the database is fine, Sender adapter with a SELECT * works perfect.
    Please Can anyone help me solve this problem? I'm lost.
    Best regards,
    Edited by: Nicola Occhipinti on May 22, 2008 7:40 PM

    Hi Nicola,
    This error occurs when the receiver side structure is incorrect.
    Your structure seems to be correct.
    Please use lower case for action, access and table.
    Please check whether the field names are exactly the same as in the actual Database table sadmt1.SPE106TST.
    Check if the table has permissions to write.
    You can try an alternate structure without using table tag.
    <ns0:MT_XMLSQL_SPEC xmlns:ns0="urn:damm.com/pi/EmployeeMasterData">
    <STATEMENT>
    <sadmt1.SPE106TST action="INSERT">
    <access>
    <CODEMP>D</CODEMP>
    <CODPRO>00202339</CODPRO>
    <NOMPRO>ROSIQUE PERALSGENIS</NOMPRO>
    <DIRPRO>GIRONA</DIRPRO>
    <POBPRO>S. VICENS HORTS</POBPRO>
    <RUTA>0</RUTA>
    <ORDEN>0</ORDEN>
    <NOMINA>S</NOMINA>
    </access>
    </sadmt1.SPE106TST>
    </STATEMENT>
    </ns0:MT_XMLSQL_SPEC>
    Hope your problem gets solved.
    -Shamly

Maybe you are looking for

  • Another "DO NOT DISCONNECT" problem

    Before I go on I have 2 Nano's , so the problem I have is only with one of them. So this should eliminate many of the potential solutions to this problem ie. it is not my PC , it is not i.tunes , it is not the charging / download lead etc etc. I have

  • Photoshop CS5.1 crashes using cron script that open application

    Photoshop CS5.1 crashes when trying to launch the application using a cron script. This happens on two different machines running 10.7.3. Photoshop opens without crashing when manually running the bash script. The same script works both manually and

  • Preview as default viewer of pdf's in safari

    After changing to Tiger and Safari 2, pdf's are not openend in preview, but in a new Safari window. If I want the pdf in Preview, I'll have to control-click it. However, the pdf then is not on my desktop, so that save as is not possible. How can I ha

  • I have restored my iPhone 4S and I m trying to activate my phone but its not getting activated

    I have restored my iPhone 4S to ios 8.2 and I m trying to activate my device write this: your iphone could not be active because the activation server cannot be reached.try connecting your iphone to itunes to active it,or try again in a couple of min

  • Vmware-server-modules and kernel 2.6.19 [solved]

    I'm trying to rebuild the vmware server modules from AUR for the new kernel. After adjusting the files for the kernel version and doing makepkg I get the following: ==> Validating source files with MD5sums VMware-server-1.0.1-29996.tar.gz ... Passed