SAX Parser exception in the reciever channel

Hi Experts,
We are using file to mail scenario in which we are using java mappings to handle the EDI files sent to the third party system.
Currenly we have got SAX exception in the reciever communication channel.
The sender communication channel has executed successfully.
Please find below the error at the reciever channel:
"failed to send mail: com.sap.aii.messaging.util.XMLScanException: java.lang.NullPointerException; nested exception caused by: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x32(:main:, row:1, col:106)(:main:, row=1, col=106) -> com.sap.engine.lib.xml.parser.ParserException: Name expected: 0x32(:main:, row:1, col:106)"
Please suggest whether the above error is related to the BASIS settings of the server or it is related to XI reciever channel settings.
Thanks and Regards,
Srikanth.

Hi Srikanth,
Tell us how the output payload looks like?? if you have used mail package xsd, then payload shoudl go to the Content of it.. Are you taking care of this??
Also if possible can you paste here the payload which you are getting after the operation mapping .
Regards
Suraj

Similar Messages

  • Processing Multiple files in the reciever channel

    Hi Experts,
    We have a scenario where PI is supposed to pick a zip file containing different files, Post which PI should unzip the files and send it to receiving system.
    We have used payload zip bean to unzip the files in the sender channel and it was successful. The problem here is the receiver channel.
    Receiver channel is not able to process all the files. The file name and extension is causing the problem as we have different file names and extensions.
    I tried using the Payload zip bean in the reciever channel too but again the file name and extension were the issue. Attached the screenshot of the message processed in the communication channel which clearly shows the kind of files we are expecting. we are using PI 7.4 single stack.
    Batch script is something we are not really looking at... Can you please provide some solution?

    unable to attach the screenshot sorry

  • Why the SAX parser cannot support the special character like "¡"

    I do not understand why the SAX parser cannot support the special character like &iexcl; but it can replace the &quot; &amp; &lt; &gt;   to ", &, <, >, ,, but other characters will be replaced to empty charater.
    can somebody give me any suggestions or solutions. THX.
    Edited by: 844086 on 2011-3-14 上午2:27
    Edited by: 844086 on 2011-3-14 上午2:27

    I quote:
    Alternatively implement an EntityResolver that resolves the desired escapes.You are again an example that people only read/register the first thing written in a post.

  • SAX parser exception : Namespace not supported by SAX parser

    Hi,
    I'm using xslt to transform xml to html. I've downloaded Xalan2J from Apache website and I've used Transformer factory implementation.
    The code works fine through Forte IDE environment where I've mounted jar files xerces.jar, xml-apis.jar, xalan.jar
    The problem occurs when I try to instantiate the same method through JSP page. It throws an exception
    SAXParser exception : Namespace not supported by SAXParser. I'm trying to run the jsp file through jakarta tomcat environment.
    I've included xerces.jar, xml-apis.jar, xalan.jar in my classpath. I fail to understand why namespace support is not available.
    Any help/suggetsions would be appreciated :)
    Thanks

    Hi,
    Yes, In tomcat environment, by default the jar files in the lib directory are set before reading the system classpath which causes a problem. One could replace the xerces.jar with a new jar file and delete parser.jar but that has its own set of problems.
    The other alternative would be to use something like
    System.setProperty("javax.xml.parsers.SAXParserFactory","org.apache.xerces.jaxp.SAXParserFactoryImpl");
    This worked for me..:)

  • Illegal XML character SAX Parser exception

    The element type "body" must be terminated by the matching end-tag "".  i get this exception, its thrown from the SAXParser. if you look at the end tag it shows you an empty string end-tag "". . This should get displayed as end-tag "</body>". instead.
    What can i do to make it displayed as end-tag "</body" . There are loads of similar issues on-line, but non of them had a satisfactory answer.
    help !

    and thanks for the replies :)Most of the replies you thank pointed you at searching how to escape HTML markup when copying the plain text to an HTML document. DId you consider doing this search?
    For example, Jakarta's Commons-Lang library has a [StringEscapeUtils class|http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html] with methods that seem to provide just this capability.
    now what i think i should do is, to append the auto generated error message with some special characters so it could display in html.No. The "special characters", or merely, special markup, are what makes the browser not render the string correctly (it probably thinks +</body>+ is the closing tag of the similarly-named HTML element. You need to escape this markup, or a at least the lower/greater signs that make it look like markup.
    but how can i chnage the auto generated message ?You shouldn't strive to change the message itself, but to convert it to something that renders correctly when embedded into an HTML document.
    Edited by: jduprez on Mar 17, 2010 12:35 PM

  • Using the SAX parser to split up a document to be processed by a DOMParser

    I need to process a potentially large document which could prove too large to be read into memory at once by the DOM parser. The document would look something like..
    (sorry about the formatting - can't use tabs!)
    <Root>
    <Parent>
    <Child>
    <Blah.....................
    </Blah>
    </Child>
    </Parent>
    <Parent>
    <Child.......
    </Child>
    </Parent>
    etc...
    etc...
    </Root>
    The number of Parent elements could potentially be in the thousands. What I would like to do would be to use the SAX parser to read the document and when a Parent element is encountered, write the parent element and all its children to a stream in order that an input source can be created. The input source can then be parsed by a DOM parser. Once complete, the next Parent element encountered by the SAX parser could be passed to the DOM parser and so on until all of the Parent elements have been processed.
    This way I can combine the ease of parsing the document using the DOM parser without having to worry about the overhead on memory.
    Does anyone have any ideas as to the best approach? I could use the SAX parser for the whole thing but the XML is quite complex and lends itself to DOM parsing much more conveniently.

    Can you read the file line by line:
    start the reading at <child>
    pause reading at </child>
    copy the string to a var
    wrap it with respective tags (<?xml<doctype etc...) and parse
    proceed to the next <child>xx</child>
    and repeat till you hit the closing of the file...
    - Ravi

  • 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

  • SAX Parser in OC4J

    I'm trying to read a XML file in an EJB using a SAX parser.
    I tried the following statement to create the reader
    XMLReader xr = XMLReaderFactory.createXMLReader("oracle.xml.parser.v2.SAXParser");
    but I obtain the following exception:
    java.lang.ClassNotFoundException: oracle.xml.parser.v2.SAXParser
    at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:118)
    The same works correctly from a command line application outside OC4J.
    Is there another SAX Parser I can use in OC4J?
    Andrea Mattioli

    I'm also seeing the a similar problem trying to get my EJB to parse SAX using the Xerces parser. If I do
    XMLReader myReader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    and place xerces.jar into $(OC4J_INSTALL_ROOT)\j2ee\home\lib then at runtime I get
    java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
    This is despite the fact that calling Class.forName() on the same class name works fine. Setting the system property org.xml.sax.driver and calling createXMLReader with no parameters results in the same error.
    I can force use of the Xerces SAX parser by bypassing the factory and just calling
    XMLReader myReader = new org.apache.xerces.parsers.SAXParser();
    but that seems a tad hacky and I don't want to hardwire SAX parser implementation choice into my code.
    Is this a known bug?
    Also which parser is getting used by default in OC4J i.e. if I don't set org.xml.sax.driver and use the no parameters variant of createXMLReader()?
    Thanks
    Alan

  • How to ? stop parsing SAX parser

    is there any way to tell the SAX parser for stoping the parsing.

    throw an exception (like MySaxiusInterruptus...)

  • 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

  • Jasper Parse Exception CRM HH Service

    I am getting a parse exception for the line in jsps that include this file -> "/include/HeadInclude.jsp".
    ated the following parse exception: org.apache.jasper.compiler.CompileException:
    C:\Documents and Settings\I806232\Documents\SAP\workspace\40SP08\cfg\service\tm
    p\app-root\include\HeadInclude.jsp(4,0) Bad file argument to include
    The file exists but still I get this error during pre-compilation.
    Any ideas?

    This is the standard HH Service war file. Almost every jsp in it uses the include tag so it won't be a good idea to change this in all the jsps.
    I checked the server.xml context path
    <Context path="" docBase="webapps/me" crossContext="true" debug="0" reloadable="false"
    />
    But this xml is not used during build time, is it? Is there anything missing from it. I dont see the HHService application context root in it..
    Thanks

  • SAX Parser Error in JDBC Adapter

    I am using a JDBC adapter to execute SQL statements during mapping runtime. However, it issues me an error regarding the SAX Parser when I have a '&' character in the SQL statement. I am not able to remove the & since it is in the database that I access and it will result to data inconsistency. I think that when the JDBC adapter of XI converts the SQL string to the XML format, it does not include the amp; string to the &, thus causing the SAX Parser to throw the error.
    Is there someway I can configure the JDBC adapter in such a way that it will replace the & with &amp;. Or is there a way to display how the JDBC adapter converts the SQL statement to its the XML representation of it?
    Thanks a lot.

    Hi,
    For this kind of situation use some unique character combination  like "#@!" for replacing "&" then parse the document and the restore the "&" later .
    For this convert the input stream into Strring and then replace the occurences of "&".
    regards.

  • SAX parser doesn't report IDREF type

    I have been trying to create my first DTD:
    <!ELEMENT Network (Node+, Link*)>
    <!ELEMENT Node EMPTY>
    <!ATTLIST Node
    ID ID #REQUIRED
    title CDATA #IMPLIED>
    <!ELEMENT Link EMPTY>
    <!ATTLIST Link
    source IDREF #REQUIRED
    dest IDREF #REQUIRED
    title CDATA #IMPLIED>
    and would expect that the source and dest attributes of the
    Link element would have the type IDREF when being parsed with
    the SAX parser. Using the SAXSample.java provided I get the
    following output for a test network:
    StartElement:Network
    IgnorableWhiteSpace
    StartElement:Node
    ID(ID)=node1
    title(CDATA)=test node
    EndElement:Node
    IgnorableWhiteSpace
    StartElement:Node
    ID(ID)=node2
    title(CDATA)=another node
    EndElement:Node
    IgnorableWhiteSpace
    StartElement:Link
    source(CDATA)=node2
    dest(CDATA)=node1
    EndElement:Link
    IgnorableWhiteSpace
    StartElement:Link
    source(CDATA)=node1
    dest(CDATA)=node2
    EndElement:Link
    IgnorableWhiteSpace
    EndElement:Network
    This clearly shows source and dest reported as CDATA type. Not
    exactly what's in the DTD.
    Is this an undocumented feature (a.k.a. bug?)
    Regards,
    Gary Howard.
    Smart Network Technology,
    Nortel Networks, UK
    null

    Thanks for the replies, but I don't think we are quite connecting. I do eventually want to be able to validate an XML file against a schema (which I can't do either), but first I want to be able to validate the schema file itself; i.e. to confirm that the schema I designed is a valid schema file. As I understand it, it should be possible to tell the parser that the schema to validate against is the "schema for writing schemas", http://www.w3.org/Schema/schema.xsd (or whatever it is). That's where I'm getting stuck, that the parser doesn't recognize the elements for actually defining a schema.

  • Buiding xml file using SAX parser of JAXP

    Please send me xml building using the sax parser.This is the urgent requirement ,iam not geeting how to solve this problem.so please anybody can help with one best example

    You don't build an XML file with a parser. A parser reads an XML file and converts it to some internal representation. Try reading this tutorial:
    http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/

Maybe you are looking for