Repeater reference in method call

Hi,
I'm trying to reference a value from my repeater component in a method call and it's not working...
<mx:Repeater id="rep" dataProvider="{data.choice}">
                <mx:VBox>
                        <mx:Image
                        source="{rep.currentItem.image.@src}"
                        toolTip="{rep.currentItem.image.@alt}"
                        mouseDown="dragIt(event, rep.currentItem.price)"
                        />
               </mx:VBox>
  </mx:Repeater>
The dragIt() function looks like this:
private function dragIt(event:MouseEvent, value:String):void {
So I want the dragIt() function to get 2 parameters: the event and what is in "rep.currentItem.price"
The code compiles but then nothing happens and I can't drag the image anymore.
If I put a string in the method call it works fine...
i.e.
  mouseDown="dragIt(event, "test")"
I also tried
mouseDown="dragIt(event, rep.currentItem.price as String)"
same problem
Can anyone help ?
Is there another way to do this ?

ok I solved it
you have to use the event targets getRepeaterItem() method
so the correct way to use it is:
<mx:Image
                        source="{rep.currentItem.image.@src}"
                        toolTip="{rep.currentItem.image.@alt}"
                        mouseDown="dragIt(event, event.currentTarget.getRepeaterItem().price)"
                        />

Similar Messages

  • Why are static methods called with null references,valid ?

    This is my code :
    package inheritance;
    public class inh6{
         public static void method(){
         System.out.println("Called");
         public static void main(String[] args){
              inh6 t4 = null;
         t4.method();
    O/P :
    CalledHere t4 is a null reference and yet we are able to call a method on it,why is null pointerexception not thrown.Why are we able to call static methods using null references ?
    t4 is null means it doesnot refer to any memeory address,hence how is method() called correctly.
    I hope i am clear. :)
    Thank you for your consideration.

    punter wrote:
    jverd wrote:
    Memory addresses have nothing to do with it. I doubt memory addresses are even mentioned once in the JLS.
    By memory address i mean the memory location the reference is pointing to.I know what you mean. But if you think it's relevant, can you show me where in the JLS it says anything about memory locations?
    >
    You can do that because a) t4's type is "reference to inh6" and b) method() is declared static, which means that you don't need an object to call it, just the class. That class comes from the compile time type of t4. The fact that t4 is null at runtime is irrelevant.
    So at compile time the type of t4 is inh6 and hence the method is called.Is it ? Had method() not been static a NullPointerException would have been thrown.Correct.
    With non-static, non-private, non-final methods, which implementation of the method gets called is determined at runtime, buy the class of the object on which it's being called. If any one of those "non"s goes away, then the method is entirely determined at compile time, and in the case of static methods, there's no instance necessary to call the method in the first place.

  • Null reference method call behaving oddly

    Hi all, and a very happy new year!!
    My question concerns the null reference; simply, why does the following code chooses to call any other method than the Object version (try it out). No matter what type i choose to replace the current String version with... I have not paid much thought to this, but i would have guessed the null reference calls the Object version in such a situation.
    If i leave only the Object method and comment out all others, the code compiles fine and calls the Object version at runtime - but in case there are sub class versions, those will be called. WHY?
    (im running jre 1.4.1).
    The code:
    public class NullTest {
         public void method(Object o) {
              System.out.println("Object Version");
         public void method(String s) {
              System.out.println("String Version");
         public static void main(String args[]) {
    NullTest nullTest = new NullTest();
              nullTest.method(null);
    }

    schapel, the question related specifically to
    null, in a context where no runtime type can be
    inferred. It wasn't about overloading in general.Yes, I understand that. But here is the rule from the JLS:
    "If more than one method declaration is both accessible and applicable to a method invocation, it is necessary to choose one to provide the descriptor for the run-time method dispatch. The Java programming language uses the rule that the most specific method is chosen."
    Note that it does not refer specifically to a null argument.
    The question is "why is the most specific method called?" The reason is that there are only a few possibilities for this rule:
    1. The least specific method should be called. In this case, overloaded methods with more specific types could not be called.
    2. If there is more than one method, it is a compile time error. Again, this would cause overloading to be useless.
    3. The most specific method is called. It is only with this rule that overloading works. That's why Java uses this rule.

  • Closing an anonymous stream in method call

    Will an anonymous stream in a method call be closed in the same manner an anonymous stream that is created in an object instantiation will be?
    I know this will close the anonymous FileInputStream:
    DataInputStream in =
    new DataInputStream(new FileInputStream("filename.txt"));
    /* ... code ... */
    in.close();But will this?
    MyPropertiesClass myPropertiesClass = new MyPropertiesClass();
    myPropertiesClass.store(new FileOutputStream("file.txt"));MyPropertiesClass extends Properties, and uses its store().
    I know the JavaDoc for Properties says:
    "After the entries have been written, the output stream is flushed. The output stream remains open after this method returns."
    My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?
    Thanks for any insight,
    KJ

    My question is will the FileOutputStream("file.txt") be closed and garbage collected eventually after this method call because I don't have a reference to it? > myPropertiesClass sticks around for a long time afterwards, will the FileOutputStream as well?Your only hope would be if FileOutputStream overrode finalize and closed the stream there -- but it doesn't (check the API -- finalize isn't overridden). I doubt if Properties retains a reference to the OutputStream you pass to store -- why would it need to? In any case, the bottom line is that output stream isn't being closed until your process exits.
    Why not bite the bullet and rewrite that line of code so that you can explicitly close the stream?
    OutputStream out = new FileOutputStream("file.txt");
    try {
        myPropertiesClass.store(out);
    } finally {
        out.close();
    }It's not one line, but who cares? You could wrap it up in a short utility method:
    static void storeProperties(Properties properties, String path) {...}

  • Using a dynamic variable in the Import command of a Method call

    Hi,
    I am trying to make a Method call fully dynamic.
    I have found out how to make the Method name dynamic, but I am having trouble figuring out how to make the Importing statement dynamic.
    in my code below:
          CALL METHOD o_main->(v_call)
            IMPORTING
              it_ekko = i_ekko.
    I would like to know if it's possible to make both "it_ekko" AND "i_ekko" dynamic so I can use this same call for various tables.
    Hope that makes sense...thanks for your help.
    Andy

    Hi Andrew,
    The method call is fully dynamic; not only the parameters can be specified dynamically but also the method name.
    This is a help extract:
    DATA: line     TYPE c LENGTH 80,
          text_tab LIKE STANDARD TABLE OF line,
          filename TYPE string,
          filetype TYPE c LENGTH 10,
          fleng    TYPE i.
    DATA: meth  TYPE string,
          class TYPE string,
          ptab TYPE abap_parmbind_tab,
          ptab_line TYPE abap_parmbind,
          etab TYPE abap_excpbind_tab,
          etab_line TYPE abap_excpbind.
    DATA: exc_ref TYPE REF TO cx_sy_dyn_call_error,
          exc_text TYPE string.
    class    = 'CL_GUI_FRONTEND_SERVICES'.
    meth     = 'GUI_DOWNLOAD'.
    filename = 'c:\temp\text.txt'.
    filetype = 'ASC'.
    ptab_line-name = 'FILENAME'.
    ptab_line-kind = cl_abap_objectdescr=>exporting.
    GET REFERENCE OF filename INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    ptab_line-name = 'FILETYPE'.
    ptab_line-kind = cl_abap_objectdescr=>exporting.
    GET REFERENCE OF filetype INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    ptab_line-name = 'DATA_TAB'.
    ptab_line-kind = cl_abap_objectdescr=>changing.
    GET REFERENCE OF text_tab INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    ptab_line-name = 'FILELENGTH'.
    ptab_line-kind = cl_abap_objectdescr=>importing.
    GET REFERENCE OF fleng INTO ptab_line-value.
    INSERT ptab_line INTO TABLE ptab.
    etab_line-name = 'OTHERS'.
    etab_line-value = 4.
    INSERT etab_line INTO TABLE etab.
    TRY.
        CALL METHOD (class)=>(meth)
          PARAMETER-TABLE
            ptab
          EXCEPTION-TABLE
            etab.
        CASE sy-subrc.
          WHEN 1.
        ENDCASE.
      CATCH cx_sy_dyn_call_error INTO exc_ref.
        exc_text = exc_ref->get_text( ).
        MESSAGE exc_text TYPE 'I'.
    ENDTRY.
    BR,
    Valentin

  • Reporting Against Level Reference Build Method

    All,
    I created a hierarchy in Essbase using the Level Reference build method since the data is in a bottom-up. The data is laid out like so:
    Statement
    --Assets
    ----Calc 1
    ------Calc 2
    --------Major Category 1
    --------Major Category 2
    --------Major Category 3
    ------Major Category 4
    ----Major Category 5
    --Liabilities
    ----Major Category 6
    Originally I had this in a generation reference, but that didn't work since we don't have a consistent number of layers for each item. Next I was thinking a parent-child relationship, but this doesnt work because major categories fall at different levels. Finally, I'm thinking level reference is the way to go since we can have different layers of parents for each lowest level member and the data can be laid out the way we need. (Let me know if you disagree with this approach).
    This works fine in the cube...however, when I import this into the BI Administration tool it only sees generations, not levels. How can I get it to pull in the levels so that I can add individual levels to a report?
    I'm planning on following this method to create the report: http://oraclebizint.wordpress.com/2008/01/10/oracle-bi-ee-101332-achieving-financial-template-layouts-using-pivot-tables/. However, when I do that with generations it has blanks because not all of the major categories are at the same generation. I'm hoping levels will clear this up, but if anyone has a suggestion of a different way to achieve this layout let me know.
    Thanks!

    Hi Corel,
    I am stucking on how and where to call the recursive function for performing Tree-level hierarchy for my above code.!
    in my hierarchy level, one parent has multiple children which in turn so many children and so on... if i am in the least level node , then i need to get the details of its related nodes which has been linked by that node.
    For ex: i have the structure somthing like below:
    Parent
    / | \
    child1 child2 child3
    |
    c5
    |
    c6
    In the above structure, Parent and its children sharing the same address id(56122). Suppose, If i am in c6, then i could get the references for C6->C5->child2->Parent as the hierarchy from ResultSet. child1 and child3 has been ignored ,since there is no implementation for saving their references.
    I am stucking here that i dont know how to save these ref. and get them too in the company hierarchy structure. Remember , i need to refer only the company which is sharing the same address id. there could be other address id assosiated with other children (not included here)
    any suggestion how to save the references by implementing recursive procedure from the resultset.
    thanks in advance

  • Can't make static reference to method while it is static

    Hello, can somebody please help me with my problem. I created a jsp page wich includes a .java file I wrote. In this JSP I called a method in the class I created. It worked but when I made the method static and adjusted the calling of the method it started to complain while i didnt make an instance of the class. the error is:Can't make static reference to method
    here is the code for the class and jsp:
    public class PhoneCheckHelper {
    public static String checkPhoneNumber(String phoneNumber) {
    String newPhoneNumber ="";
    for(int i=0; i<phoneNumber.length(); i++) {
    char ch = phoneNumber.charAt(i);
    if(Character.isDigit(ch)) {
    newPhoneNumber += String.valueOf(ch);
    return newPhoneNumber;
    <html>
    <head>
    <title>phonecheck_handler jsp pagina</title>
    <%@page import="java.util.*,com.twofoldmedia.text.*, java.lang.*" %>
    </head>
    <body>
    <input type="text" value="<%= PhoneCheckHelper.checkPhoneNumber(request.getParameter("phonenumberfield")) %>">
    </body>
    </html>

    Go over to the "New to Java" forum where that message is frequently explained. Do a search if you don't see it in the first page of posts.

  • Can't make static reference to method

    hi all,
    pls help me in the code i'm getting
    " can't make static reference to method....."
    kindly help me
    the following code gives the error:
    import java.rmi.*;
    import java.rmi.Naming;
    import java.rmi.RemoteException;
    import java.io.*;
    import java.io.IOException;
    import java.io.LineNumberReader;
    public class client
    static String vcno;
    static String vpin;
    static String vamt;
    static String vordid;
    static String vptype;
    //static String vreq;
    static String vreq = "1";
    static String vorgid;
    static String vm1;
    static String vs1;
    static String vqty1;
    static String vm2;
    static String vs2;
    static String vqty2;
    static String vm3;
    static String vs3;
    static String vqty3;
    static String vm4;
    static String vs4;
    static String vqty4;
    public static void main(String args[])
    try
    ServerIntf serverintf=(ServerIntf)Naming.lookup("rmi://shafeeq/server");
    int c;
    StringBuffer sb;
    FileReader f1=new FileReader("c:/testin.txt");
    sb=new StringBuffer();
    int line=0;
    while ((c=f1.read())!=-1) {
    sb.append((char)c);
    LineNumberReader inLines = new LineNumberReader(f1);
    String inputline;
    String test;
    while((inputline=inLines.readLine())!=null)
    line=inLines.getLineNumber();
    switch(line)
    case 1: {
    vcno = inLines.readLine();
    System.out.println(vcno);
    case 2: {
    vpin = inLines.readLine();
    System.out.println(vpin);
    case 3: {
    vptype = inLines.readLine();
    System.out.println(vptype);
    case 4: {
    vamt = inLines.readLine();
    System.out.println(vamt);
    case 5: {
    vordid = inLines.readLine();
    System.out.println(vordid);
    case 6: {
    vorgid = inLines.readLine();
    System.out.println(vorgid);
         case 7: {
    vm1 = inLines.readLine();
    System.out.println(vm1);
         case 8: {
    vs1 = inLines.readLine();
    System.out.println(vs1);
         case 9: {
    vqty1 = inLines.readLine();
    System.out.println(vqty1);
         case 10: {
    vm2 = inLines.readLine();
    System.out.println(vm2);
         case 11: {
    vs2 = inLines.readLine();
    System.out.println(vs2);
    case 12: {
    vqty2 = inLines.readLine();
    System.out.println(vqty2);
    case 13: {
    vm3 = inLines.readLine();
    System.out.println(vm3);
         case 14: {
    vs3 = inLines.readLine();
    System.out.println(vs3);
    case 15: {
    vqty3 = inLines.readLine();
    System.out.println(vqty3);
    case 16: {
    vm4 = inLines.readLine();
    System.out.println(vm4);
    case 17: {
    vs4 = inLines.readLine();
    System.out.println(vs4);
    case 18: {
    vqty4 = inLines.readLine();
    System.out.println(vqty4);
    f1.close();
    FileWriter f2=new FileWriter("c:/testout.txt");
    String t;
    t=ServerIntf.add(vcno,vpin,vamt,vordid,vptype,vreq,vorgid,vm1,vs1,vqty1,vm2,vs2, vqty2,vm3,vs3,vqty3,vm4,vs4,vqty4);
    String str1 = " >>";
    str1 = t + str1;
    f2.write(str1);
    System.out.println('\n'+"c:/testout.txt File updated");
    f2.close();
    catch(Exception e)
    System.out.println("Error " +e);

    Yes, ServerIntf is the interface type. The instance serverIntf. You declared it somewhere at the top of the routine.
    So what you must do is call t=serverIntf.add(...)This is probably just a mistype.

  • Reference.clear method

    I think that I do not understand the Reference.clear method. I am trying to use SoftReferences to store objects (actually Sets) that can be retrieved from filesystem files. And I am trying to use (override) the Reference.clear method to handle writing said file when one of them is about to go "byebye"...
    But what is happening is that my clear method never gets called AND the SoftReference.get method returns null. (Which means that the referent is gone without clear having been called...which means I don't understand the clear method!)
    SOOOOOO, can someone please either explain how I can be alerted to handle something just before something gets gc-ed, or else enlighten me to a better way to implement this?
    Here's the longer story:
    I have many "records", far too many to even consider keeping them all in memory at once. So I started storing them in "minisets" which I can serialize to files and retrieve as needed. The "minisets" are values in a HashMap with string keys.
    When one of these Sets gets "big enough", I start storing a SoftReference to it instead of "it". Then when I need a particular set, I do a hashmap.get(key), then either (a) I get the Set, or (b) I get the the softref from which I can get the Set, or (c) I get the softref from which I cannot get the Set, in which case I go reconstruct the Set by reading a file.
    The problem is writing the file... if I write a file every time I edit a (potentially large) Set then this program will take 5 days to run. So I think I want to write the file only when absolutely necessary....right before the gc eats it.
    Thank you for help,
    /Mel

    Okay, here it is.
    MyRef: My extension of PhRef. Also holds referent data that we need for cleanup, since we can't get to referent once Ref is enQ'ed.
    Dummy: thie is the class that you're storing in the Sets or whatever, and that gets put in a reference.
    Dummy's id_ member: This holds the place of whatever data you need for pre-bye-bye cleanup, e.g. a filename and the internal data of Dummy. MyRef grabs this when it's created.
    (Note: what you may want to create a new class, say DummyWrapper that holds a Dummy and provides the only strongly reachable path to it, pass DummyWrapper to the Ref's constructor, and then have the Ref store the wrapped Dummy (e.g. wrapper.getDummy()) as its member var in place of the id_ that I'm storing--that is, in place of storing a bunch of internal data individually. Like I said, this approach seems overly complex, but I've not found a simpler way that works. I originally tried having the Ref store the Dummy directly as a member var, but then the Dummy was always strongly reachable.)
    Poller: Thread that removes Refs from queue. You can probably just do this at the point in your code where you decide the set is "big enough", rather than in a separate thread.
    dummies_: List that holds Dummies and keeps them strongly reachable until cleanup time. I think you said your stuff was in a Set or Sets. This is the parallel to your Set(s).
    refs_: List of PhRefs to keep them reachable until they get enqueued.
    When I don't use Refs properly to clean things up, I get OutOfMemoryError after about 60 or 120 iterations. (I tried a couple different sizes for Dummy, so I forget where I am now.) With the Refs in place, I'm well over 100,000 iterations and still going.
    import java.lang.ref.*;
    import java.util.*;
    public class Ref {
        public static ReferenceQueue rq_ = new ReferenceQueue();
        // one of these lists was giving ConcurrentModificationException
        // so I sync'ed both cuz I'm lazy
        public static List dummies_ = Collections.synchronizedList(new ArrayList());
        public static List refs_ = Collections.synchronizedList(new ArrayList());
        public static Poller po_ = new Poller();
        public static void main(String[] args) {
            new Thread(po_).start();
            new Thread(new Creator()).start();
        public static class Poller implements Runnable {
            public void run() {
                // block until something can be removed, then remove
                // until nothing left, at which point we block again
                while (true) {
                    try {
                        MyRef ref = ((MyRef)rq_.remove());
                        // This println is your file write.
                        // id_ is your wrapped Dummy or the data you need to write.
                        // You probably want a getter instead of a public field.
                        System.err.println("==================== removed "
                                + ref.id_  + "             ======  ===  ==");
                        ref.clear();  // PhRefs aren't cleared automatically
                        refs_.remove(ref); // need to make Ref unreachable, or referent won't get gc'ed
                    catch (InterruptedException exc) {
                        exc.printStackTrace();
        public static class Creator implements Runnable {
            public void run() {
                int count = 0;
                while (true) {
                    // every so often, clear list, making Dummies reachable only thru Ref
                    if (count++ % 50 == 0) {
                        System.err.println("                 :::: CLEAR");
                        dummies_.clear();
                    // give Poller enough chances to run  
                    if (count % 16 == 0) {
                        System.gc();
                        Thread.yield();
                    // Create a Dummy, add to the List
                    Dummy dd = new Dummy();
                    System.err.println("++ created " + dd.id_);
                    dummies_.add(dd);
                    // Create Ref, add it to List of Refs so it stays
                    // reachable and gets enqueued
                    Reference ref = new MyRef(dd, rq_);
                    refs_.add(ref);
        public static class MyRef extends PhantomReference {
            private long id_;  // data you need to write to file
            public MyRef(Dummy referent, ReferenceQueue queue) {
                super(referent, queue);
                id_ = referent.id_;
            public void clear() {
                System.err.println("-------CLEARED " + get());
            public String toString() {
                return "" + id_;
        public static class Dummy {
            // just a dummy byte array that takes up a bunch of mem,
            // so I can see OutOfMemoryError quickly when not using
            // Refs properly
            private final byte[] bb = new byte[1024 * 512];
            private static long nextId_;
            public final long id_ = nextId_++;
            public String toString() {
                return String.valueOf(id_);
    }

  • Type conflict during dynamic method call.

    While executing the following program I get the error "Type conflict during dynamic method call.":
    DATA: container_r  TYPE REF TO object,
          grid_r       TYPE REF TO object,
          itab_saplane TYPE TABLE OF saplane.
    * IMPORTANT NOTE: class names must be in UPPER CASE
    DATA: str_cnt TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
          str_gui TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
          meth_name TYPE STRING VALUE 'SET_TABLE_FOR_FIRST_DISPLAY'.
    TYPE-POOLS abap.
    DATA: ptab    TYPE abap_parmbind_tab,
          wa_ptab LIKE LINE OF ptab,
          ref     TYPE REF TO data.
    CREATE OBJECT container_r TYPE (str_cnt)
      EXPORTING container_name = 'CUSTOM_CONTROL1'. " Name of the custom control area (UC!)
    * Construct parameter itab
    GET REFERENCE OF container_r INTO ref.
    wa_ptab-name  = 'I_PARENT'.  " Must be upper-case
    wa_ptab-value = ref.
    INSERT wa_ptab INTO TABLE ptab.
    *   EXPORTING i_parent = container_r.
    CREATE OBJECT grid_r TYPE (str_gui)
      PARAMETER-TABLE ptab.
    SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE itab_saplane.
    * Cannot call set_table_for_first_display directly...
    CALL METHOD grid_r->(meth_name)
      EXPORTING I_STRUCTURE_NAME = 'SAPLANE'  " Type of the rows in the internal table  (UC!)
      CHANGING  IT_OUTTAB = itab_saplane.     " The internal table itself
    CALL SCREEN 100.
    Any help would be appreciated!

    Hi ...
    Apologies ... for confusion ... actually both are required ...
    the type 'E' as well as CL_GUI_CONTAINER.
    The below code worked for me ...
    check out how I cast it to the parent class type ...
      DATA : lv_container   TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
             lv_control     TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
             lv_method      TYPE string VALUE 'SET_TABLE_FOR_FIRST_DISPLAY',
             lt_par_tab     TYPE abap_parmbind_tab,
             ls_param       LIKE LINE OF lt_par_tab,
             lref_cont      TYPE REF TO cl_gui_container,
             lv_data        TYPE REF TO data.
    CREATE OBJECT lref_container
          TYPE
            (lv_container)
          EXPORTING
            container_name = 'ALV_AREA'.
        ls_param-name = 'I_PARENT'.
        ls_param-kind = 'E'.
        lref_cont ?= lref_container.
        GET REFERENCE OF lref_cont INTO lv_data.
        ls_param-value = lv_data.
        INSERT ls_param INTO TABLE lt_par_tab.
    **  Now create ALV Control.
        CREATE OBJECT lref_alv_ctrl
          TYPE
            (lv_control)
          PARAMETER-TABLE
            lt_par_tab.
    **  Set table for 1st display
        DATA : lv.
        lv = lref_alv_ctrl->mc_fc_print.
        CALL METHOD lref_alv_ctrl->(lv_method)
          EXPORTING
            i_structure_name = 'T001'
          CHANGING
            it_outtab        = lt_company.
    Cheers
    Edited by: Varun Verma on Aug 12, 2008 4:19 PM

  • Easy method call problem

    Hi,
    Does anyone know how to call a certain method in a parent
    script from a behaviour script? Have a method called startit but
    when it I compile it says its the handler is not found.
    Cheers,
    Brenden

    Hi,
    > beginConn = new(member("beginscript").script)
    A more common way of doing this is with this syntax:
    beginConn = script("beginscript").new()
    > As the target instance is not being found now even if I
    have converted
    > to a parent script. Seems very strange!
    An object is an object regardless of the script type that
    made it (the reason why behaviours and parent scripts are generally
    better suited for making objects is that they have a 'protect
    scope' - if you call a handler without specifying the 'object' with
    that handler, then Director looks in all movie scripts for that
    handler; it wont attempt to call the handler or method defined in a
    parent script or behaviour unless you specify that script or an
    instance of that script ).
    > beginConn.startit()
    > on startit me
    > checker = timeout("looker").new(10000, #looker, me)
    > end
    Assuming 'beginConn' contains a reference to an instance of
    the script containing the 'startit' method, then your code looks
    fine (unless you are using DirectorMX2004, in which case it should
    be checker = timeout().new("looker", 10000, #looker, me)).
    Put a debug line in just before you create the timeout, and
    see what 'me' points to. eg.
    on startit me
    put "#startIt message received by " & me
    checker = timeout("looker").new(10000, #looker, me)
    end
    on looker (me, timeoutObject)
    put "#looker message sent by " & timeoutObject & "
    was received by " & me
    end
    -- Luke

  • Native - Java Method Call problem - "Wrong Method ID..."

    I am writing a 3d game engine using c++, with all the game logic code in Java, for the purpose of making the thing extendible, easily modifyable, etc...
    I am using J2SE JDK 1.2.2.
    Most things work fine (engine-wise), but i have a few questions about problems i am having getting the JNI to work correctly with calls to Java Methods.
    1. If I use FindClass() to get a jclass reference to a named class, I get one number back. If I then instantiate this class, and then call GetObjectClass() with the instance, I get another number, **which doesnt appear to work for anything**. What is going on here? Can the JVM give different jclass numbers for the same class? Is GetObjectClass() supposed to work?
    2. Is AllocObject() alright for instantiating Java objects? It does seem to allocate memory, and method calls work to the new object. I am aware that it doesn't call a constructor, but I like that, seeing as the initialization is handled through a different [network-synchronized] means.
    3. Using a jclass retrieved using FindClass(), which I store in a global variable, I am able to call methods on an instance that I created in a certain function. I then make sure (?) that the GC can't reclaim the class or object memory by getting a NewGlobalReference to both of them [just to be safe]. However, in a later function, I am unable to call methods using my stored method IDs, ["Wrong Method ID....JVM has been asked to shut down this application in an unusual manner..."]. I am also unable to acquire new methodIDs, as the system returns 0xCCCCCCCC for all method ID queries. Obviously, attempting to use those bogus method IDs results in a JVM crash, in a segment called [2 deep in the untraceable depths of JVM.dll] from the JNI CallVoidMethodV() function. Why is this happening? Is the GC getting in there despite my best efforts? Is it illegal to cache methodIDs, jclass references or jobject references? aaarrggh! :)
    Thanks
    Chris Forbes
    Lead Programmer
    Sprocket Interactive
    [email protected]

    Hi Chris,
    I hit the same sort of problem, when writing a JVMDI ( VM debugger hook ), in C++.
    My question remained unanswered too
    http://forum.java.sun.com/thread.jsp?forum=47&thread=461503&tstart=30&trange=30
    I didn't try a call to NewGlobalRef, as you did... but it sounds like it could be what I was missing.
    I've a couple of ideas, but nothing definite for you.
    1) maybe there's more than one classloader, so that multiple copies of the class are loaded
    2) ensure you're compiling your DLL with "quad-word" ( 8 byte ) alignment.
    Otherwise all your JNI references will be misaligned !
    Since the JNI reference maps to a C++ pointer, it's possible that you can't cache any JNI references.
    That's my vague feeling on the subject.
    As a workaround, you may have to keep requesting any JNI references, eg. jclass & jmethod's, as you need them.
    regards,
    Owen

  • Rmi method call timeout

    i was wondering if there was any way to timeout a rmi method call.
    the situation i had was that a client would envoke an rmi method, and
    the method would deadlock in weblogic. the client making the call will
    hang forever.
    thanks

    Thank you for this enlightening addition. I regret I failed to perceive
    earlier that your comments were to be interpreted as evidence of sincere
    commitment to solving this problem.
    Regarding 7.0, you'll note that I described the timeout attribute solution
    as "improving stability" rather than as a complete cure. It should be borne
    bear in mind that this is an alternative to a completely locked system. When
    stress tested, this change did allow the application to recover and run for
    the rest of the day.
    I'm obliged to you for your concern regarding any liability I might be
    incurring in relation to the BEA licensing agreement. Fortunately I think I
    may be able to put your mind at rest on this matter relatively easily. If I
    may direct your attention to the BEA support site, my experience is that on
    entering the search terms "rmi descriptor timeout", the relevant information
    will be revealed. Also, I suspect that, as a fellow engineer, it has not
    escaped your attention that the RMI descriptor is a valid XML document. As
    such, it has a DTD named "rmi.dtd" which (alas) also fails to conceal this
    attribute.
    While we're pursuing what has now become a gratifyingly productive vein,
    let's offer another possible approach to this issue, namely the use of
    per-VM timeouts for socket calls. These were introduced in the Sun JDK 1.4.1
    and so are available to people running WebLogic 8.1 today. Again these
    suggestions have been tested for basic socket I/O (I haven't tried RMI). To
    my knowledge these are not endorsed by BEA:
    For client connections, timeouts can be set globally by passing the
    following startup parameters to the JVM:
    sun.net.client.defaultConnectTimeout (default: -1)
    sun.net.client.defaultReadTimeout (default: -1)
    sun.net.client.defaultConnectTimeout specifies the timeout (in milliseconds)
    to establish the connection to the host.
    sun.net.client.defaultReadTimeout specifies the timeout (in milliseconds)
    when reading from input stream when a connection is established to a
    resource.
    (reference: Sun's Networking Properties documentation at
    http://java.sun.com/j2se/1.4.1/docs/guide/net/properties.html )
    Supplying non-default values for these properties should allow a server to
    recover from a blocked downstream system if socket I/O is being used.
    Regards
    Alex
    On Fri, 30 Jan 2004 09:02:23 -0800, Andy Piper <[email protected]>
    wrote:
    Alex Thomas <[email protected]> writes:
    Hardly a constructive response to what is clearly a significant problem.
    First, it should be obvious that this issue will be encountered in any
    distributed system using T3 or RMI, not because of any shortcoming in
    WebLogic services but because of blocking behaviour in downstream systems.That's why it is a new feature in 9.0. I'm not arguing that the
    use-case is invalid, simply that your suggestion should not be tried.
    Second, the solution I proposed has been tested (on 7.0SP1) and does improve
    overall stability, as other people here have apparently discovered.Tested by who? Not by us because we know there are significant,
    dangerous, problems with the approach you describe. Support are
    under strict instructions not to offer this as a solution to
    anyone. If anyone in BEA told you, they shouldn't have. If you
    discovered it by decompiling the code then you are in violation of
    your license agreement.
    There is a supported mechanism for timing out connect attempts in 7.0
    and later which you can get through support, but for timing out RMI
    calls you will have to wait until 9.0 (or cook up a business case for
    a backport).
    Hope this clears things up.
    andy

  • Taskflow Method call receiving null parameter.

    Hi all,
    I am using 11.1.1.6. I have created in my application an extra project which is pure Java objects and exposed a master class as a POJO DC. In my application, I have a taskflow where I have dragged and dropped one method from my POJO DC - 2 of the parameters of this methods are coming from an application scope bean. I have debugged the application, and made sure that the object being returned by the getter of my app scope bean is not null. So basically, when the breakpoint is in the return statement of my getter the oject is not null and it has been correctly initialized. Just after that, the next breakpoint is in the class receiving the parameter in my POJO DC class. In there, the object is NULL.
    Does anyone knows wat could be the reason??

    Hi Frank Nimphius-Oracle,
    That is precisely the problem.  The object is being passed as to the taskflow as an input parameter (getting it from my application scope bean). If I access the pageFlowScope inside my taskflow I see it and its there, correctely intialized. However, when I call a method call activity that consumes that object as parameter, all what it gets is null.
    The method that consumes this object is in a separate project, and its exposed in a POJO DC. I don't know if it has to be with the complexity of the object I am passing or what but I don't understand why its not being passed correctly to the DC Method.

  • Error on /SafeMode: error while trying to run project uncaught exception thrown by method called

    i try run VS 2012 with /SafeMode. I create new empty Winform. When I start debug, I got:
    "error while trying to run project uncaught exception thrown by method called through reflection"

    Hi Matanya Zac,
    Did you restart your machine? How about installing the VS2012 update 4?
    >>error while trying to run project uncaught exception thrown by method
    Did you install the VS update in your VS IDE? I met this issue before which was related to the VS update:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/5ead8ee9-ea09-4060-88b0-ee2e2044ff82/error-while-trying-to-run-a-project-uncaught-exception-thrown-by-method-called-through-reflection?forum=vsdebug
    If still no help, I suggest you repair your VS, and then restart your machine, test the result.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • 14 weeks to get a phone line installed - £10 compe...

    I moved house on 28/07 and after a huge amount of problems with Orange and after managing to cancel my account with them I ordered BT Broadband and Evening & Weekend Calls on 07/08/12. I get 3 emails confirming my order, thanking me for choosing pape

  • Reading .txt file and non-english chars

    i added .txt files to my app for translations of text messages the problem is when i read the translations, non-english characters are read wrong on my Nokia. In Sun Wireless Toolkit it works. See the trouble is because I don't even know what is expe

  • Vendor address and account group

    Hi experts, could you tell me where can I find the vendor address and account group as well. So I need one table or transaction which contains all the data which I need. Thanks in advance.

  • Mac book air infected

    my mac book air is infected, getting frustrated how do i get rid of these dam pop ups?

  • PCL4 TABLE LOG FOR INFOTYPE 2001 IS NOT WORKING IN QUA 070 CLIENT

    Heloo, Could some one let me know the ways to capture the log of infotype 2001. I have used PCL4 table to capture all the changes made to INFTY 2001. This is working fine in DEV 070. But not working in QUA 070. Could someone let me know what is the p