1 Reply Latest reply on Jul 14, 2012 11:52 AM by Ashish_Apps

    XML Publisher Datasource XML Data Template

    edab
      Hello,
      I am trying to create function (Program Units) in my XML Data template, I get the following ERROR.




      ----------------------------
      XX Custom Application: Version : UNKNOWN

      Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

      XXTESTNEW module: XX TEST Report-New
      ---------------------------------------------------------------------------

      Current system time is 13-JUL-2012 15:34:09

      ---------------------------------------------------------------------------

      0.197: [GC 0.197: [DefNew: 1777K->191K(1984K), 0.0042507 secs] 1777K->242K(6080K), 0.0043329 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      0.330: [GC 0.330: [DefNew: 1983K->44K(1984K), 0.0054729 secs] 2034K->282K(6080K), 0.0055303 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
      0.536: [GC 0.536: [DefNew: 1836K->192K(1984K), 0.0053814 secs] 2074K->591K(6080K), 0.0054403 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
      0.695: [GC 0.695: [DefNew: 1984K->138K(1984K), 0.0036150 secs] 2383K->711K(6080K), 0.0036667 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
      0.969: [GC 0.969: [DefNew: 1930K->92K(1984K), 0.0050182 secs] 2503K->802K(6080K), 0.0050735 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
      1.453: [GC 1.453: [DefNew: 1884K->192K(1984K), 0.0049133 secs] 2594K->1247K(6080K), 0.0049730 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
      1.493: [GC 1.493: [DefNew: 1962K->58K(1984K), 0.0025240 secs] 3018K->1301K(6080K), 0.0025808 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
      1.501: [GC 1.501: [DefNew: 1847K->93K(1984K), 0.0014896 secs] 3090K->1337K(6080K), 0.0015390 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.507: [GC 1.507: [DefNew: 1860K->70K(1984K), 0.0006978 secs] 3103K->1313K(6080K), 0.0007453 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.514: [GC 1.514: [DefNew: 1849K->103K(1984K), 0.0004474 secs] 3093K->1346K(6080K), 0.0004883 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.595: [GC 1.596: [DefNew: 1895K->138K(1984K), 0.0020285 secs] 3138K->1437K(6080K), 0.0020863 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
      1.673: [GC 1.673: [DefNew: 1930K->64K(1984K), 0.0014510 secs] 3229K->1496K(6080K), 0.0015049 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.759: [GC 1.759: [DefNew: 1856K->98K(1984K), 0.0014301 secs] 3288K->1530K(6080K), 0.0014835 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.827: [GC 1.827: [DefNew: 1890K->89K(1984K), 0.0010782 secs] 3322K->1572K(6080K), 0.0011340 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.880: [GC 1.880: [DefNew: 1881K->133K(1984K), 0.0011918 secs] 3364K->1616K(6080K), 0.0012450 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.936: [GC 1.936: [DefNew: 1925K->113K(1984K), 0.0012641 secs] 3408K->1670K(6080K), 0.0013197 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      1.990: [GC 1.990: [DefNew: 1905K->191K(1984K), 0.0022812 secs] 3462K->1976K(6080K), 0.0023401 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
      XDO Data Engine Version No: 5.6.3
      Resp: 23202
      Org ID : 43
      Request ID: 22637028
      All Parameters:
      Data Template Code: XXTESTNEW
      Data Template Application Short Name: XX
      Debug Flag: N
      2.161: [GC 2.161: [DefNew: 1983K->192K(1984K), 0.0036382 secs] 3768K->2170K(6080K), 0.0036949 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
      {}
      Calling XDO Data Engine...
      2.289: [GC 2.289: [DefNew: 1984K->192K(1984K), 0.0036540 secs] 3962K->2475K(6080K), 0.0037115 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
      [071312_033411511][][EXCEPTION] java.lang.NullPointerException
           at oracle.apps.xdo.dataengine.DataTemplateParser.GetNodeNumChildren(DataTemplateParser.java:334)
           at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(DataTemplateParser.java:266)
           at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(XMLPGEN.java:140)
           at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(DataProcessor.java:193)
           at oracle.apps.xdo.oa.util.DataTemplate.<init>(DataTemplate.java:245)
           at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:282)
           at oracle.apps.fnd.cp.request.Run.main(Run.java:161)

      2.394: [GC 2.394: [DefNew: 1365K->143K(1984K), 0.0025966 secs]2.397: [Tenured: 2451K->2381K(4096K), 0.0798821 secs] 3648K->2381K(6080K), 0.0825759 secs] [Times: user=0.08 sys=0.01, real=0.08 secs]
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
           at com.sun.java.util.collections.ArrayList.RangeCheck(ArrayList.java:492)
           at com.sun.java.util.collections.ArrayList.get(ArrayList.java:306)
           at oracle.apps.xdo.dataengine.DataTemplateParser.getParentDataSource(DataTemplateParser.java:1796)
           at oracle.apps.xdo.dataengine.XMLPGEN.writeDefaultGroup(XMLPGEN.java:331)
           at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:286)
           at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
           at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
           at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
           at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
           at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
           at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:348)
           at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
           at oracle.apps.fnd.cp.request.Run.main(Run.java:161)

      Heap
      def new generation total 1984K, used 250K [0xcc400000, 0xcc620000, 0xccb10000)
      eden space 1792K, 13% used [0xcc400000, 0xcc43ea98, 0xcc5c0000)
      from space 192K, 0% used [0xcc5c0000, 0xcc5c0000, 0xcc5f0000)
      to space 192K, 0% used [0xcc5f0000, 0xcc5f0000, 0xcc620000)
      tenured generation total 6104K, used 4381K [0xccb10000, 0xcd106000, 0xd0400000)
      the space 6104K, 71% used [0xccb10000, 0xccf57598, 0xccf57600, 0xcd106000)
      compacting perm gen total 12288K, used 7039K [0xd0400000, 0xd1000000, 0xd8400000)
      the space 12288K, 57% used [0xd0400000, 0xd0adfc88, 0xd0adfe00, 0xd1000000)
      ro space 8192K, 80% used [0xd8400000, 0xd8a73430, 0xd8a73600, 0xd8c00000)
      rw space 12288K, 59% used [0xd8c00000, 0xd9330510, 0xd9330600, 0xd9800000)
      ---------------------------------------------------------------------------
      Start of log messages from FND_FILE
      ---------------------------------------------------------------------------
      ---------------------------------------------------------------------------
      End of log messages from FND_FILE
      ---------------------------------------------------------------------------


      ---------------------------------------------------------------------------
      Executing request completion options...


      Finished executing request completion options.

      ---------------------------------------------------------------------------
      Concurrent request completed
      Current system time is 13-JUL-2012 15:34:11

      -------------------------

      Please see the following Data Template, I have copied the folloing



      <report name="anyname" DTDVersion="9.0.2.0.0">
      <data>
      <dataSource name="Q_1">
      <select>
      select 1 EMPLOYEE_ID, 'FIRST_NAME' FIRST_NAME,'LAST_NAME' LAST_NAME, 1 DEPARTMENT_ID ,2 SALARY, 2 COMMISSION_PCT from dual
      </select>
      <group name="G_EMPLOYEES">
      <dataItem name="EMPLOYEE_ID"/>
      <dataItem name="FIRST_NAME"/>
      <dataItem name="LAST_NAME"/>
      <dataItem name="HIRE_DATE"/>
      <dataItem name="SALARY"/>
      <dataItem name="COMMISSION_PCT"/>
      <dataItem name="DEPARTMENT_ID"/>
      <formula name="CF_REMUNERATION" source="cf_1formula"
      datatype="number" width="20" precision="10"/>
      </group>
      </dataSource>
      <summary name="CS_REPORT_LEVEL_SUMMARY" function="sum" width="20"
      precision="10" reset="report" compute="report"/>
      </data>
      <programUnits>
      <function name="cf_1formula" returnType="number">
      <textSource>
      <![CDATA[
      function CF_1Formula return Number is
      begin
      return (:salary + nvl(:commission_pct,0));
      end;
      ]]>
      </textSource>
      </function>
      </programUnits>
      </report>







      Note:
      I have taken this from the following documentation.
      http://docs.oracle.com/cd/E12839_01/bi.1111/b32121/pbr_xml003.htm


      Regards
      Ed