Call the method of a ejb??

hi!
I get EJB refrence ,How can I call the method of it?(I use the stand-alone application client)
code:
import javax.naming.*;
//import javax.naming.InitialContext;
import javax.rmi.*;
import java.util.*;
//import hello.*;
public class jndi {
public static void main(String[] args) {
try {     
Hashtable env = new Hashtable();
     env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:3000");
     Context initctx = new InitialContext(env);
     Object objref = initctx.lookup("HelloEJB");
the method I want to call
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
Because it is the stand-alone .I can not to convert the objref:
HelloHome helloHome =(HelloHome)objref;
what can I do???

It still can work.
Tere is a ClassCastException.
And the the class name of the objref is "com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1".
but my EJB is named HelloEJB.
Is the object which I want to call????

Similar Messages

  • How can we call the method of used controller?

    Hi All,
       i created two WDA Applications.( like YWDA1,YWDA2 ) . i am using the component WDA2 in WDA 1.and displaying the one view of WDA2 as popup window in WDA1 on action of one of the input element in the view of WDA1 by using the method l_window_manager->create_window_for_cmp_usage
    I have a button on the view of WDA2 which has appear in the popup window...how can i call the method which has binded to that button....and where should i code that...and i need to assign selected value in the popup window to input elemetn of view  WDA1
    Please help me to resolve this....
    Regards,
    Ravi

    You can not directly call view's event handler from other component.
    create a method in component controller of the second component and in the button click call the component controller method. ( also make the method as interface so that you can call it from other components )
    Now, you can call the interfacecontroller's method
    DATA: l_ref_INTERFACECONTROLLER TYPE REF TO ZIWCI__VSTX_REBATE_REQ_WD .
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_<comp usage name>( ).
      l_ref_INTERFACECONTROLLER->Save_Rr(
        STATUS = '01'                       " Zvstxrrstatus
    save_rr is the method of second component controller

  • Display which method called the method (gives you a headache doesn't it)

    Hi,
    This question might sound a little weird, so maybe read it twice:
    I would like to see which method called the method.
    public void test1()
       test2();
    public void test2()
       System.out.println(....);
    The program output should be, test1 or classname.test1 or something like that. Is that possible?
    Thanx in advance, Yvo van Beek

    This should give you an idea:   public static void main (String args[]) {
          wereAreWe();
          caller2();
        public static void wereAreWe() {
          try {
            throw new RuntimeException("here we are");
          catch (Exception ex) {
            System.out.println("");       
            ex.printStackTrace(System.out);
        public static void caller1() {
          wereAreWe();
        public static void caller2() {
          caller1();
        }You can parse the result of printStackTrace() to get a more precise output.

  • How to call the method of a Business Object?

    Hi,
    Can someone guide me how to call the method of a business object?
    For example, I want to use the method SalesDocument.Copy of the Business Object VBAK. How can I do that? If you are familiar with any similar scenario please help.
    Regards,
    Renjith Michael.

    Hi
    double click on the copy  and
    go to abap tab
    there u can get functionmodule name
    u can call that
    Rewards if helpful

  • How to call the methods of JAR file into webDynpro Environment

    Hi All ,
             I have a requirement to call the methods of a JAR file into
             WebDynpro Environment. can anybody suggest me How this can be achieved. I Have a JAR file named FastTrack.API
    which contains few methods and i want these methods to be accessable into WebDynpro as other methods.
    Plz Somebody help me to sort this out.
    Regards,
    Deepak.

    Deepak,
    Please follow these 2 steps:
    1. Add jar into webdynpro project
            Right Click on ur project -> Select properties -> Java Buil path -> Choose Libraries Tab -> Add External Jars -> add the file from ur computer
    2. Use the jar
          write the import statement in your webdynpro code to utilize the properties of added jar.
    Thanks & Regards,
    Ram

  • What class calls the method?

    If there is a method in a class that could be called by any one of, lets say, one hundred other classes, in that method is there a way of printing out the name of the class that called it ?
    So if class Xyz calls the method I would like to just do a println in the method saying that class Xyz called it ?

    Yup... Thread.currentThread().getStackTrace();
    package krc.utilz;
    import java.io.PrintStream;
    public class Tracer
      public static PrintStream out = null;
      public boolean enabled = true;
      public enum Format { LONG, SHORT }
      public Format format;
      public Tracer() {
        this(System.err, Tracer.Format.LONG);
      public Tracer(PrintStream out) {
        this(out, Tracer.Format.LONG);
      public Tracer(Format format) {
        this(System.err, format);
      public Tracer(PrintStream out, Format format) {
        this.out = out;
        this.format = format;
      public String toString() {
        return get(5);
      public String get() {
        return get(2);
      public String get(int i) {
        StackTraceElement[] st = Thread.currentThread().getStackTrace();
        if (i>=st.length) i = st.length-1; //don't go past top of stack
        StackTraceElement t = st;
    String s = t.getFileName()+":"+t.getLineNumber()+":";
    if (this.format == Format.LONG) {
    s += t.getClassName()+"."+t.getMethodName();
    return(s);
    public void debug(String msg) {
    if(!enabled)return;
    out.println("DEBUG: "+msg);
    public void print(String msg) {
    if(!enabled)return;
    if (out==null) return;
    out.println(get(3)+" : "+msg);
    public void print() {
    if(!enabled)return;
    if (out==null) return;
    out.println(get(3));
    public void print(int i) {
    if(!enabled)return;
    if (out==null) return;
    out.println(get(i));
    public static String getCurrentMethodName() {
    StackTraceElement[] st = Thread.currentThread().getStackTrace();
    return(st[2].getMethodName());

  • Calling the method deployJava.installJRE("1.6*") always installs JRE7

    The call to deployJava.installJRE(verison, callback) in deployjava.js
    seems to ignore the version when we supply *"1.6*"* as a version and always installs the latest java 7.
    This happens if we had npdeployJava1.dll version 10.3.0.5 from Java7 still on the machine after uninstalling java7.
    Any ideas how to make it respect the version requested?
    note: deployjava.js is the deployment toolkit javascript that came before dtjava.js
    Edited by: bali on 05-Apr-2012 13:36
    Edited by: bali on 05-Apr-2012 13:37

    Only with The dt toolkit installed can deployJava install specific versions or families. The javascript will default, if no dt plugin is available to calling java.com to install the latest secure version available.
    After that, the dt plugin, deploy1ava1.dll, or npdeployJava1.dll should be available for IE and Firefox type browsers, and if not specifically disabled in the browser, you should be able to do this specif installation.
    My testing shows with JRE 8 or JRE 7, or some earlier JRE 6 version already installed, calling the method deployJava.installJRE("1.6*") currently installs 1.6.0_31.
    /Andy

  • Which object called the method

    Suppose there is a class A which has three objects a1,a2,a3 and a method m. Now I'd like to know which particular object has called the method m.

    >
    which particular object has called the method
    What class called my method
    http://developer.java.sun.com/developer/qow/archive/104
    a.The advice in the posted link is unreliable as the format of printStackTrace() is not standardized. A more reliable way to find out the calling class is to use SecurityManager.getClassContext() or Throwable.getStackTrace() [in JDK 1.4+].
    However, it is not clear whether the original poster wanted to know the calling class or the calling object. In the latter case there is no easy way except for modify the signature of method m to accept the reference to the calling object.
    Vlad.

  • Error while calling a method on Bean (EJB 3.0)

    I am getting an error while calling a method on EJB. I am using EJB3.0 and my bean is getting properly deployed(i am sure b'cos i can see the successfullly deployed message). Can any body help me
    Error is -->
    Error while destroying resource :An I/O error has occured while flushing the output - Exception: java.io.IOException: An established connection was aborted by the software in your host machine
    Stack Trace:
    java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
    at sun.nio.ch.IOUtil.write(IOUtil.java:75)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:302)
    at com.sun.enterprise.server.ss.provider.ASOutputStream.write(ASOutputStream.java:138)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
    at org.postgresql.PG_Stream.flush(PG_Stream.java:352)
    at org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159)
    at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
    at org.postgresql.jdbc1.AbstractJdbc1Connection.rollback(AbstractJdbc1Connection.java:1031)
    at org.postgresql.jdbc2.optional.PooledConnectionImpl$ConnectionHandler.invoke(PooledConnectionImpl.java:223)
    at $Proxy34.close(Unknown Source)
    at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:274)
    at com.sun.enterprise.resource.LocalTxConnectorAllocator.destroyResource(LocalTxConnectorAllocator.java:103)
    at com.sun.enterprise.resource.AbstractResourcePool.destroyResource(AbstractResourcePool.java:603)
    at com.sun.enterprise.resource.AbstractResourcePool.resourceErrorOccurred(AbstractResourcePool.java:713)
    at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:424)
    at com.sun.enterprise.resource.PoolManagerImpl.resourceClosed(PoolManagerImpl.java:393)
    at com.sun.enterprise.resource.LocalTxConnectionEventListener.connectionClosed(LocalTxConnectionEventListener.java:69)
    at com.sun.gjc.spi.ManagedConnection.connectionClosed(ManagedConnection.java:618)
    at com.sun.gjc.spi.ConnectionHolder.close(ConnectionHolder.java:163)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeDatasourceConnection(DatabaseAccessor.java:379)
    at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.closeConnection(DatasourceAccessor.java:367)
    at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.closeConnection(DatabaseAccessor.java:402)
    at oracle.toplink.essentials.internal.databaseaccess.DatasourceAccessor.afterJTSTransaction(DatasourceAccessor.java:100)
    at oracle.toplink.essentials.threetier.ClientSession.afterTransaction(ClientSession.java:104)
    at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.afterTransaction(UnitOfWorkImpl.java:1816)
    at oracle.toplink.essentials.transaction.AbstractSynchronizationListener.afterCompletion(AbstractSynchronizationListener.java:161)
    at oracle.toplink.essentials.transaction.JTASynchronizationListener.afterCompletion(JTASynchronizationListener.java:87)
    at com.sun.ejb.containers.ContainerSynchronization.afterCompletion(ContainerSynchronization.java:174)
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:467)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
    at $Proxy84.addDepartment(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    End of Stack Trace
    |#]
    RAR5035:Unexpected exception while destroying resource. To get exception stack, please change log level to FINE.
    EJB5018: An exception was thrown during an ejb invocation on [DepartmentSessionBean]
    javax.ejb.EJBException: Unable to complete container-managed transaction.; nested exception is: javax.transaction.SystemException
    javax.transaction.SystemException
    at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:452)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:357)
    at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3653)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
    at $Proxy84.addDepartment(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    Means theres an error in XML/ABAP conversion probably due a syntax error...
    Regards
    Juan

  • Getting an error when calling the method of the bean

    Hi,
    I have the following problem:
    From my action class I'm calling a method on EJB through Business Object and getting the following error:
    org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class gov.nyc.fisa.wbas.exceptions.ServerException
    [3/6/08 13:53:44:700 EST] 1acdd938 WebGroup E SRVE0026E: [Servlet Error]-[SERVER EXCEPTION CALLING searchBenefitGroups() METHOD ]: gov.nyc.fisa.wbas.exceptions.ServerException: SERVER EXCEPTION CALLING searchBenefitGroups() METHOD
    The following are parts of my code:
    In Action Class:
    BenefitGroupBO bo = new BenefitGroupBO();
    BenefitGroupsColView cView = new BenefitGroupsColView();
    try{
        cView = bo.searchBenefitGroups(transferObject,true);
    catch (ServerException e){
        throw new ServerException("SERVER EXCEPTION CALLING searchFunds() METHOD ",e);
    In Business Object:
    private BenefitGroupImpl benGrpImpl = null;
        try{
               System.out.println("1. BenefitGroupBO - searchBenefitGroups()");
               collectionView = benGrpImpl.searchBenefitGroups(transferObject, isSearch);
               System.out.println("2. BenefitGroupBO - searchBenefitGroups()");
    catch (RemoteException e){
                throw new ServerException("Remote exception calling BenefitGroupImplBean: searchBenefitGroups()", e);
    .....It never executes the second print statement in the method
    In Remote Interface:
    public BenefitGroupsColView searchBenefitGroups(BenefitGroupVO transferObject, boolean isSearch)
                                                                           throws ServerException, java.rmi.RemoteException;
    In the EJB
    public BenefitGroupsColView searchBenefitGroups(BenefitGroupVO transferObject, boolean isSearch){
                                                                        throws ServerException                
             System.out.println("1. BenefitGroupImplBean - searchBenefitsGroups() method");
             BenefitGroupsColView collectionView = new BenefitGroupsColView();
             System.out.println("2. BenefitGroupImplBean - searchBenefitsGroups() method");
              return collectionView;
    .....It never executes first Print statement in that method and I do not think it ever goes into the actual EJB class.
    Can anyone tell me what am I doing wrong?
    Thank you
    Edited by: SolutionsQuest on Mar 6, 2008 11:14 AM
    Edited by: SolutionsQuest on Mar 6, 2008 11:15 AM

    Hi,
    Refer below threads:
    You are trying to access a page that is no longer active
    You are trying to access a page that is no longer active.
    You are trying to access a page that is no longer active.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How do i call the method in a class using servlet

    i am doing a project which need to use servlet to call a few methods in a class and display those method on the broswer. i tried to write the servlet myself but there are still some errors .. can anyone help:
    The servlet i wrote :
    package qm.minipas;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class test extends HttpServlet {
    Database database;
    /** Initializes the servlet.
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    database = FlatfileDatabase.getInstance();
    /** Destroys the servlet.
    public void destroy() {
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    response.setContentType("text/html");
    java.io.PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("this is my class wossname"+FlatfileDatabase.getInstance()); // this is calling the toString() method in the instance of myJavaClass
    out.println("this is my method"+FlatfileDatabase.getAll());
    out.println("</body>");
    out.println("</html>");
    out.close();
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    my methods which i need to call are shown below:
    public Collection getAll() {
    return Collections.unmodifiableCollection(patientRecords);
    public Collection getInpatients() {
    Collection selection=new ArrayList();
    synchronized(patientRecords) {
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(next.isInpatient())
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByAdmissionDate(Date dateOfAdmission) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(dateOfAdmission.equals(next.getDateOfAdmission()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByAdmissionDates(Date from,Date to)
    throws IllegalArgumentException {
    if(to.before(from))
    throw new IllegalArgumentException("End date must not be before start date");
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    Date nextAD=next.getDateOfAdmission();
    if((nextAD.after(from)||nextAD.equals(from))
    &&(nextAD.before(to)||nextAD.equals(to)))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByDischargeDates(Date from,Date to)
    throws IllegalArgumentException {
    if(to.before(from))
    throw new IllegalArgumentException("End date must not be before start date");
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    Date nextAD=next.getDateOfDischarge();
    if(nextAD==null)
    continue;
    if((nextAD.after(from)||nextAD.equals(from))
    &&(nextAD.before(to)||nextAD.equals(to)))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByConsultant(String consultant) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(consultant.equalsIgnoreCase(next.getConsultant()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByDischargeDate(Date dateOfDischarge) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(dateOfDischarge.equals(next.getDateOfDischarge()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getBySurname(String surname) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(surname.equalsIgnoreCase(next.getSurname()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);
    public Collection getByWard(String ward) {
    List selection=new ArrayList();
    for(Iterator i=patientRecords.iterator(); i.hasNext();) {
    PatientRecord next=(PatientRecord) i.next();
    if(ward.equalsIgnoreCase(next.getWard()))
    selection.add(next);
    return Collections.unmodifiableCollection(selection);

    please provide a detail description of your errors.

  • Is there a way to refer to/call the method of a super class' super class?

    Is there any way to essentially do what this pseudo code does?
    public void someMethod()
    return super.super.someMethod();
    }

    Imagine you had a class called C that extends class B, and class B extends class A. They all declare an instance variable called i. In the case of accessing an instance variable you could do this in class C:
    ((A)this).iThis is because super means the same as a cast of this.
    This is not true for for method invocation though. The cast to type A does not change the method that is invoked, because the instance method to be invoked is chosen according to the run-time class of the object referred to by this. A cast does not change the class of an object; it only checks that the class is compatible with the specified type.
    This is all in the JLS.

  • Flash call the method of flex application

    In a flex application I use the SWFLoader to load a flash,the code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="12">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    public function testResult():void{
            Alert.show("Hello World");
    ]]>
    </mx:Script>
    <mx:SWFLoader id="flash" source="flash/test3.swf"/>
    </mx:Application>
    There's a button in the embeded flash(flash/test3.swf),
    when I click this button,how to call the the testResult method of the flex application?Thank you!

    Hi,
    You can make use of complete event of SwfLoader and within that function get the instance of Flash Buttonm and register an evnet for the click within the Flex app as shown below:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="12">
        <mx:Script>
        <![CDATA[
        import mx.controls.Alert;
        private var loadedSWFMainTimeline:*;
        public function testResult(event:MouseEvent):void{
             Alert.show("Hello World");
        public function onSWFLoadComplete():void {
             //loadedSWFMainTimeline gets you a reference to the Flash SWF MainTimeline
             loadedSWFMainTimeline = flash.content;
             if(loadedSWFMainTimeline)
                var _button:SimpleButton = loadedSWFMainTimeline.flash_button_instance as SimpleButton;
                _button.addEventListener(MouseEvent.CLICK,testResult);       
        ]]>
        </mx:Script>
    <mx:SWFLoader id="flash" source="flash/test3.swf" complete="onSWFLoadComplete();"/>
    </mx:Application>
    Note: In the above code "flash_button_instance" is the instance name of the Flash button.
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • How to call the method from the java bean and pass it to JSP textbox

    i'm quite new to java thats why i'm asking how to call a method in the java bean file and pass it to the JSP textbox. My projects are communicating JSP with C#. i had successfully created a C# client bean file for JSP. The whole process is to type something on the server(C# programming) and it would appear in the textbox.

    your question doesn't provide much informartion. provide some other information and coding so that we could tell exactly what you are looking for?

  • Status code value after calling the method cl_http_client= receive

    Hi,
    I am sending a query string to 3rd party via outbound http. Now one of the methods needed in this case is CL_HTTP_CLIENT=>RECEIVE . This method has got 3 exceptions such as  communication failure etc. If this method has sy-subrc 0 what does this indicate. If  a sy-subrc value of 0 indicates success then why are we again quering the status code value between 200 and 299 . Can it happen that the value of  sy-subrc = 0 but the status code value is not between 200 and 299 .
    In which cases this situation will occur?
    Can anyone elaborate on this.....

    Hi i could not solve the problem with abap. We developed another application by using another programming language for this issue.
    But i think you should create an instance for authantication. After authantication you should get the cookies .
    Then create a new instance for other link and before send and receive methods set cookies ( which you got from authantication session ) for other link in ABAP.
    We did not have enough time to solve this in ABAP. Hope you will solve. If you solve please let me know how you have solved.
    Here is the code(another programming language), may be it will help you.
    req = (HttpWebRequest)WebRequest.Create(@"https://login.xxx.com/authenticate.aspx?userid=xxx&password=xxx");
          req.CookieContainer = cc;
          HttpWebResponse httpResponse = (HttpWebResponse)req.GetResponse();
          HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(@"https://yyy.com/postxml.aspx");
          httpRequest.CookieContainer = cc;
          httpRequest.Method = "POST";
          httpRequest.ContentType = "text/xml";
    Edited by: MusaCEBE on Sep 23, 2010 4:34 PM

Maybe you are looking for