6 Replies Latest reply on Jun 27, 2011 6:35 PM by 689380

    error while executing an interface

    856194
      Hi, I am getting this error:

      STEP is :Loading - Srcset0 - Call sqldr

      org.apache.bsf.BSFException: exception from Jython:
      Traceback (innermost last):
      File "<string>", line 31, in ?
      File "C:\App\DataIntegrator11g\oracledi\client\odi\bin\..\..\jdev\extensions\oracle.odi.navigator\scripting\Lib\javaos.py", line 198, in system
      File "C:\App\DataIntegrator11g\oracledi\client\odi\bin\..\..\jdev\extensions\oracle.odi.navigator\scripting\Lib\javaos.py", line 224, in execute
      OSError: (0, 'Failed to execute command ([\'sh\', \'-c\', \'sqlldr stage/oracle control="C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.ctl" log="C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.log" > "C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.out" \']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')

           at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
           at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:345)
           at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:169)
           at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2374)
           at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java:1615)
           at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java:1580)
           at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2755)
           at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
           at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
           at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
           at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
           at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
           at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
           at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
           at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
           at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
           at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
           at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
           at java.lang.Thread.run(Thread.java:662)

      the code is:

      import java.lang.String
      import java.lang.Runtime as Runtime
      from jarray import array
      import java.io.File
      import os
      import re
      import javaos



      def reportnbrows():          
                
           f = open(r"C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.log", 'r')
           try:
                for line in f.readlines():
                     if line.find("MAXIMUM ERROR COUNT EXCEEDED")>=0 :
                          raise line
           finally:
                f.close()



      ctlfile = r"""C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.ctl"""
      logfile = r"""C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.log"""
      outfile = r"""C:/Proyectos/Dropbox/DatosPrueba/BOGSALD.out"""
      oracle_sid=''
      if len('')>0: oracle_sid = '@'+''

      loadcmd = r"""sqlldr stage/<@=snpRef.getInfo("DEST_PASS") @>%s control="%s" log="%s" > "%s" """ % (oracle_sid,ctlfile, logfile, outfile)

      rc = os.system(loadcmd)

      if rc <> 0 and rc <> 2:
      raise "Load Error", "See %s for details" % logfile

      if rc==2:
      reportnbrows()