Character conversion error

Hi all,
We are getting the following error when trying to parse an xml string resource - Character conversion error: "Illegal ASCII character, 0xc2" (line number may
be too low)-. We have not been able to get around this. We have tried creating the InputSource two different ways:
reader = new StringReader(stringSource);
src = new InputSource( reader );
and
src = new InputSource(new InputStreamReader(new ByteArrayInputStream(stringSource.getBytes())));
The problem does appear to go away if we treat the DTD we are validating against as a file. If we set it has a uri, we get the above problem.
Is anyone else experiencing this problem?
Any help would be greatly appreciated.
Thanks in advance,
Greg

Hi,
2 possible solutions:
1) try using the xerces parser instead of sun's parser
2) look at the posting at the following url and see wether the posted solution solves your problem: http://forums.java.sun.com/thread.jsp?forum=34&thread=67558
Hope this helps,
Kurt.

Similar Messages

  • "character conversion error" while parsing xml files

    Hello,
    I'm trying to parse MusicXML (Recordare) files, but I'm getting an exception.
    I'm using the SAX parser (javax.xml.parsers.SAXParser).
    Here is the code I use to instantiate it:
    final javax.xml.parsers.SAXParserFactory saxParserFactory = javax.xml.parsers.SAXParserFactory.newInstance();
    final javax.xml.parsers.SAXParser saxParser = saxParserFactory.newSAXParser();
    final org.xml.sax.XMLReader parser = saxParser.getXMLReader();
    I'm using my own handler, but I get the same exception even if I use org.xml.sax.helpers.DefaultHandler.
    The error I get is:
    Character conversion error: "Illegal ASCII character, 0xc2" (line number may be too low).
    The first few lines of my xml files look like this:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE score-partwise
    PUBLIC "-//Recordare//DTD MusicXML 0.6 Partwise//EN"
    "http://www.musicxml.org/dtds/partwise.dtd">
    <score-partwise>
    [...etc...]
    If I delete the <!DOCTYPE ...> line, then I don't get the exception anymore. But the MusicXML files I get (from some other program) always contain this line, and it would be quite some work to delete them from every file manually.
    So does anyone know if there is a way to avoid deleting that line in every file, while still being able to parse the xml files without exceptions?
    Or maybe does anyone know what the exact cause of the exception is? (because I don't know what exactly causes it)
    Thank you in advance.
    Greetz,
    Jipo

    So does anyone know if there is a way to avoid
    deleting that line in every file, while still being
    able to parse the xml files without exceptions?ok this is side-stepping the real problem but I've used this code to filterout DTD references for other reasons   public static InputStream filterOutDTDRef(InputStream in) throws IOException {
          BufferedReader iniReader = new BufferedReader(new InputStreamReader(in));
          StringBuffer newXML = new StringBuffer();
          for(String line = iniReader.readLine(); line!=null; line = iniReader.readLine())
             newXML.append(line+"\n");
          in.close();
          int s = newXML.indexOf("<!DOCTYPE ");
          if(s!=-1)
             newXML.replace(s,newXML.indexOf(">",s)+1,"");
          return new ByteArrayInputStream(newXML.toString().getBytes());
       }and it actually speeds up the parsing phase too (since the DTD ref.s were on the web and the XML standard mandates that there is a fetch for each xml file parsed..)
    you can feed the above into the InputSource constructor that takes an InputStream argument.
    Now for the real problem... 0xc2 is "LATIN CAPITAL LETTER A WITH CIRCUMFLEX" according to a unicode chart - which is not an ASCII character (as the error message correctly reports). I'm not sure why the file is being parsed as ASCII though? You could try parsing in a FileReader to the inputsource and hope it picks up the default character encoding of your system, and that that character encoding matches the file. Or you could try passing in a FileReader constructed with a explicit character encoding (eg "UTF8") and see if that does the trick?
    asjf

  • Character conversion error: Unconvertible UTF-8 character beginning..

    Hello,
    I'm using TrAX for XSLT transformations, and having a following
    problem
    Character conversion error: "Unconvertible UTF-8 character beginning with 0xa9" (line number may be too low).
    org.xml.sax.SAXParseException: Character conversion error: "Unconvertible UTF-8 character beginning with 0xa9" (line number may be too low).
            at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
            at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
            at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
            at org.apache.crimson.parser.Parser2.maybeTextDecl(Parser2.java:2795)
            at org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.java:2880)
            at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1167)
            at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
            at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
            at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
            at mlts.converter.XMLImport.outputESGML(XMLImport.java:311)
            at mlts.converter.Converter.processFile(Converter.java:312)
            at mlts.converter.Converter.Convert(Converter.java:229)
            at test.main(test.java:7)Following the source code, I've found that the exception is thrown
    when it reads DTD. I tried to read DTD using InputSource
    in ascii, in latin-1 and my program reads it without any problem.
    I really appreciate any help,
    Thanks

    http://forum.java.sun.com/thread.jsp?forum=34&thread=254927

  • Character conversion error: "Unconvertible UTF-8 character beginning with 0

    Hi All,
    I developed an Adapter Module and added to Adapter Framework.
    package sample;
    import java.io.InputStream;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import com.sap.aii.af.mp.module.Module;
    import com.sap.aii.af.mp.module.ModuleContext;
    import com.sap.aii.af.mp.module.ModuleData;
    import com.sap.aii.af.mp.module.ModuleException;
    import com.sap.aii.af.ra.ms.api.Message;
    import com.sap.aii.af.ra.ms.api.XMLPayload;
    @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
    @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
    @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
    @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
    @stateless
    public class SetAttachmentName implements SessionBean, Module {
         private SessionContext myContext;
         private String mailFileName = "UStN";
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         public void ejbCreate() throws CreateException {
         public ModuleData process(
              ModuleContext moduleContext,
              ModuleData inputModuleData)
              throws ModuleException {
              // create a second attachment for the receiver mail adapter
              try {
                   //                  get the XI message from the environment
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   //               creating parsable XML document
                   InputStream XIStreamData = null;
                   XMLPayload xmlpayload = msg.getDocument();
                   XIStreamData = xmlpayload.getInputStream();
                   DocumentBuilderFactory docBuilderFactory =
                        DocumentBuilderFactory.newInstance();
                   DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                   Document doc = docBuilder.parse(XIStreamData);
                   //            finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
                   String absenderIDTag = null;
                   absenderIDTag = moduleContext.getContextData("<RCVPRN>");
                   //            finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
                   Element element = doc.getDocumentElement();
                   NodeList list = doc.getElementsByTagName(absenderIDTag);
                   mailFileName += "_" + list.item(0).getFirstChild().toString();
                   String anIDTag = null;
                   anIDTag = moduleContext.getContextData("<CREDAT>");
                   element = doc.getDocumentElement();
                   list = doc.getElementsByTagName(anIDTag);
                   mailFileName += "_" + list.item(0).getFirstChild().toString();
                   Date date = new Date(System.currentTimeMillis());
                   //            Add date to the Message
                   SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
                   mailFileName += "_" + dateFormat.format(date);
                   String belegNummerTag = null;
                   belegNummerTag = moduleContext.getContextData("<BULK_REF>");
                   element = doc.getDocumentElement();
                   list = doc.getElementsByTagName(belegNummerTag);
                   mailFileName += "_" + list.item(0).getFirstChild().toString();
                   //               creating the attachment
                   byte by[] = xmlpayload.getText().getBytes();
                   XMLPayload attachmentPDF = msg.createXMLPayload();
                   attachmentPDF.setName(mailFileName);
                   attachmentPDF.setContentType("application/pdf");
                   attachmentPDF.setContent(by);
                   //adding the message to the attachment
                   msg.addAttachment(attachmentPDF);
                   //                  provide the XI message for returning
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
                   //                  raise exception, when an error occurred
                   ModuleException me = new ModuleException(e);
                   throw me;
              //                  return XI message
              return inputModuleData;
    I get the following error
    Character conversion error: "Unconvertible UTF-8 character beginning with 0xaa" (line number may be too low).
    Any tips, pointers ?
    Thanks in Advance
    Mukhtar

    Hi Henrique,
    I am using .getNodeValue()
    import java.io.InputStream;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import com.sap.aii.af.mp.module.*;
    import com.sap.aii.af.ra.ms.api.*;
    @ejbHome <{com.sap.aii.af.mp.module.ModuleHome}>
    @ejbLocal <{com.sap.aii.af.mp.module.ModuleLocal}>
    @ejbLocalHome <{com.sap.aii.af.mp.module.ModuleLocalHome}>
    @ejbRemote <{com.sap.aii.af.mp.module.ModuleRemote}>
    @stateless
    public class UStNAttachmentName3 implements SessionBean, Module {
         private SessionContext myContext;
         private String mailFileName = "UStN";
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         public void ejbCreate() throws CreateException {
         public ModuleData process(
              ModuleContext moduleContext,
              ModuleData inputModuleData)
              throws ModuleException {
              // create a second attachment for the receiver mail adapter
              try {
                   // get the XI message from the environment
                   Message msg = (Message) inputModuleData.getPrincipalData();
                   // creating parsable XML document
                   InputStream XIStreamData = null;
                   XMLPayload xmlpayload = msg.getDocument();
                   XIStreamData = xmlpayload.getInputStream();
                   DocumentBuilderFactory docBuilderFactory =
                        DocumentBuilderFactory.newInstance();
                   DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                   Document doc = docBuilder.parse(XIStreamData);
                   // finding the tag's name from the Modules tab in the Directory that will hold the attachment's name
                   String absenderIDTag = null;
                   absenderIDTag = moduleContext.getContextData("<RCVPRN>");
                   // finding the content of the tag that will be used as the attachment's name (assuming it's the only tag with this name)
                   Element element = doc.getDocumentElement();
                   NodeList list = doc.getElementsByTagName(absenderIDTag);
                   mailFileName += "_" + list.item(0).getFirstChild().getNodeValue();
                   String anIDTag = null;
                   anIDTag = moduleContext.getContextData("<CREDAT>");
                   element = doc.getDocumentElement();
                   list = doc.getElementsByTagName(anIDTag);
                   mailFileName += "_" + list.item(0).getFirstChild().getNodeValue();
                   Date date = new Date(System.currentTimeMillis());
                   // Add date to the Message
                   SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
                   mailFileName += "_" + dateFormat.format(date);
                   String belegNummerTag = null;
                   belegNummerTag = moduleContext.getContextData("<BULK_REF>");
                   element = doc.getDocumentElement();
                   list = doc.getElementsByTagName(belegNummerTag);
                   mailFileName += "_" + list.item(0).getFirstChild().getNodeValue();
                   // creating the attachment
                   byte by[] = xmlpayload.getText().getBytes();
                   XMLPayload attachmentPDF = msg.createXMLPayload();
                   attachmentPDF.setName(mailFileName);
                   attachmentPDF.setContentType("application/pdf");
                   attachmentPDF.setContent(by);
                   //adding the message to the attachment
                   msg.addAttachment(attachmentPDF);
                   // provide the XI message for returning
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
                   // raise exception, when an error occurred
                   ModuleException me = new ModuleException(e);
                   throw me;
              // return XI message
              return inputModuleData;
    Still I get the same error.
    org.xml.sax.SAXParseException: Character conversion error: "Unconvertible UTF-8 character beginning with 0xaa" (line number may be too low).
    Adapter-Framework: Character conversion error: "Unconvertible UTF-8 character beginning with 0xaa" (line number may be too low).
    Regards,
    Mukhtar

  • SAXParseException: character conversion error: Illegal character 0x9A...

    This is my problem:
    I use JDom to parse remote XML document with DTD linked to it. But I get that error. Request is:
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(new URL(url));
    This works fine when I use these XML and DTD docs locally, which means that I give xml file name as a parameter from console. Then everything goes well. But when I move my program to server and try to run it there, SAXParseException is thrown. Why???
    Error is:
    error on line 1 of document "http://server.net/doc.dtd" Character conversion error: Illegal ASCII character 0x9A (line number may be too low)
    What this means? And why this just happens when I run program in server? Help, please
    tia J_J

    Exactly that's the problem.
    String class :
    * This class is implemented to map an ordinary java.lang.String
    * into an xml compliant String
    public class String2Xml
         private final String invalidChars [] = {"�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "�",
                                                           "`",
                                                           "�",
                                                           "<",
                                                           ">",
         private final String replaceChars [] = {"��",
                                                           "&#223;",
                                                           "&#228;",
                                                           "&#246;",
                                                           "&#252;",
                                                           "&#196;",
                                                           "&#214;",
                                                           "&#220;",
                                                           "&#167;",
                                                           "&#128;",
                                                           "&#96;",
                                                           "&#180;",
                                                           "<",
                                                           ">",
                                                           "&apos;"};
         * Constructor
         public String2Xml();
         * This operation is implemented to check if the given String
         * matches one of the invalidChars. If an invalid char is found
         * it'll be replaced.
         * @return String - the correct xml String
         public String checkString(String check)
              for (int i = 0; i < invalidChars.length; i++)
                   check = check.replaceAll(invalidChars, replaceChars[i]);
              System.out.println("Check : " + check);
              return check;

  • Character conversion error when installing Java Portlet Container Preview

    I'm trying to tets out JSR 168 portlets on our Oracle 10g server. I'm following the instructions at http://portalstandards.oracle.com/
    I download and try to install the "Java Portlet Container Preview Release 2", and I get the following error:
    [oracle@jupiter home]$ java -jar ~/wsrp-install.jar ~/jwsdp-1.3
    File "/home/oracle/jupiter_mid/j2ee/home/config/global-web-application.xml" modified successfully
    oracle.webdb.utils.PortalExceptionImpl: Error transforming file "config/server.xml"
    at oracle.portal.PortalException.<init>(PortalException.java:66)
    at oracle.webdb.wsrp.server.install.InstallException.<init>(InstallException.java:31)
    at oracle.webdb.wsrp.server.install.Main.applyTransformation(Main.java:387)
    at oracle.webdb.wsrp.server.install.Main.install(Main.java:122)
    at oracle.webdb.wsrp.server.install.Main.main(Main.java:98)
    Caused by: javax.xml.transform.TransformerException: Character conversion error: "Unconvertible UTF-8 character beginning with 0x92" (line number may be too low).
    at org.apache.xalan.transformer.TransformerImpl.fatalError(TransformerImpl.java:739)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:715)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
    at oracle.webdb.wsrp.server.install.Main.applyTransformation(Main.java:371)
    ... 2 more
    caused by: ; SystemID: http://xmlns.oracle.com/ias/dtds/application-server-9_04.dtd; Line#: 1; Column#: -1
    javax.xml.transform.TransformerException: Character conversion error: "Unconvertible UTF-8 character beginning with 0x92" (line number may be too low).
    at org.apache.xalan.transformer.TransformerImpl.fatalError(TransformerImpl.java:739)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:715)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1129)
    at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1107)
    at oracle.webdb.wsrp.server.install.Main.applyTransformation(Main.java:371)
    at oracle.webdb.wsrp.server.install.Main.install(Main.java:122)
    at oracle.webdb.wsrp.server.install.Main.main(Main.java:98)
    [oracle@jupiter home]$
    This is what the server.xml looks like:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!DOCTYPE application-server PUBLIC "-//Oracle//DTD OC4J Application-server 9.04//EN" "http://xmlns.oracle.com/ias/dtds/application-server-9_04.dtd">
    <application-server localhostIsAdmin="true"
    application-directory="../applications"
    deployment-directory="../application-deployments"
    connector-directory="../connectors">
    <rmi-config path="./rmi.xml" />
    <sep-config path="./internal-settings.xml" />
    <jms-config path="./jms.xml" />
    <javacache-config path="../../../javacache/admin/javacache.xml" />
    <log>
    <file path="../log/server.log" />
    </log>
    <transaction-config timeout="30000" />
    <java-compiler name="javac" in-process="false" extdirs="/home/oracle/jupiter_mid/jdk/jre/lib/ext" />
    <global-application name="default" path="application.xml" />
    <application name="BC4J" path="../applications/BC4J.ear" auto-start="true" />
    <application name="BC4JManager" path="../applications/BC4JManager.ear" auto-start="true" />
    <application name="IsWebCacheWorking" path="../applications/IsWebCacheWorking.ear" auto-start="true" />
    <application name="jdev_test2" path="../applications/jdev_test2.ear" auto-start="true" />
    <global-web-app-config path="global-web-application.xml" />
    <web-site default="true" path="./default-web-site.xml" />
    <cluster id="1214162165" />
    </application-server>
    server.xml looks ok, and I've tried tweaking it to no avail. Anyone know what could cause this?

    Could you make sure you don't have any extra Apache libraries hanging around in your global classpath, i.e. ensure there is nothing extra in <J2SE Home>/jre/lib/extThere's a xercesImp.jar under mid/j2ee/OC4J_Portal/applications/jpdk/jpdk/WEB-INF/lib/xercesImpl.jar, but there's also one under jwsdp-1.2/jaxp/lib/endorsed/xercesImpl.jar. Is that supposed to be in there?
    Neither of these are getting loaded, though; running java -verbose shows that all of org.apache.xalan.* is being loaded from mid/jdk/jre/lib/rt.jar
    FWIW, ../../lib/xmlparserv2.jar does exist, but doesn't look like it's being loaded. :-\

  • Character conversion error in PDF output of smartform

    Hi all,
    I am printing slaes order confirmation through smartform, they are based on two message type - ZBA0 (for Printing) and ZBA1 (for e-mail). the print option of smartform is coming fine, but the problem is when i am e-mailing the Order as pdf attachment. i need to print conferma du2019ordine. in itlian, but its printing conferma d# ordine.
    Kindly suggest how to rectify the error, how to check the encoding format used and see where ' is geting converted to #.
    Ii hope i am clear. in case of doubt please revert.
    Thanks
    Rohan

    Hi Raju,
    Thanks for the information, i got the same thing on SAP notes also, but could you give me a hint as to how to see if it is supported for italian ?? or should i take the most common font like Arial, times new roman and assume it would be supported ?
    any help in this would be appreciated
    Thanks,
    Rohan

  • Export Scott Schema Conversion Error  [SOLVED]

    I'm trying to export default user SCOTT to DMP file.
    But error occured. Some kind of character conversion error.
    This is the log generated:
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    JServer Release 9.2.0.1.0 - Production
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    server uses AL32UTF8 character set (possible charset conversion)
    EXP-00056: ORACLE error 942 encountered
    ORA-00942: table or view does not exist
    EXP-00000: Export terminated unsuccessfully
    What is the solution for this case?
    Thanks
    Message was edited by:
    user465837+++eric

    >
    How if I dont have 9.2 DB?You have attempted to export from one above...?
    Can you skip the TOAD util and just log on to the server and run exp from there?
    Another option would involve downloading the 9.2 Database Client (9i Downloads) and install on a nearby PC, or if you have one with 9.2 already installed, and export from there.
    Any tricks to export user from different version of
    DB instance? (Is it a must that having same version
    of DB to exp-imp?)No tricks. The rule is: to export from lower to higher, you must use the lower versions exp tool. (Then use target version of imp for importing. The key is to get the exp dump of correct version and format.)
    NB: while
    C:\>dir c:\exp.exe / s
    Volume in drive C is Disk_C
    Volume Serial Number is 347F-B884
    only return thatIt's searching, give it (plenty of) time.
    Message was edited by:
    orafad

  • Error occurred during character conversion in SXMB_MONI

    Hello Experts,
    Good Day!
    I would like to seek your help here. When i used tcode SXMB_MONI to search for messages i get this error : Error occurred during character conversion.
    So far no problem with the program. Its work for all other dates. Just for one particular day and specific time period, im geting this error.
    Does anyone know what is this error means? Please reply..
    Thanks for your help.
    Looking forward for ur replies..

    Hi Presheela,
    Basically this problem occurs when ur payload contains any special characters like '&' ,'>'...etc .So you have to take care of how to deal with these characters in XI.
    Refer the following documentation:
    How to Work with Character Encodings in Process Integration
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Regards,
    Vinod.

  • Error " conversion error between two character sets" in PI MONI

    Hi Experts
    I am doing file to Idoc scenario. I am getting the following error in PI MONI "conversion error between two character sets".
    please suggest me how to solve the issue.
    thanx in advance.

    Hi Mickael
    Below is the complete error message found in PI MONI.
    SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">SYSTEM_DUMP</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>PI Server : XBTO80__0000 : Conversion error between two character sets.</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

  • Numeric or value error: character to number conversion error

    I'm having problems inserting a value from a date picker field (DD-MON-YYYY HH MI )
    i'm submitting this value to a packaged procedure that accepts this field as VARCHAR2 .
    on the insert, i do a to_date( P_DATE, 'DD-MON-YYYY HH:MI PM' )
    and i get the numeric conversion error.
    If I change the to_date on the procedure side, I get the :could not read the end of the format mask - which I've found threads about on this site.
    I've tried using HH24 and different formats, but I get one of the two above errors on the insert.
    If I don't fill in the datepicker field at all, it works fine.
    help is appreciated !
    Bill

    Here is the trace anyway:
    *** ACTION NAME:(application 4000, page 1) 2004-09-24 12:58:44.052
    *** MODULE NAME:(HTML DB) 2004-09-24 12:58:44.052
    *** SERVICE NAME:(TOPS) 2004-09-24 12:58:44.052
    *** SESSION ID:(151.1) 2004-09-24 12:58:44.052
    *** 2004-09-24 12:58:44.052
    ksedmp: internal or fatal error
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    null;
    null;
    null;
    f(p=>:p);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    null;
    null;
    commit;
    else
    rc__ := 0;
    null;
    null;
    null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    6A3C4A00 532 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A3C4A00 2502 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A3C4A00 2748 package body FLOWS_010500.WWV_FLOW_UTILITIES
    6A0E63C8 991 package body FLOWS_010500.WWV_FLOW_FORMS
    6A11675C 932 package body FLOWS_010500.WWV_FLOW_DISP_PAGE_PLUGS
    6A11675C 247 package body FLOWS_010500.WWV_FLOW_DISP_PAGE_PLUGS
    6A4B54E0 8341 package body FLOWS_010500.WWV_FLOW
    6A2A99F0 102 procedure FLOWS_010500.F
    6A2B9E54 10 anonymous block
    ----- Call Stack Trace -----
    calling call entry argument values in hex
    location type point (? means dubious value)
    ksedmp+524          CALLrel  ksedst+0 1
    ksedmptracecb+15 CALLrel _ksedmp+0            C
    _ksddoa+118          CALLreg  00000000             C
    ksdpcg+143          CALLrel  ksddoa+0
    ksdpec+180          CALLrel  ksdpcg+0 1966 6D7D208 1
    __PGOSF3__ksfpec+11 CALLrel _ksdpec+0            0
    8
    _kgerev+77           CALLreg  00000000             7474210 1966
    kgerec1+18          CALLrel  kgerev+0 7474210 6DCE5EC 1966 1
    6D7D260
    peirve+465          CALLrel  kgerec1+0
    pevmCVTCN+346 CALLrel _peirve+0           
    pfrinstrCVTCN+36 CALLrel pevmCVTCN+0 6E6E604 71CE370 7160F0C
    pfrrunno_tool+51 CALL??? 00000000
    pfrrun+1834         CALLrel  pfrrun_no_tool+0 6E6E604 6A3C010A 6E6E640
    plsqlrun+1051 CALLrel _pfrrun+0            6E6E604
    peicnt+179          CALLrel  plsql_run+0 6E6E604 1 0
    kkxexe+477          CALLrel  peicnt+0
    opiexe+4896         CALLrel  kkxexe+0 6A2B9E54
    kpoal8+1705         CALLrel  opiexe+0 49 3 6D7E06C
    _opiodr+977          CALLreg  00000000             5E 14 6D7E7CC
    _ttcpip+1827         CALLreg  00000000             5E 14 6D7E7CC 0
    _opitsk+1098         CALL???  00000000            
    opiino+938          CALLrel  opitsk+0 0 0 747ABC0 6DEFB14 D8 0
    _opiodr+977          CALLreg  00000000             3C 4 6D7FBBC
    opidrv+479          CALLrel  opiodr+0 3C 4 6D7FBBC 0
    sou2o+45            CALLrel  opidrv+0 3C 4 6D7FBBC
    opimai+237          CALLrel  sou2o+0
    OracleThreadStart@  CALLrel  opimai+0
    4+899
    77E7D338 CALLreg 00000000

  • SMQ2 (Inbound Queue) : Error occurred during character conversion

    Hi,
    In SMQ2 an Inbound Queue has failed with status text "Error occurred during character conversion". The XML message inside this queue is in waiting status with status text " Scheduled for Outbound Processing" .
    Even after cancelling this message from SXMB_MONI, and reposting the PO, still again the queue and the XML message inside the queue are in same status.
    As this is in XI production system, requesting to provide some suggestion ASAP.
    Thanks,
    Mateen.

    The queue status is still sysfail. There is only 1 message waiting in the queue.
    I think that the queue might be locked for some reason and after unlocking the queue and restarting the message, the message will get processed successfully.
    But before working on this I want to make sure that the queue is locked.
    Do you or anyone else know how and from where can I check whether the queue is locked or unlocked?
    Regards,
    Mateen.

  • Re: Error, numeric or value error: character to number conversion error

    Can someone please please tell me why I'm getting this error and what I'm doing wrong? It looks like a simple error, "numeric or value error: character to number conversion error".
    My code is as follows:
    string connectionString = WebConfigurationManager.ConnectionStrings["DEMO_TEST"].ConnectionString;
    OracleConnection con = new OracleConnection(connectionString);
    OracleCommand cmd = new OracleCommand("DEMO.PKG_LOCATION_TYPE.INS", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add(new OracleParameter("@P_DESCRIPTION", OracleDbType.Varchar2, 60));
    cmd.Parameters["@P_DESCRIPTION"].Value = "Test_Description";
    cmd.Parameters.Add(new OracleParameter("@P_NAME", OracleDbType.Varchar2, 6));
    cmd.Parameters["@P_NAME"].Value = "Test_Name";
    cmd.Parameters.Add(new OracleParameter("@P_LOCATION_TYPE_CD", OracleDbType.Decimal, 4));
    cmd.Parameters["@P_LOCATION_TYPE_CD"].Direction = ParameterDirection.InputOutput;
    con.Open();
    try
    cmd.ExecuteNonQuery();
    catch
    //In case of an error
    finally
    con.Close();
    con.Dispose();
    And I recieve the following error block:
    Oracle.DataAccess.Client.OracleException was unhandled by user code
    Message="ORA-06502: PL/SQL: numeric or value error: character to number conversion error\nORA-06512: at line 1"
    Source="Oracle Data Provider for .NET"
    DataSource="demotest"
    Number=6502
    Procedure="DEMO.PKG_LOCATION_TYPE.INS"
    StackTrace:
    at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
    at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
    at System.Web.UI.WebControls.Wizard.OnFinishButtonClick(WizardNavigationEventArgs e)
    at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
    at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args)
    at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ********************************************************

    Are the parameters in your procedure in the same order as they are created in this code? Oracle command works by position unless you change it to be BindByName.
    Failing that you seem to have defined a parameter (P_NAME) to have a length of 6, and are then setting it's value to a string with a length of 9.
    Also the in/output parameter is defined as type decimal. Is this correct? It is defined as InputOutput but you don't assign it any value.
    If these suggestions don't help then perhaps if you post the stored procedure you might get some more ideas.
    HTH
    Lyndon

  • Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).

    Hi,
    I have a file where fields are wrapped with ".
    =========== file sample
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    "asdsa","asdsadasdas","1123"
    ==========
    I am having a .net method to remove the wrap characters and write out a file without wrap characters.
    ======================
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    asdsa,asdsadasdas,1123
    ======================
    the .net code is here.
    ========================================
    public static string RemoveCharacter(string sFileName, char cRemoveChar)
                object objLock = new object();
                //VirtualStream objInputStream = null;
                //VirtualStream objOutStream = null;
                FileStream objInputFile = null, objOutFile = null;
                lock(objLock)
                    try
                        objInputFile = new FileStream(sFileName, FileMode.Open);
                        //objInputStream = new VirtualStream(objInputFile);
                        objOutFile = new FileStream(sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString(), FileMode.Create);
                        //objOutStream = new VirtualStream(objOutFile);
                        int nByteRead;
                        while ((nByteRead = objInputFile.ReadByte()) != -1)
                            if (nByteRead != (int)cRemoveChar)
                                objOutFile.WriteByte((byte)nByteRead);
                    finally
                        objInputFile.Close();
                        objOutFile.Close();
                    return sFileName.Substring(0, sFileName.LastIndexOf('\\')) + "\\" + Guid.NewGuid().ToString();
    ==================================
    however when I run the bulk load utility I get the error 
    =======================================
    Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (NumberOfMultipleMatches).
    ==========================================
    the bulk insert statement is as follows
    =========================================
     BULK INSERT Temp  
     FROM '<file name>' WITH  
      FIELDTERMINATOR = ','  
      , KEEPNULLS  
    ==========================================
    Does anybody know what is happening and what needs to be done ?
    PLEASE HELP
    Thanks in advance 
    Vikram

    To load that file with BULK INSERT, use this format file:
    9.0
    4
    1 SQLCHAR 0 0 "\""      0 ""    ""
    2 SQLCHAR 0 0 "\",\""   1 col1  Latin1_General_CI_AS
    3 SQLCHAR 0 0 "\",\""   2 col2  Latin1_General_CI_AS
    4 SQLCHAR 0 0 "\"\r\n"  3 col3  Latin1_General_CI_AS
    Note that the format file defines four fields while the fileonly seems to have three. The format file defines an empty field before the first quote.
    Or, since you already have a .NET program, use a stored procedure with table-valued parameter instead. I have an example of how to do this here:
    http://www.sommarskog.se/arrays-in-sql-2008.html
    Erland Sommarskog, SQL Server MVP, [email protected]

  • PL/SQL: numeric or value error: character to number conversion error in TRG

    Hi,
    I've got strange issue with one trigger which during update of table reports (DB is 9.2.0.8):
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "UDR_LOG", line 345
    ORA-04088: error during execution of trigger 'UDR_LOG'but line 345 is:
    END IF;
    so its kind of strange
    the code looks like
    343 IF nvl(to_char(:old.PKD_ID),'''') <> nvl(to_char(:new.PKD_ID),'''') THEN
    344     v_zmn := v_zmn || 'PKD_ID''' || to_char(:old.PKD_ID) || '''' || to_char(:new.PKD_ID) || '''';
    345    END IF;
    so its concatenation not to_number usage .error is triggered by update statement on any column .
    I'm sorry I cant provide You with whole trigger code .
    So if You could only recommend any investigation method that would be great .
    Regards
    Greg

    Hi, Greg,
    When there's an error in a trigger, the line numbers in the error messages are relative to the first DECLARE or BEGIN statement; often, that's a few lines after CREATE OR REPLACE TRIGGER. Post a few lines after what you already posted.
    If you can't find the error, then create another table for testing this, and create a smaller trigger on that table, which does only enough to cause the error. Then you'll be able to post the complete trigger, and the code needed to re-create the problem.

Maybe you are looking for