Calling a method via invokeMethod (JDI)

Hi !
Does anybody know how to invoke a method
via the invokeMethod method of the Java Debug Interface (JDI).
This suspends the execution of the program !
I've read somewhere that the vm must be resumed,
but I don't see how, as a vm.resume() after the
invocation is never reached !
Thanx for any help !
Alex

I have the same problem ..Null pointer exception thrown. here is my sample code that I did:
public void methodExitEvent(MethodExitEvent event)
ObjectReference obj = objectReference(event);
if(obj!=null && !event.method().name().equals("<init>"))
System.out.println(" Leaving the method " + event.method().name() + "() Object " + obj.hashCode());
List objMethodsList= event.method().declaringType().methodsByName("methodA");
Method emptyState= (Method)objMethodsList.get(0);
//ClassType myClass= (ClassType)obj.referenceType();
//Method emptyState= myClass.concreteMethodByName("methodA","()V");
try
Value myValue= obj.invokeMethod(event.thread(), emptyState ,null,ObjectReference.INVOKE_SINGLE_THREADED);
catch(Exception e)
e.printStackTrace();
System.out.println("Error in invoking method "+e.getMessage());
else if(obj!=null && event.method().name().equals("<init>"))
System.out.println("Object " + obj.hashCode()+" END its life");
and here is the trace that i got from the exception thrown:
java.lang.NullPointerException
at com.sun.tools.jdi.MirrorImpl.validateMirrorsOrNulls(MirrorImpl.java:8
2)
at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImp
l.java:355)
at EventThread.methodExitEvent(EventThread.java:186)
at EventThread.handleEvent(EventThread.java:69)
at EventThread.run(EventThread.java:35)
Error in invoking method null
Need help ASAP especially those of you who have created debugger. Im trying to create a tracer and try to invoke the method of the debugee object....

Similar Messages

  • Calling a method via String representation of instance

    Is it possible to call a method of a specific (and already existing) instance of a class using a string representation of the instance?

    By "String representation of an instance," I simply mean a string that has the same format as a normal method call would have. So where a method would normally be called like this:
    ClassX itsInstance = new ClassX();
    itsInstance.methodX();
    The string representation would be:
    String instanceName = "itsInstance";
    And there would be some way of using this string to call the method referred to by instanceName.
    The idea here is that I want to use the existing instance, whereas using reflection, as below, would create a new instance:
    String className = "X";
    String methodName = "print";
    Class xClass = Class.forName(className);
    Method xMethod = xClass.getMethod(methodName,null);
    Object object = xClass.newInstance();
    xMethod.invoke(object,null);

  • How to get exit code from C code when calling java method via JNI?

    Hi, All
    in my project, i need to call a java method from C code using JNI, yet I do
    not know how to
    retrieve the exit code of java program. the java code is like below
    public static void main(....)
    if(error){
    System.exit(-77);// the exit code is -77
    and the JNI c code may like below
    /* Invoke main method. */
        (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
    //here I want to retrieve the exit code from java to check if there is an
    error
    any suggestions? thanks

    Hi Liang Zhang,
    In your C code add:
    void (JNICALL y_exit)(jint code) {
    and when you are initialazing JVM options add:
    JavaVMOption options[...];
    options[...].optionString = "exit";
    options[...].extraInfo    = y_exit;
    See http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html
    Best regards, Maksim Rashchynski.

  • Detecting static calls in methods via Class.forName(...)

    Hi!
    I'm trying to detect, if a method (or a contructor) of a Class object, loaded by Class.forName(...) contains a static call like System.out.println( "some text" );
    I need it to figure out if (in this case above) the class "System" is needed for running this example class.
    I don't have the source code (and don't want it anyway) to write a parser for it. I just want to extract this single information: Is there a method/contructor in the given class containing static calls by any other classes and what's the the of these classes?
    Anybody an idea?
    Thoto

    I'm trying to detect, if a method (or acontructor)
    of a Class object, loaded by Class.forName(...)
    contains a static call like System.out.println("some
    text" );BCEL should be able to do this.But I need to do that in my own program.
    System.out.println() is not a static method.That's right. If it's static or not doesn't really matter, it's just the information WHICH class is embedded into this call. It could also be a call like
    int i = Integer.MAX_VALUE.I just need (in that case) the informatation that the class "Integer" is needed to proceed that call.
    You can use javap to find this, or the BCEL library.I already did that with javap. But it's useless for me, I need it in my own program. I don't want to decompile some program. I have no illegal intentions in hacking or so. It's for my own programs, but I don't want to scan the source code.
    Unless this is homework, why would you want to know
    this information?That sounds, like you know the answer, but can't tell me, because it's the most important treasure in the world and THEY will kill you if you tell others... :-)
    No, it's not a homework and I don't want any source code from you, I'm a curious guy.

  • Call a static method via RFC

    Hello people,
    How can I call a static method via RFC?
    I am in SRM and would like to call a static method defined in ECC.
    What is necessary to be configured in this class/method?
    Thanks!!!

    You may need to write RFC in ECC and call it from SRM
    and write following code in RFC for call a static method
    reference_obj=>method_name
    EXPORTING

  • Calling a method in ABAP OO via -

    Hi,
    I've seen that there are two ways to call a method (correct me if I'm wrong):
    the first is by using CALL METHOD
    the second is by using object->method( )
    Whenever possible (ie. the parameters are only of Returning and Importing type) I prefer the second method a lot because it's more compact and Java-style.
    Now I've faced the problem of getting the value of a context attribute.
    Can you explain to me why this piece of code works:
      DATA lo_nd_view_settings TYPE REF TO if_wd_context_node.
      DATA lo_el_view_settings TYPE REF TO if_wd_context_element.
      lo_nd_view_settings = wd_context->get_child_node( name = wd_this->wdctx_view_settings ).
      lo_el_view_settings = lo_nd_view_settings->get_element( ).
    and this, instead, it doesn't work:
      DATA lo_nd_view_settings TYPE REF TO if_wd_context_node.
      lo_nd_view_settings = wd_context->get_child_node( name = wd_this->wdctx_view_settings )->get_element( ).
    I get this error:
    Web Dynpro Comp. / Intf. ZPM_TEST_ABAP_WDP,Web Dynpro View MAIN     11     @0A\QError@
    "= ..." expected after ")->GET_ELEMENT("          
    I mean, get_child_node returns an IF_WD_CONTEXT_NODE type object who has the method GET_ELEMENT.
    So why it doesn't work?
    Thank you,
    Pietro

    Hi Pietro,
    DATA lo_nd_view_settings TYPE REF TO if_wd_context_node.
      lo_nd_view_settings = wd_context->get_child_node( name = wd_this->wdctx_view_settings
    in above statements
    1st statement indicates , you are defining a node with name  lo_nd_view_settings  ( type ref to if_wd_ context_node ).
    2nd stement indicates, the node (lo_nd_view_settings) referred to node in your context.
    in simple node is nothing but internal table,
    now if you want to read first line of table,  u have to use ge_element () method.
    so element = lo_nd_view_settings->get_element ( ).
    here lo_nd_view_Settings refer to wd_context_node, it has a method, get_element. here it will return the values of view_settings node.
    get_element ( ). will return the values of type if_wd_context_element not context_node.
    Regards
    Srinivas
    Edited by: sanasrinivas on Dec 7, 2011 10:57 AM

  • AutomationException while calling a method

    Hi all,
    I've got a problem accessing a COM/DCOM component in a Win2k box (Advanced Server)
    with jcom. I configured the server and client described in the "JSP to COM" example.
    The only difference: I don't want to access the excel sheet and I don't use a jsp
    to execute.
    I used the java2com.exe to create the proxies from my dll ScriptableUniversalTransAgt.dll.
    But when I try to call a method on the dll via Java, I get the exception:
    AutomationException: 0x80070005 - General access denied error in 'Invoke'
         at com.bea.jcom.Rpc.a(Rpc.java)
         at com.bea.jcom.be.a(be.java)
         at com.bea.jcom.StdObjRef.a(StdObjRef.java)
         at com.bea.jcom.Dispatch.vtblInvoke(Dispatch.java)
         at de.conet.galileo.suta.IScriptableUniversalTransAgentProxy.setHcmName(IScriptableUniversalTransAgentProxy.java:271)
         at de.conet.galileo.suta.ScriptableUniversalTransAgent.setHcmName(ScriptableUniversalTransAgent.java:336)
         at de.conet.galileo.SUTATest.start(SUTATest.java:33)
         at de.conet.galileo.SUTATest.main(SUTATest.java:27)
    I checked everything on the server, the user has all rights he needs but it doesn't
    work. In the eventlog of the server I can see that the login was successful.
    The attachment contains some log files and my program with the dll.
    Maybe someone can help me?
    Thanks
    Michael
    [src.zip]

    "Jeff Muller" <[email protected]> wrote in message
    news:[email protected]...
    Yeah, now I'm getting this error on code that worked two days ago.
    javax.servlet.ServletException: Unable to initialize servlet:
    AutomationExceptio
    n: 0x80070005 - General access denied error, status: Getting instance, and
    calli
    ng initialize.
    at com.teloquent.MyApp.MyServlet.initCOMObj(MyServlet.
    java:308)
    at com.teloquent.MyApp.MyServlet.init(MyServlet.java:8
    1)
    at
    weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
    pl.java:700)
    at
    weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
    Impl.java:643)
    at
    weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:588)
    at
    weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:368)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:242)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    ... but then again, I don't expect any response here.
    "Michael" <[email protected]> wrote in message
    news:[email protected]...
    Hi all,
    I've got a problem accessing a COM/DCOM component in a Win2k box
    (Advanced
    Server)
    with jcom. I configured the server and client described in the "JSP toCOM" example.
    The only difference: I don't want to access the excel sheet and I don'tuse a jsp
    to execute.
    I used the java2com.exe to create the proxies from my dllScriptableUniversalTransAgt.dll.
    But when I try to call a method on the dll via Java, I get the
    exception:
    >>
    AutomationException: 0x80070005 - General access denied error in'Invoke'
    at com.bea.jcom.Rpc.a(Rpc.java)
    at com.bea.jcom.be.a(be.java)
    at com.bea.jcom.StdObjRef.a(StdObjRef.java)
    at com.bea.jcom.Dispatch.vtblInvoke(Dispatch.java)
    atde.conet.galileo.suta.IScriptableUniversalTransAgentProxy.setHcmName(IScript
    ableUniversalTransAgentProxy.java:271)
    at
    de.conet.galileo.suta.ScriptableUniversalTransAgent.setHcmName(ScriptableUni
    versalTransAgent.java:336)
    at de.conet.galileo.SUTATest.start(SUTATest.java:33)
    at de.conet.galileo.SUTATest.main(SUTATest.java:27)
    I checked everything on the server, the user has all rights he needs butit doesn't
    work. In the eventlog of the server I can see that the login wassuccessful.
    The attachment contains some log files and my program with the dll.
    Maybe someone can help me?
    Thanks
    Michael

  • LVOOP "call parent method" doesn't work when used in sibling VI

    It seems to me that the "call parent method" doesn't work properly according to the description given in the LabVIEW help.
    I have two basic OOP functions I am doing examples for. I can get one to work easily and the other one is impossible.
    Background
    There are 3 basic situations in which you could use the "call parent method"
    You are calling the parent VI (or method) of a child VI from within the child VI
    You are calling the parent VI (or method) of a child VI from within a sibling VI
    You are calling the parent VI (or method) of a child VI from a different class/object.
    From the LabVIEW help system for "call parent method":
    Calls the nearest ancestor implementation of a class method. You can use the Call Parent Method node only on the block diagram of a member VI that belongs to a class that inherits member VIs from an ancestor class. The child member VI must be a dynamic dispatching member VI and have the same name as the ancestor member VI
    From my reading of that it means situation 3 is not supported but 1 & 2 should be.
    Unfortunately only Situation 1 works in LabVIEW 2012.
    Here is what I want
    And this is what I actually get
    What this means is that I can perform a classic "Extend Method" where a child VI will use the parent's implementation to augment it's functions BUT I cannot perform a "Revert Method" where I call the parent method's implementation rather than the one that belongs to the object.
    If you want a picture
    Any time I try and make operation2 the VI with the "call parent method" it shows up for about 1/2 sec and then turns into operation.
    So there are only 3 possibilities I can see
    Bug
    Neither situation 2 or 3 are intended to work (see above) and the help is misleading
    I just don't know what I am doing (and I am willing to accept this if someone can explain it to me)
    The downside is that if situation 2 above doesn't work it does make the "call parent node" much less usefull AND it's usage/application just doesn't make sense. You cannot just drop the "call parent node" on a diagram, it only works if you have an existing VI and you perform a replace. If you can only perform situation 1 (see above) then you should just drop the "call parent node" and it picks up the correct VI as there is only 1 option. Basically if situation 2 is not intended to work then the way you apply "call parent method" doesn't make sense.
    Attachements:
    For the really keen I have included 2 zip files
    One is the "Revert Method labVIEW project" which is of course not working properly because it wants to "call parent method" on operation not operation2
    The other zip file is all pictures with a PIN for both "Revert Method" and "Extend Method" so you can see the subtle but important differences and pictrures of the relavant block diagrams including what NI suggested to me as the original fix for this problem but wasn't (they were suggesting I implement Extend Method).
     If you are wondering where I got the names, concepts and PIN diagrams from see:
    Elemental Design Patterns
    By: Jason McColm Smith
    Publisher: Addison-Wesley Professional
    Pub. Date: March 28, 2012
    Print ISBN-10: 0-321-71192-0
    Print ISBN-13: 978-0-321-71192-2
    Web ISBN-10: 0-321-71255-2
    Web ISBN-13: 978-0-321-71255-4
     All the best
    David
    Attachments:
    Call parent node fault.zip ‏356 KB
    Call parent node fault.zip ‏356 KB

    Hi tst,
    Thankyou for your reply. Can you have a look at my comments below on the points you make.
    1) Have to disagree on that one. The help is unfortunately not clear. The part you quote in your reply only indicates that the VI you are applying "Call Parent Node" to must be dynamic dispatch. There is nowhere in the help it actually states that the call parent node applies to the VI of the block diagram it is placed into. Basically case 2 in my example fulfills all that the help file requires of it. The dynamic dispatch VI's operation are part of a class that inherits from a given ancestor. Operation 2 for Reverted behaviour is a child VI that is dynamic dispatch and has the same name as the ancestor VI (operation2). The help is missing one important piece of information and should be corrected.
    2) True it does work this way. I was trying to build case 2 and had not yet built my ancestor DD for operation so the function dropped but wasn't associated with any VI. I was able to do this via a replace (obviously once the ancestor Vi was built) so this one is just bad operator
    3) Keep in mind this is an example not my end goal. I have a child implementation because this is a case where I am trying to do a "reverse override" if you like.
    3a) The point of the example is to override an objects method (operation2) with it's parent's method NOT it's own. The reason there is a child implementation with specific code is to prove that the parent method is called not the one that relates to the object (child's VI). If I start having to put case structures into the child VI I make the child VI have to determine which code to execute. The point of Revert method is to take this function out of the method that is doing the work. (Single Use Principal and encapsulation)
    3b) The VI I am calling is a Dynamic Dispatch VI. That means if I drop the superclass's VI onto the child's block diagram it will become the child's implementation. Basically I can't use Dynamic Dispatch in this case at all. It would have to be static. That then means I have to put in additional logic unless there is some way to force a VI to use a particular version of a DD VI (which I can't seem to find).
    Additional Background
    One of the uses for "Revert Method" is in versioning.
    I have a parent Version1 implementation of something and a child Version2. The child uses Version2 BUT if it fails the error trapping performs a call to Version1.
    LabVIEW has the possibility of handling the scenario but only if both Case 1 and Case 2 work. It would actually be more useful if all 3 cases worked.
    The advantage of the call parent method moving one up the tree means I don't have the track what my current object is and choose from a possible list, if, for example the hierarchy is maybe 5 levels deep. (so V4 calls V3 with a simple application of "call parent method" rather than doing additional plumbing with case structures that require care and feeding). Basically the sort of thing OOP is meant to help reduce. Anything that doesn't allow case 2 or 3 means you have to work around the limitation from a software design perspective.
    If at the end of the day Case 2 and case 3 don't and won't ever work then the help file entry needs to be fixed.
    All the best
    David

  • Trying to call a method on an RMI server from a GUI

    Hi all, I'm new to the forums and I desperately need some help!
    My question fits into the RMI category but also the database/GUI side so sorry if this is posted in the wrong place.
    My application is a client/server system (programmed in Netbeans 6.8) that also uses GUIs and JDBC-ODBC. Basically, I am trying to call a method that adds an entry to my database from a GUI button.
    Due to the required RMI, I have the ServerInterface that extends Remote and I have a ServerImpl class that implements the Interface, and the RMI works fine so there is no problem there.
    My code for the button is:
    private void addUserActionPerformed(java.awt.event.ActionEvent evt) {                                       
    try{server.addNewUser("new");}
    catch(Exception e){}
    addUser.setText("buttonhaschanged");
    The server variable is declared above as ServerImpl server;
    The actual addNewUser method works fine when it is called explicitly via RMI in my main "Client" class, but this GUI is going to be like an "administrator GUI" that can manipulate the database, so there is no RMI involved here.
    Anyway, my button doesn't have any effect on the database, but the button changes text as desired so the button itself works, but it doesn't do what I want to the database, so I think my problem is the use of my "server" variable. I've tried making it static and I've tried making it of type ServerInterface, but no luck. Would I have to make the GUI class extend the interface too?
    Sorry for rambling on!
    Many thanks in advance
    David
    Edited by: DHD on Feb 26, 2010 6:15 AM

    Would I have to make the GUI class extend the interface too?Your GUI has nothing to do with the RMI. How did you obtaint the "server" ? have you looked in the RMI registry to get the stub object ?
    The second thing to notice is you are invoking a RMI calls on a EDT which you should not do it. Your RMI method calls should be invoked via SwingWorker-->doInBackground(); please take a look at the Java Doc
    [http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html|java Doc SwingWorker sample usage]
    You mentioned that the RMI method invocation works fine from the main class and not from the GUI so what did you do in the main class to get the stub do it in the doInBackground() method
    Regards,
    Alan
    London

  • Calling a method in acrobat plugin as COM obj method

    Hi all,
    I want to call a method from my acrobat plugin as a COM objects method. Can i import i.e. add reference of plugin and call the perticular method which accepts two PDDoc parameters. For this I can use any platform (JS, C#, VB.net or anything). Please help me out.

    Consider I have exported the below plugin method via COM as Irosenth mentioned above, will I be able to see the highlighting happening visually in the PDF document which is currently active when I call this COM method from my C# Winform application?
    Also consider I have the Adobe Reader plugin license, will this functionality work in Reader?
    static ACCB1 void ACCB2 HighlightWord(void *data)
        DURING
        //Create a HiliteEntry object and set its attributes
        HiliteEntry hilite;
        hilite.offset = 3;
        hilite.length = 1;
         //Get the page number of the current page view
        AVDoc currentAVDoc = AVAppGetActiveDoc();
        PDDoc currentPDDoc = AVDocGetPDDoc(currentAVDoc);
        AVPageView currentPageView = AVDocGetPageView(currentAVDoc);
        ASInt32 pageNum = AVPageViewGetPageNum(currentPageView);
        //Highlight the tenth word
        PDPage pdPage = PDDocAcquirePage (currentPDDoc, pageNum);
        PDTextSelect textSelection = PDTextSelectCreateWordHilite(pdPage, &hilite, 1);
        AVDocSetSelection(currentAVDoc, ASAtomFromString("Text"), (void *)textSelection, true);
        AVDocShowSelection (currentAVDoc);
        PDPageRelease (pdPage);
        HANDLER
            AVAlertNote("Error highlighting word");
        END_HANDLER

  • Simple enough but... calling a method from another class

    Hi all,
    I know it's simple enough, although I can't see where I'm going wrong for some reason. Basically I've got a class which extends JPanel but when I try to call one of its methods from my main class I get an error. The relevant code (I hope) is:
    Main.java
    import java.awt.BorderLayout;
    import javax.swing.UIManager;
    public class Main extends JFrame implements ActionListener {
         JFrame frame;
         public static JPanel statusBar;
         public Main() {
              // Add a status bar
              statusBar = new StatusBar();
              mainPanel.add( statusBar, BorderLayout.SOUTH );
              setContentPane( mainPanel );
         public static void setStatusBarText( String s ) {
              statusBar.setStatusText("Test");
    StatusBar.java
    import java.awt.Color;
    import javax.swing.SwingConstants;
    public class StatusBar extends JPanel {
         private int barWidth;
         private static JLabel status;
         public StatusBar() {
              super();
              //barWidth = Main.getProgramWidth();
              //setPreferredSize( new Dimension(barWidth,22) );
              setLayout( new FlowLayout( FlowLayout.LEADING ) );
              setBorder( BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(160,160,160) ) );
              status = new JLabel("Test", SwingConstants.LEFT);
              //status.setVerticalAlignment( SwingConstants.CENTER );
              add( status );
         protected void setStatusText( String s ) {
              status.setText( s );
              revalidate();
    }The "statusBar.setStatusText("Test");" call in the main class file doesn't work and I get the error:
    >
    cannot find symbol
    symbol : method setStatusText(java.lang.String)
    location: class javax.swing.JPanel
    statusBar.setStatusText("Test");
    >
    Any ideas what I'm doing wrong? I created an instance of the StatusBar class called statusBar, then I use this to call the setStatusText() method (via statusBar.setStatusText()) which I thought was all correct, then it doesn't work? Even if there's an easier way to do what I want to achieve (i.e. update a JLabel from the 'central' main class file instead of setting the JLabel to static and having every class call it directly), I'd appreciate knowing where I'm going wrong here nonetheless.
    Many thanks,
    Tristan

         public static JPanel statusBar;
         public static void setStatusBarText( String s ) {
              statusBar.setStatusText("Test");
    >
    cannot find symbol
    symbol : method setStatusText(java.lang.String)
    location: class javax.swing.JPanel
    statusBar.setStatusText("Test");
    >The type of variable statusBar is JPanel. That's all the compiler takes into account. It's irrelevant that at some point in the program the type of the object pointed to by this variable is a subclass of JPanel (because at another point it might be an instance of another subclass, or of JPanel itself.

  • Calling a Method in a Parent Class

    I have Class A that instantiates Class B which in turn instantiates Class C. Is there a way to call a method in Class A from Class C without having to pass a reference of A all the way down to C? Is there thread stack information that I can access that will allow me to get Class A's 'handle'?

    tpaulsz wrote:
    The OP is not confusing instantiates with inherits.
    Class A is class that's exposing web service methods.
    Class B represents a group of business rule classes.
    Class C is transaction handler class that is responsible for checking out connections from a db connections pool.
    The web services all require user information, for auth and auth purposes, and they've not been required outside of Class A - until now. I now have to provide RLS on the database information so I need the user information for the Oracle Proxy User connection property.
    This is a very mature application with many Class A and Class B classes so passing the user information from class to class would be a big job. Furthermore, there are some non-user processes that will also be calling on Class C that don't need RLS. Since the StackElements are available through Thread.currentThread().getStackTrace(), I was hoping that there was another stack that I could traverse to eventually find a Class A class that's been set up with an with interface that has a getUserInfo method.Any you wanted to extract the user info for every single database operation even when a single business rule calls more than one?
    Or when a single web service operation calls more than one business rule?
    If you don't do that then how did you plan on letting method B know that method A has already done it?
    You might be able to stick the data in a ThreadLocal if there is in fact only one thread of execution.
    Myself I always considered attempting to manage web users of a business application via a a database or OS authentication to be more trouble than it was worth.

  • Calling a method in Parent component from Title Window

    Hi all,
    I have a parent component that opens up a Title window when I
    click a button. Now I want to call a method in that parent
    component from the Title window. How do I do this in Flex? Could
    anyone give me a hint please.
    Thank you in advance for the help

    "happybrowndog" <[email protected]> wrote in
    message
    news:gctmql$4t5$[email protected]..
    > That's goddamned ridiculous. What were Flex developers
    thinking that you
    > have
    > to write a custom event to call back to a parent
    component?? Other GUI
    > libraries such as WxWidgets, Fox, Qt, Delphi, MFC,
    WinForms, etc., all
    > allow
    > you to either call via a reference to the parent object
    or submit a
    > callback
    > function into the child object. That's just basic OO
    programming. Flex
    > is
    > looking more and more ridiculous and more like Swing -
    tons of unnecessary
    > coding to do simple things.
    You absolutely _do_ have the capability to pass in a
    reference to the parent
    component, or to create a "hard" reference to
    Application.application. But
    these are not recommended practices, because anything you
    create this way is
    then tied to an environment that implements those properties
    and methods.
    Q (3): I want to run a function in my main application from
    inside my
    custom component. But when I try to refer to myFunction() in
    that
    component, I get a compile time error Call to a possibly
    undefined function
    myFunction. How can I fix this?
    A: Your component has its own scope, so it doesn't know
    anything
    about the functions in the main file. You can get around this
    by directly
    referencing the main application scope like this:
    Application.application.myFunction(). However, this makes
    your component
    tightly coupled, which is a quick way of saying that your
    component is only
    usable in an application that has a myFunction() function in
    it. You're
    better off dispatching an event from your component and
    letting the
    application decide how to handle it. For more information,
    check out the
    following resources:
    http://www.adobe.com/devnet/flex/articles/loose_coupling.html
    http://www.adobe.com/devnet/flex/articles/graduating_pt1.html
    From
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

  • Problem calling Java method from JavaScript in JSP / ADF

    Hi all,
    In my JavaScript onMouseUp() function, I need to call a method on my Java backing bean. How is this done? Info on the web indicates a static Java method can be called by simply "package.class.staticMethod(...)". but when I put the statement
    "jsf.backing.GlobalRetriever.createBasemap(affectedLayer);"
    I get an error message "jsf is undefined".
    The functionality I'm trying to get is: I have a custom slider control and based on its value, I want to call oracle map viewer specifying a map extent of the (current extent / slider value) to do a zoom in/out. In addition, the slider uses a onMouseMove() function to change the size of the image display so it looks like a dynamic zoom in/out.
    Please assist or let me know if I can provide some additional information. Thanks in advance.
    Jim Greetham

    No. The Java and Javascript in a Faces application are really working in two different universes.
    Java is running on the server. It generates HTML (and sometimes even Javascript) and sends that to the client machine. That's where all your backing beans are.
    Javascript runs directly in the browser. There's no way anything on the server can have access to anything you define in Javascript, unless you explicitly send that information back to the server, either via standard form submission (which only works when someone presses a "Submit" button) or via an Ajax-type call. So otherwise, nothing you define in Javascript will ever be available to a backing bean.

  • SQL Call - Static Method

    Hello All:
    I am trying to run a sample code from the Oracle8i doc 'Hello
    World'. The program compiled and used 'loadjava' to load to the
    database.
    When I tried to create SQL Call Function from SQL*Plus, I am
    getting the error:
    PLS-00103: Encountered the symbol "MYSTRING"
    This is the sample code trying to run from SQL*Plus:
    create or replace function HELLOWORLD return VARCHAR2 as
    language java name 'Hello.world() return java.lang.String';
    myString varchar2;
    call HELLOWORLD() into :myString;
    print myString;
    Any help is appreciated.
    Thanks,
    Krishna.
    null

    Technically, you cannot call a method in the background mode, however you can call its content in the background, just transfer the content of the method to a parameterised report-type program and use SUBMIT VIA JOB statement.
    class=>run_in_background( parameters ... ).
    METHOD run_in_background.
      SUBMIT zrun_in_background ... VIA JOB...
    ENDMETHOD.

Maybe you are looking for

  • What is the keyboard shortcut for format painting in word please?

    what is the keyboard shortcut for format painting in word please?

  • UDP DatagramPacket sent between C (client) and Java (server)

    Hi, I have a problem sending a struct from C to Java UDP server. In the C (client) program, the struct is defined as typedef strurct dataType_s { char name[52]; char add[52]; long x; long y; } dataType; dataType data; strcpy(data.name, "sun"); strcpy

  • Issue with SAP Integration Kit 3.0 to access Query BW on Crystal Reports

    Hi All, I've got an problem with my setup of Crystal Reports Server 2008. I've install Crystal Reports Server 2008 and Crystal Reports 2008 on my Windows 2003 server. My SAP Client is 7.1. When i trie to connect my Reports on CR 2008, the connection

  • Adobe Reader 8 with older Celeron processor

    I have a 5 year old laptop with Celeron 1.1GHz & 128 KB cache. Adobe 8 requirements specify Pentium III all of which have 256 KB cache. Some Pentium IIIs are slower - 433 MHz than my Celeron. Should I try installing Adobe Reader 8 or stick with Adobe

  • Flowing Images

    Does anyone know how to make images flow like text? Is there any software that will easily allow us to put images in a specific order without having to copy and paste all of the images. We are looking to create a "Trader" type publication that lists