JAXB2 marshaller throws Validation Exception

Hello All.. I am trying to marshall a JAXB Object using JAXB2 marshaller and validate it against an xsd.
During this process of validation, the parser when reads the xsd fails with the parse error. The schema xsd is a working xsd from a webservice provider. The validation is fine when it is done on XML Spy and SOAP UI. But when this xerces xmlschema validator comes to picture its even not able to parse the XSD for validating against it.
Here is the head of the xsd..
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
     xmlns:tns="http://com.cyber.space./services"          
     targetNamespace="http://com.cyber.space./services"
     elementFormDefault="qualified"
and a huge schema followed.
Step.1: I used this xsd to generate JAXB classes.
Step2. Used jaxb2marshaller from spring.oxm,
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
          <property name="contextPath" value="com.cyberspace.service"/>
          <b><property name="schema" value="classpath:pathtoXsd"/></b>
     </bean>
so in my application , i have reference to marshaller object.so can use like this.
request ( the jaxb request object populated with valid values as per the schema)
result - output -- outgoing xml.
marshaller.marshall(requsest, result);
Here comes the problem..The out going xml is like this..
<?xml version="1.0" encoding="UTF-8" ?>
<Request xmlns="http://com.cyber.space./services">
<RequestService>123</RequestService>
etec etc etc.. son on..
This xml when converted to soap message and sent over to webservice its accepted as valid request and response is back. But all it happens when i dont validate it against the schema that i have.
Look at the :
<b><property name="schema" value="classpath:pathtoXsd"/></b> set as a property to jaxb2 marshaller.
This makes sure that the xml generated out the jaxb object after marshall process is valid against the XSD schema. Here it fails for some reason.
If the dont ask the marshaller to validate( removing the schema property ), then the xml is fine able to proceed with next steps of sending the successfull VALID SOAP REQUEST and response is back. But if do a validation by setting the schema property with value as path to xsd.
The error is :
Caused by:<b> org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.2: ' ' is not a valid value of list type 'null'.</b>
     at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109)
     at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104)
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
     at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
     at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429)
...,more
Is it a problem with namespace.? If i assume that the resulting xml out of the marshall process when validated against the XSD is failing for some missing data( business data), then the request itself would not be sent as soap requst.
But the problem is not that with data in the xml. its some thing going on with the strict validation the validator is doing.
Edited by: cnu_coder on May 22, 2008 7:41 AM
Edited by: cnu_coder on May 23, 2008 8:14 AM

Hello,
The ABAP code looks ok except the missing if error != null statement.
Please check the similar code for raising exception provided in the below blog:
/people/ravi.gupta4/blog/2010/02/04/automating-cancellation-of-a-failed-message-in-xi
Also, Can you check whether exception is raised using Dynamic config UDF and a call to abap mapping is made.
Check the other approach of raising an exception:
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
-Rahul

Similar Messages

  • AM Validation Exception - Deadline looming - Please help!

    Gurus,
    I am trying to perform validation in AM against data already existing in underlying table. Since my EOImpl is utilizing API calls for insert/update/delete with OAPlsqlEntityImpl ... I cannot enforce uniqueness in EO attributes. Therefore, I am performing validation in AM and need to throw an exception message when duplication occurs.
    I have documented my code and Null Pointer Exception message. The bolded code in PFR represents line "307" which is reference in the Null Pointer Exception. Any help would be greatly appreciated and rewarded.
    Thanks!
    PFR code:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    // Pressing the "Apply" button means the transaction should be validated
    // and committed.
    if (pageContext.getParameter("Apply") != null)
    OAViewObject vo = (OAViewObject)am.findViewObject("DesigFullVO1");
    String DesignatorCode = (String)vo.getCurrentRow().getAttribute("DispCode");
    *Serializable[] params = { DesignatorCode };*
    am.invokeMethod("ValDesig",params);
    am.invokeMethod("apply");
    MessageToken[] tokens = { new MessageToken("DESIGNATOR",DesignatorCode)};
    OAException confirmMessage = new OAException("AK", "SPL_CREATE_DESIGNATOR_W", tokens, OAException.CONFIRMATION, null);
    OADialogPage dialogPage = new OADialogPage(OAException.CONFIRMATION,
    confirmMessage,
    null,
    APPLICATION_JSP + "?page=/designator/oracle/apps/spl/hdrdef/webui/DesigSearchPG",
    null);
    dialogPage.setReusePageLayout(true);
    pageContext.releaseRootApplicationModule();
    pageContext.redirectToDialogPage(dialogPage);
    pageContext.putDialogMessage(confirmMessage);
    VO query:
    select disp_code DISP_CODE
    from spldat.spl_dispositions
    AM code:
    public void ValDesig(String dispCode)
    DesigValidationVOImpl vo = getDesigValidationVO1();
    DesigValidationVORowImpl Row = null;
    String a = "disp_code = '"+dispCode+"'";
    vo.setWhereClauseParams(null);
    vo.setWhereClause(a);
    vo.executeQuery();
    String l_desig = Row.getDispCode();
    if (l_desig != null)
    *MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "DesigValidationVO1")};*
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    } // end ValDesig()
    NullPointerException
    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:865)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:988)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:211)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:749)
         at designator.oracle.apps.spl.hdrdef.webui.DesigCreateCO.processFormRequest(DesigCreateCO.java:307)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:804)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1156)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1000)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:966)

    I'm getting a compilation error against the following code for the bolded line:
    What is the best way to fix this type mismatch? I need to make sure that the result assigned to l_desig is the value returned from the VO.
    AM Code:
    public void ValDesig(String dispCode)
    DesigValidationVOImpl vo = getDesigValidationVO1();
    if (vo == null)
    MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "DesigValidationVO1")};
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    String a = "disp_code = '"+dispCode;
    vo.setWhereClauseParams(null);
    vo.setWhereClause(a);
    vo.executeQuery();
    Row DesigValidationRow = getDesigValidationVO1().first();
    String l_desig  = DesigValidationRow.getAttribute("DispCode");
    if (l_desig != null)
    MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "DesigValidationVO1")};
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    } // end ValDesig()
    Error:
    incompatible types; found java.lang.Object; required: java.lang.String
    Edited by: sreese on Dec 1, 2010 11:04 AM

  • Is it possible to throw an exception from a handler chain with JAXWS???

    I know I cannot throw directly an exception from the handler cause my handler extends SOAPHandler and the method handlerMessage cannot throw exceptions. The problem is that I would like to validate some authorization and if the client doesn't have the appropriate rights, I would like to throw an exception from the handler without calling the web service itself, so the client would receive a valid soap response from the server. Is it possible?? Is there another mechanism that I can use to do that??
    Thanks a lot
    Korg

    You can throw a ProtocolException or RuntimeException from handleMessage().
    If you throw ProtocolException, HandleFault() is called on previously invoked handlers.
    If you throw a RuntimeException, handleFault() or handleMessage() is not called on previously invoked handlers, and the Exception is converted to Fault message and dispatched.

  • Specified cast is not valid exception

    I have the following C# code (cut down for the post) that causes an exception (Specified cast is not valid) when I attemp the GetInt32 method call. FILE_HDR is a BLOB and I can read it just fine with GetBytes. This also happens on something like TO_NUMBER(FILE_ID, 'XXXXXXXX'). It seems like things do not work well when you define a column as a function. I can do this same thing with the MySQLDataReader without any problem.
    Can anyone tell me what I am doing wrong here?
    Thanks
    string SelectStatement = "select FILE_ID, DBMS_LOB.Getlength FILE_HDR)...."
    Cmd.CommandText = SelectStatement;
    Reader = Cmd.ExecuteReader();
    if (!Reader.HasRows)
    throw new Exception("Unit File List Query returned no rows");
    else
    totalBytes = 0;
    int HeaderLengthColumnOrdinal = Reader.GetOrdinal("DBMS_LOB.Getlength(FILE_HDR)");
    // Get the number of rows
    while (Reader.Read())
    RowCount++;
    totalBytes += (Int64)Reader.GetInt32(HeaderLengthColumnOrdinal); <- EXCEPTION
    }

    Hi,
    I was kind of thinking I could do something like this:
    CAST(DBMS_LOB.GetLength(BLOB_COLUMN) AS NUMBER(9))That should work OK as well. In fact, here is a small test:
    Database:
    SQL> create table test
      2  (
      3    clob_id number,
      4    clob_data clob
      5  );
    Table created.
    SQL> declare
      2    l_text varchar2(8192);
      3  begin
      4    for i in 1..8192 loop
      5      l_text := l_text || 'A';
      6    end loop;
      7    insert into test values (1, l_text);
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.C#:
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace NumberTest
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      class Class1
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
          int tempValue = 0;
          string constr = "User Id=xxx; Password=xxx; Data Source=oramag; Enlist=False; Pooling=False";
          // create connection to db
          OracleConnection con = new OracleConnection(constr);
          con.Open();
          // create a command object
          OracleCommand cmd = con.CreateCommand();
          // set command object properties
          cmd.CommandText = "select cast(dbms_lob.getlength(clob_data) as number(9)) from test where clob_id=1";
          // get a data reader
          OracleDataReader dr = cmd.ExecuteReader();
          if (dr.Read())
            try
              tempValue = dr.GetInt32(0);
            catch (Exception ex)
              Console.WriteLine(ex.Message);
          Console.WriteLine("Value: {0}", tempValue.ToString());
          Console.WriteLine("Press ENTER to continue...");
          Console.ReadLine();
          // clean up objects
          dr.Dispose();
          cmd.Dispose();
          con.Dispose();
    }Output:
    Value: 8192
    Press ENTER to continue...Note that I am using Oracle Database 10g 10.2.0.2.0 and ODP.NET beta 2.102.2.10 (the beta for VS2005).
    Hope that helps a bit...
    - Mark

  • *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSSet initWithArray:range:copyItems:]: array argument is not an NSArray' abort() called terminate called throwing an exception

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSSet initWithArray:range:copyItems:]: array argument is not an NSArray'
    abort() called
    terminate called throwing an exception
    How do I fix this?

    Having the same issue with Numbers in iWork. Was on the phone with Apple Support and went through a variety of trouble shooting methods to no avail.
    Here is the message that occurs on every attempt to start Numbers. This is a user specific issue as I am able to run numbers in a Guest user mode.
    Application Specific Information:
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -getComponents: not valid for the NSColor NSNamedColorSpace System gridColor; need to first convert colorspace.'
    If anyone has any advice I am all ears.
    Thanks.

  • Throws validation errors to NWPM

    Hi All,
    I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)
    I am following the below steps,
    step 1 - In message mapping a UDF is created to catch errors and store them in a variable using dynamic configuration
    step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception. The exception format expected is
    SAP:Error SOAP:mustUnderstand="" 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="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
    <SAP:P1>ZPI_THROW_EXCEPTION</SAP:P1>
    <SAP:P2>001</SAP:P2/>
    <SAP:P3>Mandatory field is missingBUKRS </SAP:P3>
    <SAP:AdditionalText />
    <SAP:Stack>No receiver could be determined</SAP:Stack>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    but while i am trying to  test the data in message mapping it will show one error.
    and with out using abap code it works successfully but while i am adding Abap code in interface mapping it will show the following error.
    "Runtime exception when processing target-field mapping /ns0:MT_DB2_SourcePlant/Record/SourcePlant; root message: Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.put(com.sap.aii.mapping.api.DynamicConfigurationKey, java.lang.String) of an object loaded from local variable '<9>'] in class CHRYSLER_com_test_scenario.ErrorHandling method testingError[, 4, , com.sap.aii.mappingtool.tf7.rt.Context@749119e6]"
    I have written the following ABAP code to achieve this:
    method IF_MAPPING~EXECUTE.
    DATA l_record type mpp_dynamic.
    DATA error type String.
    getting dynamic configuration value
    filled in by any previous mapping
    CALL METHOD DYNAMIC_CONFIGURATION->GET_RECORD
    EXPORTING
    NAMESPACE = 'http://sap.com/xi/XI/System/ERROR'
    NAME = 'ERROR'
    RECEIVING
    RECORD = l_record.
    error = l_record-value.
    *raising exception with our message
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
    EXPORTING
    TEXTID =
    PREVIOUS =
    ERROR_CODE = '001'
    ERROR_TEXT = error .
    RAISE EXCEPTION TYPE CX_MAPPING_FAULT
    EXPORTING
    TEXTID =
    PREVIOUS =
    ERROR_CODE = '003'
    ERROR_TEXT = error .
    endmethod.
    I am gettign the following message for our code:
    SAP:Error SOAP:mustUnderstand="" 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="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
    <SAP:P1 />
    <SAP:P2 />
    <SAP:P3 />
    <SAP:P4 />
    <SAP:AdditionalText />
    <SAP:Stack>No receiver could be determined</SAP:Stack>
    <SAP:Retry>M</SAP:Retry>
    </SAP:Error>
    Could you please help in finding the solution for getting currect error message from ABAP class?

    Hello,
    The ABAP code looks ok except the missing if error != null statement.
    Please check the similar code for raising exception provided in the below blog:
    /people/ravi.gupta4/blog/2010/02/04/automating-cancellation-of-a-failed-message-in-xi
    Also, Can you check whether exception is raised using Dynamic config UDF and a call to abap mapping is made.
    Check the other approach of raising an exception:
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    -Rahul

  • Is it okay practice to have a constructor throw an exception?

    Or is it just plain bad practice and it's better to catch it instead.

    I don't know if there is anything wrong with the/a
    constructor throwing an exception. It is a way to
    inform the user that something "bad" occurred during
    creation of the object.
    I usually don't do it. I have my constructor call a
    method that encapsulates the code that may generate
    an error.
    public class MyExample
    public MyExample()
    try
    aMethodThatPerformsIO();
    catch(IOException ioe)
    n ioe) {ioe.printStackTrace();}
    private void aMethodThatPerformsIO() throws
    ows IOException
    //blah
    Presumably aMethodThatPerformsIO initializes the state of the MyExample being constructed, yes? That's why you call it in a ctor, yes?
    MyExample myEx = new MyExample(); // exception is thrown, stderr gets some bytes, object is not properly initialized, BUT...
    myEx.doSomethingThatAssumesValidState(); // ...this still executes (or tries to) despite the assumption about valid state being violated like godlie at a biker bar.I'd rather have the ctor throw the exception, but that's JMAO.

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi,
    I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:-
    System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
    Server stack trace: 
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type us
    Same code works perfectly on my Development machine, Please help. Below is the Code
    base.EventFiringEnabled = false;
    bool isFile = (properties.AfterProperties["vti_filesize"] != null);
    if (isFile == true)                   
    SPWeb currentWeb = properties.OpenWeb();
    // Get foldername from url like Document/EC10001/filename.txt                       
    string folderName = properties.AfterUrl.Split(new char[] { '/' })[1];
    SPList spList = currentWeb.Lists[properties.List.ID];                       
    SPQuery spQuery = new SPQuery();                       
    spQuery.Query = "<OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>";
    //Getting the folder object from the list                       
    SPFolder folder = spList.RootFolder.SubFolders[folderName];
    //Set the Folder property                       
    spQuery.Folder = folder;
    int fileSequenceId = 0;                      
    SPListItemCollection items = spList.GetItems(spQuery);
    if (items.Count > 0)                       
    string documentID = items[0]["DocumentID"] != null ? items[0]["DocumentID"].ToString() : string.Empty;
    if (!string.IsNullOrEmpty(documentID))                           
    string splitNumber = documentID.Split(new char[] { '-' })[1];                               
    fileSequenceId = Convert.ToInt32(splitNumber) + 1;                           
    else                           
    properties.ErrorMessage = "Unable to generate Document Id";                               
    properties.Cancel = true;                           
    else                       
    fileSequenceId = 1;                       
    // Set DocumentID like EC10001-001                       
    properties.AfterProperties["DocumentID"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));      
    // Retrive "EEC000" string from Constant List               
    properties.AfterProperties["vti_title"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));   
    // Retrive "EEC000" string from Constant List                
    base.EventFiringEnabled = true;
    Thanks,
    Pranay Chandra Sapa

    Hi,
    According to your description, my understanding is that when you upload document in Office 365 site, the event receiver in sandbox solution throws error.
    Per my knowledge, if you want to use event receiver in Office 365 environment, you need to use remote event receiver instead the normal event receiver in an app.
    Here are some detailed articles for your reference:
    Create a remote event receiver in apps for SharePoint
    Handle events in apps for SharePoint
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Call to ALDP 3.2 dataservice using  Mediator API throwing validation error

    Hi,
    Call to ALDP 3.2 dataservice using Mediator API with request doc having xsi:type (eg: <ns1:searchBy xsi:type="ns2:ImplXXXIDType">) is throwing validation saying that it is unable to resolve the namespace ns2 .The namespace ns2 is defined at root level. If the namespace ns2 is defined at the element level like this
    <ns1:searchBy xsi:type="ns2:ImplXXXIDType" xmlns:ns2="http://www.xxx.com/xyz/datastructure/1/"> it is working fine. We never had this issue with ALDSP 2.5 Mediator API.
    Any suggestions or help would be most welcome!
    Thanks,
    Gkumar

    Ok. Now you need to put enough information on the case for someone to investigate. Please attach instructions on how to create a data space that will show this problem. Since customer support will not have your database etc. , if you just create an empty ds function in the same ds as the one that has the problem, like so...
    function dummyFunction() as element(....)* {
    and then replace the () with the output from the Test View so it looks like...
    function dummyFunction() as element(....)* {
    <myElement ....>
    <otherElement ...>
    </myElement>
    Once you have a dummy function like that which demonstrates the problem, export your dataspace and attach it to the case.
    If you anticipate some of the questions that customer support is going ot ask you (including providing a reproducer), you will save yourself many days (or weeks) of time.

  • Throwing an exception from XSLT

    Just wanted to share a finding with the Oracle XDB community and possibly suggest an enhancement to the xdb product development team (care of MDRAKE).
    I had a scenario where I wanted to throw an exception from the XSLT.
    A little Googling revealed this helpful post:
    http://weblogs.asp.net/george_v_reilly/archive/2006/03/01/439402.aspx
    ...so I gave it a shot.
    In my XSLT, I have a <xsl:choose> block with the following <xsl:otherwise> block:
    <xsl:otherwise>
        <xsl:message terminate="yes">Unknown Document Type</xsl:message>                          
    </xsl:otherwise>I used a stub test to run this through, giving it a file which would exercise the exception:
    select xmltype(bfilename('XML_RESOURCES', 'data.xml'),0).transform(xmltype(bfilename('XML_RESOURCES', 'sanitize_xml.dev.xsl'),0))
    from dual;..and to my 'joy', I did get an exception:
    ORA-30998: transformation error: execution of compiled XSLT on XML DOM failedHmm...would of been nicer to get something like what Eclipse/Xalan pops out:
    file:/H:/eclipse_indigo_workspace/XSLT/sanitize_xml.xsl; Line #28; Column #59; Unknown Document Type
    (Location of error unknown)Stylesheet directed termination...i.e. my custom error message "Unknown Document Type" isn't output by Oracle.
    Just to be safe, I tried a file which would NOT exercise this xsl:otherwise block and it did run through OK.
    So, could XDB report a better error?
    Thoughts?

    SQL> VAR XSL VARCHAR2(4000)
    SQL> --
    SQL> begin
      2    :XSL :=
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      5     <xsl:output method="xml" indent="yes"/>
      6     <xsl:template match="/">
      7             <Result>
      8                     <xsl:choose>
      9                             <xsl:when test="Input=''1''">
    10                                     <Output>1</Output>
    11                             </xsl:when>
    12                             <xsl:when test="Input=''2''">
    13                                     <xsl:message>The value is 2</xsl:message>
    14                                     <Output>2</Output>
    15                             </xsl:when>
    16                             <xsl:when test="Input=''3''">
    17                                     <xsl:message terminate="no">The value is 3</xsl:message>
    18                                     <Output>3</Output>
    19                             </xsl:when>
    20                             <xsl:otherwise>
    21                                     <xsl:message terminate="yes">Invalid value</xsl:message>
    22                                     <Output>Bad Input</Output>
    23                             </xsl:otherwise>
    24                     </xsl:choose>
    25             </Result>
    26     </xsl:template>
    27  </xsl:stylesheet>';
    28  end;
    29  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>1</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>1</Output>
    </Re
    Elapsed: 00:00:00.01
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>2</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>2</Output>
    </Re
    Elapsed: 00:00:00.00
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>3</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>3</Output>
    </Re
    Elapsed: 00:00:00.01
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>4</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    ERROR:
    ORA-30998: transformation error: execution of compiled XSLT on XML DOM failed
    no rows selected
    Elapsed: 00:00:00.01
    SQL>
    SQL>The actuall error is not unreasonalbe. The Execution did fail beacuse you terminated it.. Contacting Oralce Support may be a little excessive...
    Now with respect to message the question is where...
    We 'could' output into the same buffer as is used by DBMS_OUTPUT, but that has limits in terms of the amount of output that can be generated.
    We could write it to the trace file, but that may be difficulat for a developer to get to
    We could write it to a log file in the XDB repository, but where and how to name it...
    We could another parameter to XMLTransform, which would be a Message Buffer
    All of these are in effect enhancements..
    BTW I checked with XML Spy and they seem to ignore message too, so I'm wondering how widely used this is...
    We cannot add it to the output of the XSL since XMLTransform defines the output of the XML to be well formed XML, and adding a random set of text nodes would viloate that rule..

  • Ant throws the exception when builds B2B

    Hi,
    Ant throws the exception:
    default.application.xml:
        [style] Processing D:B2B_DEVsap_earmeta-inf.b2bapplication.xml to D:B2B
    _DEVproject_earmeta-inf.b2b_devMETA-INFapplication.xml
        [style] Loading stylesheet D:B2B_DEVbintemplatesapplication.xsl
        [style] Failed to process D:B2B_DEVsap_earmeta-inf.b2bapplication.xml
    BUILD FAILED
    D:B2B_DEVbinbuild.xml:113: The following error occurred while executing this
    line:
    D:B2B_DEVprojectbuildmodification.xml:102: The following error occurred while
    executing this line:
    D:B2B_DEVbinearbuilder.xml:78: The following error occurred while executing t
    his line:
    D:B2B_DEVbinearbuilder.xml:16: javax.xml.transform.TransformerConfigurationEx
    ception: Could not load stylesheet. org.w3c.dom.DOMException: Prefix is 'xmlns',
    but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xs
    l'
    How to fix it?
    The configuration is MS Windows XP SP2, MS SQL Server 2000 Developer Edition SP4, SAP Web AS 6.40 SP18, Apache Ant 1.6.5, Build Tool, j2sdk1.4.2_07.
    Any help will be appreciated.
    Regards,
    Roman Babkin

    Hi,
    have you tried to urlencode the hash char?
    Might be interesting as well if the problem also occours when you point to a local script in your url. The script should then contain a static link to your xml file.
    cheers,
    jossif

  • Ant throws the exception when builds B2B (E-selling of CRM-ISA)

    Hi,
    Ant throws the exception:
    default.application.xml:
        [style] Processing D:B2B_DEVsap_earmeta-inf.b2bapplication.xml to D:B2B
    _DEVproject_earmeta-inf.b2b_devMETA-INFapplication.xml
        [style] Loading stylesheet D:B2B_DEVbintemplatesapplication.xsl
        [style] Failed to process D:B2B_DEVsap_earmeta-inf.b2bapplication.xml
    BUILD FAILED
    D:B2B_DEVbinbuild.xml:113: The following error occurred while executing this
    line:
    D:B2B_DEVprojectbuildmodification.xml:102: The following error occurred while
    executing this line:
    D:B2B_DEVbinearbuilder.xml:78: The following error occurred while executing t
    his line:
    D:B2B_DEVbinearbuilder.xml:16: javax.xml.transform.TransformerConfigurationEx
    ception: Could not load stylesheet. org.w3c.dom.DOMException: Prefix is 'xmlns',
    but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xs
    l'
    How to fix it?
    The configuration is MS Windows XP SP2, MS SQL Server 2000 Developer Edition SP2, SAP Web AS 6.40 SP18, Apache Ant 1.6.5, Build Tool.
    Any help will be appreciated.
    Regards,
    Roman Babkin

    Hi,
    Ant throws the exception:
    default.application.xml:
        [style] Processing D:B2B_DEVsap_earmeta-inf.b2bapplication.xml to D:B2B
    _DEVproject_earmeta-inf.b2b_devMETA-INFapplication.xml
        [style] Loading stylesheet D:B2B_DEVbintemplatesapplication.xsl
        [style] Failed to process D:B2B_DEVsap_earmeta-inf.b2bapplication.xml
    BUILD FAILED
    D:B2B_DEVbinbuild.xml:113: The following error occurred while executing this
    line:
    D:B2B_DEVprojectbuildmodification.xml:102: The following error occurred while
    executing this line:
    D:B2B_DEVbinearbuilder.xml:78: The following error occurred while executing t
    his line:
    D:B2B_DEVbinearbuilder.xml:16: javax.xml.transform.TransformerConfigurationEx
    ception: Could not load stylesheet. org.w3c.dom.DOMException: Prefix is 'xmlns',
    but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:xs
    l'
    How to fix it?
    The configuration is MS Windows XP SP2, MS SQL Server 2000 Developer Edition SP2, SAP Web AS 6.40 SP18, Apache Ant 1.6.5, Build Tool.
    Any help will be appreciated.
    Regards,
    Roman Babkin

  • Throw Soap Exception in BPM.

    Hi All,
    My scenario is Soap->XI->BPM->RFC. I get a soap request in synchronous way with Request and Response messages I Map my request to a RFC and If there's any application error or mapping error I have to send SOAP fault exception to my Soap Sending system. But I don't see any option in BPM to throw soap exception only thing I can do is to map my errors in the soap response and send it to soap sender.
    But my Soap sending system needs soap fault not a response message when any errors happen.
    Please let me know if anybody has this same situation and how to handle it.
    Thanks in Advance,
    SP.

    Hi VJ,
    I have to use BPM as I am doing other stuff in my BPM. In my BPM I am catching mapping exception and then I have to send this to Soap Sender in SOAP fault message and in abstract interfaces we don't have option to give fault message types. Also, I am using S/A bridge and I have to close the brige in order to send some response to Soap Sender.
    Is it possible to send soap fault when we close the S/A brige by send step.
    Thanks,
    SP.

  • Thrown validation exception not being showed in jspx page

    Hi,
    I have a page with af:table which uses one view object.That view object is using one entity object. In one of the method of the EntityImpl class of my entity object i throw ValidationException.I debugged the application and i saw that it is throwing the exception.But it is not being shown in the page. What might be wrong here?
    try{
    setAttributeInternal(BANKTYPE, value);
    catch(TooManyObjectsException e) {
    e.printStackTrace();
    throw new ValidationException ("You are trying to add existing record");
    My jspx page is having *<af:messages id="m1"/>*
    Does the jspx page need any configuration to show the thrown exception in a popup?
    Regards,
    Priya.

    Hi vinod,
    I tried it and it worked.Thanks a lot :). Can you please tell me why it was not happening with the ValidationException?
    Regards,
    Priya.

  • How to Throw/Catch Exceptions in BPM

    Hi All,
    I've seen a couple articles that talk about how to Throw/Catch an execption in a BPM. My question has two parts:
    1) RFC Call: I was able to catch an Fault Message in an exception step when calling an RFC (Synchronous Interface). What I wanted to do is use the fault message (exception) and store it in a DB for later review.
    2) IDOC: I'm sending an IDOC to R3 from a BPM. The send step is enclosed in a block w/ an exception. The send step is throwing an error (IDOC adpater system error), but the exception is never thrown. My question is: when the error occurrs at the adapter level does it still throw an exception in a BPM?
    Thanks for any tip/advice/anything!
    Fernando.

    Hi Fernando,
    1) Define a send step in the exception branch.
    2) If u send a IDoc from R/3 to XI and the IDoc adapter is running to an error of course there cant be an exception in ur business process. Usually the IDoc adapter sends back status back up via ALEAUD. In case of success IDoc should have then '03', if the adapter cannot send anything the IDoc should remain at '39'. U should send a ALEAUD in case of exception of BPM switching to status '40', in case of success to '41'.
    Regards, Udo

Maybe you are looking for