Load Plan Exception Finds no PrevStepLog Value

import smtplib
server = smtplib.SMTP('XXXmail')
From = 'XXX'
To = '#ERROR_RECIPIENT'
Subject = ' '.join(['#Platform'
,'<%=snpRef.getSession("CONTEXT_NAME")%>'
,'<%=snpRef.getSession( "SESS_NAME" )%>'
,'<%=odiRef.getPrevStepLog("STEP_NAME")%>'
,'Failed'])
MessageString = """<%=odiRef.getPrevStepLog("MESSAGE")%>"""
MessageString = MessageString[:MessageString.find('\tat')]
Message="From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s" % (From,To,Subject,MessageString)
server.sendmail(From,To,Message)
sends "No previous step log message" for a failing Load Plan step.
How can I get the PrevStepLog value in a Load Plan Exception step?

Currently my packages have many steps, each step with a red failure arrow leading to this type of failure e-mail procedure -- lots of red arrows and many nearby copies of the failure e-mail procedure to eliminate the confusion.
I had hoped that the Load Plan Exception feature would let me take all these red arrows out of my packages and move the e-mail failure reporting to the Exception step.

Similar Messages

  • Load Plan exception step variable

    Hi all,
    maybe you could be interested in.
    It is not possible refresh or overwrite a variable inside exception step. This is fantastic !
    http://docs.oracle.com/cd/E21764_01/relnotes.1111/e10133/odi.htm#CHDFFEFI
    So If I need to log an error I cannot use a parametric query. Great !

    Currently my packages have many steps, each step with a red failure arrow leading to this type of failure e-mail procedure -- lots of red arrows and many nearby copies of the failure e-mail procedure to eliminate the confusion.
    I had hoped that the Load Plan Exception feature would let me take all these red arrows out of my packages and move the e-mail failure reporting to the Exception step.

  • Load Plan and variables

    Hi all,
    I cannot set value for variables inside load plan exceptions editor. Anyway I can inside Load Plan steps editor.
    Is it possible ?
    I need to set variable when exception is raised. How I can do it ?
    thanks

    thank you for the answer..
    but why I have to use a when case step?
    I just need to set a string in a variable before to execute a serial step within exception step.
    I do this in a normal load plan step. So Why I cannot do the same in the exception one ?

  • Error when execute service Find Capacity Load Planning View...

    Hi experts
    I am using the esworplace to test this service:
    Find Capacity Load Planning View by Capacity Load Planning View
    When i execute in web service navigator, one error happen. Belowis i post the XML error returned.
    I passed the parameters:
    PlanningVersionID: 000
    EquipmentResourceID: L-1000
    Do you know why this error ocurr?
    Or where i can get the right values to pass in the parameters?
    <?xml version="1.0" encoding="utf-8"?>
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
      <soap-env:Header/>
      <soap-env:Body>
        <n0:CapacityLoadPlanningViewSimpleByElementsResponse_sync xmlns:n0="http://sap.com/xi/SAPGlobal/Global" xmlns:prx="urn:sap.com:proxy:HU8:/1SAI/TASF48B8D720E56660E95DE:701:2008/06/06">
          <Log>
            <BusinessDocumentProcessingResultCode>5</BusinessDocumentProcessingResultCode>
            <MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
            <Item>
              <TypeID>003(/SAPAPO/SE_PPDS)</TypeID>
              <CategoryCode>PRE</CategoryCode>
              <SeverityCode>3</SeverityCode>
              <Note>Invalid timezone</Note>
            </Item>
          </Log>
        </n0:CapacityLoadPlanningViewSimpleByElementsResponse_sync>
      </soap-env:Body>
    </soap-env:Envelope>

    Hi Brandao,
    From the error log you had sent, it seems that the time zone maintained for the resource L-1000 is invalid which requires correction.
    Correct the time zone maintained in the resource and then retry
    Regards
    R. Senthil Mareeswaran.

  • Load Plans Don't Honor Default Variable Values

    The following code uses Package defaults for Global Variable Values. When run as the first step in a Package or as the Scenario of a Package, it works.
    When run as the first step in Load Plan the code fails. Load Plans apparently don't honor Variabel default values.
    import socket
    outsocket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
    ContextName = '<%=snpRef.getSession("CONTEXT_NAME")%>'
    if not ContextName: ContextName = 'No Context'
    SessionName = '<%=snpRef.getSession("SESS_NAME")%>'
    if not SessionName: SessionName = 'No Session'
    Message = '<%=snpRef.getOption("Message")%>'
    if not Message: Message = 'No Message'
    outmessage = ' '.join([
         '#PLATFORM'
        ,ContextName
        ,SessionName
        ,Message
    ListenPort = #LISTEN_PORT
    if not ListenPort: raise RuntimeError, 'no listen port'
    ListenHost = '#LISTEN_HOST'
    if not ListenHost: raise RuntimeError, 'no listen host'
    outsocket.sendto(outmessage,(ListenHost,ListenPort))
    outsocket.close()
    [code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I know the documentation says Load Plans don't honor Package defaults, but still. . .

  • [BIACM0085] Error executing load plan after reverting from LDAP to original security mechanism in BIA 11.1.1.7.1

    We have tried to change authenticaion of BI Apps 11.1.1.7.1 to LDAP, but reverted this due to some other issues. Now we are back with standard authentication, and all functionality seems to work fine, except execution of a load plan.
    When we select (any) plan that was executed earlier, we get an error:
    [BIACM0085] Error executing load plan. Action: Correct the properties selected or entered and retry.
    [BIACM0080] Cause: Application error: MustUnderstand headers:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood Action: Contact your help desk or system administrator.
    According to one of our WLS gurus there is a mismatch between consumer and provider of a web service with a security policy, but we cannot find any difference between a working and this failing environment.
    We already started a trace in WLS, but this does not help us further.
    Any hints on troubleshooting steps or even better resolution are more than welcome, as this is blocking a new full load and further tests.
    Tx,
    Luc

    We have tried to change authenticaion of BI Apps 11.1.1.7.1 to LDAP, but reverted this due to some other issues. Now we are back with standard authentication, and all functionality seems to work fine, except execution of a load plan.
    When we select (any) plan that was executed earlier, we get an error:
    [BIACM0085] Error executing load plan. Action: Correct the properties selected or entered and retry.
    [BIACM0080] Cause: Application error: MustUnderstand headers:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood Action: Contact your help desk or system administrator.
    According to one of our WLS gurus there is a mismatch between consumer and provider of a web service with a security policy, but we cannot find any difference between a working and this failing environment.
    We already started a trace in WLS, but this does not help us further.
    Any hints on troubleshooting steps or even better resolution are more than welcome, as this is blocking a new full load and further tests.
    Tx,
    Luc

  • Send a Failure Email Notification After Load Plan execution in ODI 11g

    Hi Experts,
    Greetings!
    I am trying to send an email if any of the step fails during Load Plan execution. Irrespective of the failed object, only 1 email should be sent to the Administrator. I unable to do this. Mails are getting sent for the no of times the no of object fails. For eg if 10 out of 100 steps fails, 10 emails are getting sent. I need to send only 1 email.
    I am using ODISendMail.
    I have tried various combinations however, all in Vain.
    For instance:
    root step --> Exeception Step (Send Failure Email) and Execption behaviour (Run Exception and Ignore). Using this because, I dont want to stop the load plan on the step failure.
    Interface1: Exeception Step (Blank) and Execption behaviour (Run Exception and Ignore).
    Interface2: Exeception Step (Blank) and Execption behaviour (Run Exception and Ignore).
    Exception not getting executed.
    Please help.
    Regards,
    Andy

    Thanks SH.
    I tried your suggestion as per below.
    1. Created global variable "v_cnt" with default value "0"
    2. Created package "pkg_v_cnt" to increment the variable by 1
    3. created package "pkg_sendError_Email" to check if v_cnt > 0 then Send Error Email.
    For Instance, the loan plan looks like this:
    root step --> Exeception Step (pkg_v_cnt) and Execption behaviour (Run Exception and Raise)
    Interface1: Exeception Step (pkg_v_cnt) and Execption behaviour (Run Exception and Ignore).
    Interface2: Exeception Step (pkg_v_cnt) and Execption behaviour (Run Exception and Ignore).
    Send Error Email (pkg_sendError_Email)
    The issue here is that, the variables are not getting the incremented value and hence unable to send email . The variable value remains "0" even after execution of the exception steps when both interfaces fails.
    Pls help.
    Thanks,
    Andy

  • How can I control del Target Load plan in a mapping?

    Hi,I have a mapping (attachment) that does inserts and updates to the same table in 3 different situations. It is a simple mapping that inserts new rows or update one that already exists, but also keeps the instance before update. If one record already exists it inserts a new instance of that record and updates the old one with the modification date.But i'm having an issue because of the order in wich each target is loaded. I know i can make 3 independent pipelines and then use the target load plan but y want to avoid reading the source more than one tiem.Regards, Matías.

    kglad, thank you very much for taking a look.
    Perhaps it would be better to view the entire site here:
    http://www.katodesignstudio.net/linda/index.html
    On the News page, I'd like to have a button that will load
    the Screening page (screening.swf) where the News page is loaded.
    At the link above, the button has been removed until I can find a
    solution but it would be located where the "see screening page for
    details" text is now.
    As you can see by going to any other page, all of the pages
    in the site load into a container clip. From what I can tell so
    far, I need the button to unload the News.swf from the container
    clip and load the Screening.swf into that same container clip,
    similar to what the top Nav menu is doing. The trick seems to be to
    get the button to unload the swf that the button is located in...
    How can this be done?
    thanks again for your help!

  • Black background in Load Planning in TM9.1 with VB2.1(Also item details)

    Hi Experts,
    In Load Planning tab in Freight order, the 3-D component's background is always black, and when i clicking the item, item details will pop-up,
    but the background also black, please see below picture.
    Does anyone has ideas, Thanks in advance.
    Best Regards,
    Matthew He

    Hi Uwe,
    I have a similar problem.
    I copied the demo program  VBI_GUI_SAMPLE1 and have changed the source for displaying Details and Tooltip.
    But the Details are shown in a black box. The letters are also in black, so the details are not visible.
    --source
    " tooltip
         ls_descr_entry-category   = if_vbi_const=>gc_descr_category-both.
         ls_descr_entry-part       = if_vbi_const=>gc_descr_part-caption.
         ls_descr_entry-field_name = 'RD'.                       "#EC NOTEXT
         ls_descr_entry-value      = |{ is_geo_position-xpos }/{ is_geo_position-ypos }|.
    *    ls_descr_entry-column     = 1.
         APPEND ls_descr_entry TO ls_spot-description.
         ls_descr_entry-category   = if_vbi_const=>gc_descr_category-tooltip.
         ls_descr_entry-part       = if_vbi_const=>gc_descr_part-subcaption.
         ls_descr_entry-field_name = 'WGS84'.                    "#EC NOTEXT
         ls_descr_entry-value      = |{ ls_spot-position-xpos }/{ ls_spot-position-ypos }|.
    *    ls_descr_entry-column     = 1.
         APPEND ls_descr_entry TO ls_spot-description.
         ls_descr_entry-category   = if_vbi_const=>gc_descr_category-detail.
         ls_descr_entry-part       = if_vbi_const=>gc_descr_part-body.
         ls_descr_entry-field_name = 'body'.                     "#EC NOTEXT
         ls_descr_entry-value      = 'detail'.
    *    ls_descr_entry-column     = 1.
         APPEND ls_descr_entry TO ls_spot-description.
    --end source
    Best regards Maarten van Riel

  • Dynamic Load Plan creation using scripting

    Hello All,
                   We have a requirement to create load plans dynamically i.e using script groovy. Idea is that we will store interface scenarios in a table and then script will read these scenarios an create dynamic load plans. Now following are my question.
                   1) Is it possible to create load plans through script ? (different blogs on net claims that you can do anything or everything whatever ODI studio can do)
                    2) Any pointer what API to use for this task ? I am very new to scripting and have zero idea about how to go about it . if possible please suggest sample script to create load plans (I can see some sample to create interface,folder etc on net.)
    Thanks in advance for your reply.
    Thanks & Regards

    ODI SDK apis allows dynamic creation of Loadplans. Oracle Fusion Middleware Java API Reference for Oracle Data Integrator
    Studio too uses these APIs for LP related operations so you should be able to do using these whatever studio allows.
    You can find SDK samples at Oracle Data Integration Sample Code

  • ODI 11g, Issue with Load plan variable in CASE WHEN STEP

    Hi,
    I am trying to retrieve value of the current context using the following code in refreshing variable:
    Variable name: Context
    Refreshing Code: select  '<%=odiRef.getContext( "CTX_Name" )%>'  from dual
    The variable is returning correct results when I refresh / Call it as part of Run Scenario step.
    Requirement: I want to use the variable Context in CASE step, depending on the value it results I want to execute a selective set of scenarios. I have defined case when steps per the requirements.
    Issue: The behavior of the variable is not as expected when used in CASE WHEN step. Load plan execution always triggers only ELSE part of CASE WHEN step.
    I have tried force refresh option in CASE STEP on the variable Context.
    Need your help and advice on how to fix the issue.
    Thank you,
    Bharani

    HI Bharani,
    Below link may helps you about load plan in ODI
    Help on Load Plan Execution
    Regards,
    Phanikanth

  • Early execution of scheduled load plan

    Hi All,
    Can anyone help me
    In my Project, production environment they scheduled 2 loadplans ie fulltest & odscopies
    so what happen here is in fulltest scheduled at every sat 1.00am, having 7 scenarios with 3 are parellel, in that 2 scenarios has executed befor the scheduled time and again exectuted scheduled time
    why its runs we are not able to found it and its do this week only never happen previosly ?
    Thansk in advance
    srikanth

    Hi.
    1) I don't know if its possible
    2) I don't know if it's possible to achieve what you want from one load plan to another.
    You may do the following:
    1 - Create a table with the load plan name or ID and the dependency between them (like a parent-child table) and put start and end date times or flag attributes to inform the execution start and finish.
    2 - Create one or more package or procedure to control the finish of one load plan and start of the other. Use the ODITimeWait and a variable to check the value of the flags in a loop.
    3 - Put the call of these packages or procedures in the beginning of each load plan so he may start but will continue only if the parent load plan finished sucessfuly.
    May be a little complicated in the beginning but worth a try and you can attach as many load plans you want.
    OR
    1 - Create a package with a call to the child load plan using OdiStartLoadPlan
    2 - Add the package scenario to the end of the first load plan.
    Any other idea will be greatly appreciated.
    Cheers.

  • Case when condition in ODI Load Plan

    Hi All,
    Created a project variable(VAR_X) which is a text type and it can be refreshed by querying in some database.
    Created a Load Plan and added a Case step by using VAR_X
    with following logic
    Case VAR_X
    when value ='X'
         run_x_scenario.
    when value='Y'
         run_y_scenario.
    else
    but whenever I give start up value X or Y ,variable unable to evaluate the when condition provided in the load plan.
    always its taking else step
    Case VAR_X
    else
    but its working when I evaluate with numeric number like when value =1 etc (here I changed variable datatype to numeric)
    Any pointers will be appreciated.
    Thanks,
    Aravind

    It may be due to the quotes you have added in your when clause. Can you try it without quotes.

  • Finding the min value in a hashtable

    Hi,
    I'm trying to work out the lowest value contained in a hashTable. So far I've got.
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    public class StoreValuesDouble extends Statistic {
          * Each object of the class (StoreValuesDouble) will have these attributes.
          * When you call the StoreValuesDouble class you can use
          * myDoubleValues (a Vector holding Double types),
          * Hashtable (a Hashtable using Double types as values and keys) and
          * nullValues (an Double currently set to 0.0).
         Vector<Double> myDoubleValues; //declare a variable myDoubleValues that is of data type Vector
         Hashtable<Double, Double> myValues; //declare a variable myvalues that is a data type Hashtable
         Double nullValues = 0.0; //Double attribute to count the number of null values contained in the vector
          * pass myDoubleValues to inValues
          * @param Vector /<Double/> a vector holding Double values
          * @param inValues the values in the vector
          * @return
         public void DoubleStat(Vector<Double> inValues) {
              myDoubleValues = inValues;
          * calculate the mean of myDoubleValues
          * @return mean of myDoubleValues as a double
         public double meanDouble() {
              double mean = 0;
              Double currentDouble;
              double nonNull = 0;
              for (double j = 0; j < myDoubleValues.size(); j++)
                   currentDouble = myDoubleValues.elementAt((int) j);
                   if (currentDouble != null) {
                        mean += currentDouble.doubleValue();
                        nonNull++;
              return mean / nonNull;
          * calculate the standard devitation of myDoubleValues
          * @return standard devitation of myDoubleValues as a double
         public double standardDeviationDouble() {
              double m = meanDouble();
              double t = 0.0;
              Double currentDouble;
              double n = 0;
              for (double j = 0; j < getDoubleValues(); j++) {
                   currentDouble = myDoubleValues.elementAt((int)j);
                   if (currentDouble != null) {
                        n = currentDouble.doubleValue();
                        t += (n - m) * (n - m);
              return Math.sqrt(t / (myDoubleValues.size() - 1.0));// n - 1 as sample varience
          * return the number of values of myDoubleValues to help calculate the mean & standard deviation
          * @return the size of myDoubleValues as a Double
         public double getDoubleValues() {
              return myDoubleValues.size();
          * compute the number of null values
          * @return a double value representing the number of null values
         public Double getDoubleNull() {
              Double nbNull = 0.0;
              // test if myIntValues is null
              if (myDoubleValues == null) {
                   System.out.println("Please enter values that are not null!");
                   return 0.0;
              // if not null, parse all values
                   // for each value, test if it is null or not
                   Double currentDouble;
                   for (double i = 0; i < myDoubleValues.size(); i++) {
                        currentDouble = myDoubleValues.elementAt((int)i);
                        if (currentDouble != null) {
                             /// nothing to do
                        else {
                             nbNull++;
              return nbNull;
    //find the MIN values in the Hashtable to give us the range (with the MAX value)
         public Double MinDouble()
              Double MinDouble = null;
              Double currentValue;
              for (double j = 0; j < myDoubleValues.size(); j++)
                   currentValue = myDoubleValues.elementAt((int) j);
                   if (currentValue != null){
                   if (currentValue <= MinDouble) {
                        MinDouble = currentValue;
              return MinDouble;
         /*find the MAX value in the Hashtable to give us the range (with the MIN value)
         public double MAX()
          * Create an instance of StoreValuesDouble to hold vector values and number of times the values
          * appear. StoreValuesDouble automatically contains the variables defined above
          * (myDoubleValues, myValues and nullValues) we have to initialise myDoubleValues and myValues
          * as they have been defined but not initialised. nullValues has been defined (int) and initialised (0).
          * @param Vector /<Double/> a vector holding Double values
          * @param inValues the values in the vector
          * @return
         public StoreValuesDouble(Vector<Double> inValues) {
              myDoubleValues = inValues; //the attribute myDoubleValues defined in the StoreValuesDouble class
              //is the inValues parameter, this allows us to store the Vector in inValues
              myValues = new Hashtable<Double, Double>(); // create an instance of/initialise Hashtable
          * Now define the methods to make the instance StoreValuesDouble do what we want it to do
          * (ie parse all the double values of the myDoubleValues Vector attribute.
         public void computeDoubleValues() {
              Double currentDouble;//local variable to store the current read Double object
               * Use a for loop to read through all the values contained in the vector
              for (double i = 0; i < myDoubleValues.size(); i++) {
                   currentDouble = myDoubleValues.elementAt((int)i);
                   //currentDouble is now the Double object stored at i
                   //to check that i is not null we use the if statment
                   if (currentDouble != null) {
                        //i is not null so we want to add it to the hashtable. Rather than writing a lot of code
                        //here to do checking and adding we just call a method that can be written seperately
                        updateDoubleTable(currentDouble);
                   else {
                        //i is null so we just count it by adding it to our nullValues attribute
                        nullValues++;
          * Update the current distribution of Doubles
          * @param Double for the value of the key
          * @param inDouble for the value entered into the Hashtable (the object)
         public void updateDoubleTable(Double inDouble) {
              //First test that variable inDouble is not null
              if (inDouble != null) {
                   //update the table myValues this involves two tasks
                   //1)see if the double object has already been seen
                   //so we create a local variable to test the Hashtable
                   boolean alreadyPresent;
                   alreadyPresent = myValues.containsKey(inDouble);
                   //here we check whether inDouble is already in myValues
                   if (alreadyPresent) {
                        //if it is present we need to increase the counter
                        Double counter = myValues.get(inDouble);
                        //local variable counter to get the value associated to the key inDouble
                        Double newCounter = new Double(counter.intValue() + 1.0);
                        //update counter values and then ...
                        myValues.put(inDouble, newCounter);
                        //put into myValues
                        //as Hashtable can store only Objects, we cannot use primitive types
                        // so we use Objects related to primitive types as Integer, Float, Double
                        // or Boolean (here, we use Double)
                   } else {
                        //store the double and set it's counter to 1
                        myValues.put(inDouble, new Double(1));
              } else {
                   //do nothing
         //now we want to display the values
         public void displayDoubleTable() {
              // to display the distribution, we need to parse all the keys of the
              // hashtable and access to the value associated to each key
              Enumeration<Double> keys = myValues.keys();
              Double currentKey;
              Double currentValue;
              System.out.println("");
              System.out.println("Hashtable Information:");
              System.out.println("");
              System.out.println(myDoubleValues.size() + " Double objects in initial vector");
              System.out.println("");
              while (keys.hasMoreElements()) {
                   currentKey = keys.nextElement();
                   currentValue = myValues.get(currentKey);
                   System.out.println("The value " + currentKey.doubleValue()
                             + " has been seen " + currentValue.doubleValue()
                             + " time(s) in the initial Vector");
              System.out.println("");
              System.out.println("There were " + nullValues
                        + " null Double object(s) in the inital Vector");
         }As part of the StoreValuesDouble class. And to display it.
    package statistics;
    import java.util.Vector;
    public class TestStatDouble {
         static Vector<Double> doubleVector;
          * Create and initialise a vector of values and compute the mean,
          * standard deviation, distribution and MIN/MAX values.
         public static void main(String[] args) {
               // initialise the values in initValues
              initValues();
              // create an instance of StoreValuesDouble taking double as the parameter
              StoreValuesDouble is = new StoreValuesDouble(doubleVector);
              //Display the results
              displayVectorContent(doubleVector);
              System.out.println("");
              System.out.println("Number of null values: " + is.getDoubleNull());
              System.out.println("Number of non-null values is: " +(is.getDoubleValues() - is.getDoubleNull()));
              System.out.println("Number of all values: " + is.getDoubleValues());
              System.out.println("The mean is: " + is.meanDouble());
              System.out.println("Standard deviation is: " + is.standardDeviationDouble());
              System.out.println("The lowest value is " + is.MinDouble());
              System.out.println("");
               * now I want to display the results from the displayTable method in the StoreValuesDouble
               * class so I create an instance of StoreValuesDouble and use the computeDoubleValues and
               * displayDoubleTable methods.
              StoreValuesDouble storeValues = new StoreValuesDouble(doubleVector);
              storeValues.computeDoubleValues();
              storeValues.displayDoubleTable();
          * create the class method initValues() to add values to the Vector doubleVector
         public static void initValues()
              doubleVector = new Vector<Double>();
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(10.9));
              doubleVector.addElement(new Double(15.95));
              doubleVector.addElement(new Double(17));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(1));
              doubleVector.addElement(new Double(4));
              doubleVector.addElement(new Double(10.499));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(10.4999));
              doubleVector.addElement(new Double(17));
              doubleVector.addElement(new Double(-15));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(14));
              doubleVector.addElement(new Double(20));
              doubleVector.addElement(new Double(-3));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(9));
              doubleVector.addElement(new Double(1.5));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(10.22));
              doubleVector.addElement(new Double(15.23));
              doubleVector.addElement(new Double(17.91));
              doubleVector.addElement(null);
          * class method to print values contained in the vector doubleVector to the console.
          * @param doubleVector the Vector to be displayed
         public static void displayVectorContent(Vector doubleVector)
              Double currentDouble;
              System.out.println("Double values within the Vector:");
              for (int i=0; i<doubleVector.size();i++)
                   try
                        currentDouble = (Double) doubleVector.elementAt(i);
                        if (currentDouble != null)
                             System.out.print(currentDouble.toString() + " ");
                   catch(ClassCastException cce)
                        System.out.print(cce.getMessage() + " ");
                        cce.printStackTrace();
              System.out.println("");
         It compiles fine but when I try and run it I get a
    Exception in thread "main" java.lang.NullPointerException
         at statistics.StoreValuesDouble.MinDouble(StoreValuesDouble.java:139)
         at statistics.TestStatDouble.main(TestStatDouble.java:37)
    TestStatDouble 37 is
    System.out.println("The lowest value is " + is.MinDouble());139 is
    if (currentValue <= MinDouble) {I guess the problem's in my if loop but I'm not sure why. Any help would be appreciated.
    Message was edited by:
    Ali_D

    Couple of points about your code:
    1. Don't declare your instance variables as solid types, declare them using their interfaces (where applicable), so in your case don't specifiy that you are using Vector or Hashtable, use List and Map. This will allow you to easily change your code to use a different collection, if and when appropriate. Also the unnecessary overhead of Vectors synchronisation means that you should use ArrayList instead of vector (that means that you will have to use get(int) instead of elementAt() but that's a very small price to pay.
    2. Declare local variables as close to their point of usage as possible. (Unless you need to do this for your course work, in which case you don't have a choice).
    3. Use the appropriate data type. For your count of null values you should be using an int or a long (you can't have a fractional count value!) Also, this should have been obvious to you, when you had to cast the value to an int for use with your lists. (Using double as an index is a very bad idea... And before you go posting the question, do a search on why floating point precision may not give you the results you expect)
    4. Code defencively... e.g. in your meanDouble() method, you set nonNull to 0, and then you do a division using that value. What do you think is going to happen if your loop doesn't execute once? Division by zero... You should handle these cases, rather than letting them fail ignominiously.
    5. If you are doing code like this...    if (currentDouble != null) {
            // / nothing to do
        } else {
            nbNull++;
        } Why have the empty block? You should just do the inverse.
        if (currentDouble == null) {
            nbNull++;
        } Far simpler, and expresses exactly what you are trying to do, not what you are not trying to do.
    6. Enumeration --- What version of java is that course being run in? I can see that you are using autoboxing, so it has to be 1.5 so, WHY is your lecturer encouraging the use of Vectors, Hashtables, and Enumerations!?!?!
    Anyway, that should be enough to be going on with.

  • Loop in a Load Plan

    I'm sure this is doable, but I'm just too dense to see it...
    Load Plans are really cool -- I like the way it organizes steps (large Packages are cumbersome and while I have encapsulated with Scenarios it can get tricky for me) and I really like the way results get piped back to Operator. I will admit that the parallelism isn't a needed feature at this point but it's nice to have.
    So now that I'm full of Load Plan love, I have a proof of concept Package that loops the records in a table that I want to emulate in a Load Plan. The Package is very similar to this: http://blogs.oracle.com/dataintegration/entry/using_variables_in_odi_creatin
    Through blind stumbling, I have gotten all of the components of my proof-of-concept Package loop into a Load Plan but I can't figure out how to loop in a LP.
    Test for a value? Yes.
    Force a Refresh Variable to refresh? Yes.
    But how do I tell the LP to execute a series of steps and then jump right back to the beginning? I know that I could just list it out (it's 10 steps) but the whole point of a loop (I know everyone knows this but it helps me) is to repeat a process till a counter hits a value.
    I can certainly include my looping Package within an overall LP, but I wonder if I can do away with the Package altogether.
    What oh what am I missing?
    Thanks,
    Cameron Lackpour

    You're not missing anything I'm afraid, loops are not currently supported functionality in load plans.

Maybe you are looking for

  • Video ipod won't play videos from podcasts

    my ipod plays movies and videos perfectly, but any video casts from the podcasts i subscribe to only come up as a still image, like cover art, but don't play a video. does anyone know why that would be or how to fix it? thanks for your time!

  • Trouble with handheld key store.

    Hi, I got this second hand blackberry 8820 and I tried to download facebook app., but for some reason, it needed handheld key store. Can anyone please help me with this? Ow one more thing, I didn't get any manual or cd for this blackberry. thank you 

  • Regarding Online Redo log backup

    Dear all, I am running "Whole database online + Redo log backup" in production server which running successfully with return code 0000. Is this  backup takes online redo log file also?????? because in backup log i didn't  see any directory like .../.

  • Flash CS5.5 - Out of memory

    Hi, I have a project here that, all of the sudden, I can't export the SWF. The first couple of times it gave me and "out of memory" error in the Java subsystem or something and to change the value of memory in the jvm.ini. I did but nothing changed.

  • How can i catch the gotfocus and lostfocus events

    Hi Dear; i tried to catch the gotfocus and lostfocus events, but i can't. in the same code i can catch the onclick events. is there any special code for the gotfocus and lostfocus events? regards;