How to refer to another EJB from different root

Hi ,
Is there any way in JDeveloper to refer to EJB's from another context root ( Technically different application ) from the EJB's in the current context root. ? Am seeing a couple of ways, but looking for something better if possible
1) Reuse the source code from the other application
2) Define the other EJB as a Service, use a Service lookup to get the business intent of the service.
Please advice !!

Done.

Similar Messages

  • How can i access the EJB from a Webdynpro

    Dear all,
    How can i access the ejb , from a webdynpro?.
    Is there any way to do that?.
    I want to write the entire code (business functions) within the EJB and i wan to access the entire methods from a WebDynpro Application.This is the situation.
    Please help me to , resolve this problem.(Here im using JDBC Connection .. etc.).
    I want to do the basic connection setting's and data retrieval part within the EJB and use that within the WebDynpro..
    how can i seperate this two(i mean, i want to seperate the JDBC connections and WebDynpro,i dont want to hard code any connection parameters within the webdynpro code)
    So that i want use that saet of particular function's in many webdynpro applications..
    (i dont need any help regarding webservice way.)
    If anyone can , please help me..
    I tried that javabean class , manifest file , that way (importing javabean model).
    but im getting errors.
    I cant properly utilize that..
    So please help me with steps regarding that,,
    for javabean
    and if any , for EJB also..
    with regards
    Kishor.G

    HI,
    Since webdynpros follows Model View Controller Architecture You can access EJBs in webdynpro(views/frontend) infact to connec to database uding JDBC you have to utilise EJB ( opening connection to database closing, and other Business functionality).See this link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/unkown/web dynpro tutorial and sample applications.faq#q-7
    <b>How to access the Car Rental Web Service?</b>
    Regards,
    RK

  • Urgent!!!!How to deploy only an EJB from Weblogic to oc4j.

    Hi
    How can i deploy only EJB from Weblogic into oc4j without any web application or client coming into pitcture as my client access bean remotely....
    regards,
    Sapthapathi

    If you are migrating from ejb1.1->ejb1.1 you shouldn't have many changes - your ejb-jar.xml file should be the same (I assume you are still talking about ejbs). Once you pull over the base ejb - then if you want to, mess around with the automatically generated orion-ejb-jar.xml file. Obviously - those are all app server specific. I go back and forth between wls6.1 and oc4j all the time. When going from wls5.1 to oc4j - what particular issues do you run into. What do you mean, in particular, by configuration changes?
    Curious -
    Ray
    hi,
    EJBs and other applications can be migrated from weblogic to oc4j but many changes are required.These changes are mainly configuration changes rather than code changes.Infact there are many problems in effect while migrating and delloyment.Hope oracle is a bit more attentive to this issue.
    regards,
    chennai

  • How to communicate with another applet in different frame?

    Hello,evryone
    How to communicate with another applet in different frame?
    Can you give some advices?
    thank you!
    zhongboqing

    i faced this problem one year ago.It would be something like that:
    first you have to get the applet context 'getAppletContext()' (which is the current frame).
    Then get parent of that context 'getParent()' (which is the browser context).
    Then u can access the desired frame by its name. Finally you can access the desired applet located within this frame by

  • How to merge two search button from different criteria

    How to merge two search button from different criteria
    this image show the question
    http://s24.postimg.org/4algthuj9/1111.jpg
    two different criteria for the same view and I need to merge it in one button as when I click
    on the button search result give from two criteria parameters

    You can!t using af:query. the af:query component comes as is. If you can't do it through the properties, you probably can't do it at all.
    As in your other thread, the way to go is to program your own search form. This way you can use a layout and functionality you like.
    For this you create a form with input fields for the values you are searching for, put them on hte page in a way you like and in the end by hitting on a button (e.g. called Search) map all inputfields to parameters of a service method you defined in your application module or VO. This service method then executes a view criteria returning all matches in the default iterator (just as if you had used af:query.
    Timo 

  • HELP!!! How I can call to EJB from another EJB??

    I have two EJBs, for each EJB I have a jar, how I can call to EJB jar to another???
    I have tried the following, in the first EJB I have import the second EJB jar and call it with context, lookup, PortableRemoteObject etc.. but the instruction lookup not find the second EJB reference.
    The name in the lookup instruction is the JNDI name of the second EJB but not find a reference to it.
    Please help me!!! Thanks!!
    The error is:
    javax.naming.NameNotFoundException: Missing node. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:34)
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.extract(NotFoundHelper.java:50)
         at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:161)
         at com.inprise.j2ee.jndi.java.CorbaContext.resolveName(CorbaContext.java:242)
         at com.inprise.j2ee.jndi.java.CorbaContext.lookup(CorbaContext.java:261)
         at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:483)
         at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:493)
         at com.inprise.j2ee.jndi.java.javaContext.internal_lookup(javaContext.java:493)
         at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:937)
         at com.inprise.j2ee.jndi.java.javaContext.lookup(javaContext.java:942)
         at javax.naming.InitialContext.lookup(InitialContext.java:350)
         at ejbclient.EnterpriseClientBean.addition(EnterpriseClientBean.java:115)
         at ejbclient.EnterpriseClientBean.actionPerformed(EnterpriseClientBean.java:97)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
         at avax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstr

    ok.. Here it goes.. I am writing a sample code..
    public class EJB1LogBean implements SessionBean {
    // test is a method of stateless session beam
    public void test ( TestVal val )
    throws RemoteException{
    try {
    EJB2LogHome ejb2Home= (EJB2LogHome)getHome("java:comp/env/ejb/EJB2LogHome",1);
    EJB2Log ejb2Log = ejb2LogHome.create ( val );
    } catch ( CreateException e ) {
         System.out.println("Create Exception occurred ");
         e.printStackTrace();
         } catch ( RemoteException e ) {
         System.out.println( "RemoteException Occured");
    e.printStackTrace();
         throw new RemoteException () ;
         } catch(Exception ee) {
    ee.printStackTrace();
    private EJBHome getHome(String jndiName,int type) {
    try {
    Context context = new InitialContext();
    Object ref = context.lookup( jndiName );
    switch(type)
    case 1:
    EJB2LogHome ejb2LogHome = ( EJB2LogHome )
    PortableRemoteObject.narrow( ref, EJB2LogHome.class );
    return ejb2LogHome;
    } catch ( Exception e ) {
    e.printStackTrace();
    return null;
    }//EJB1LogBean ends
    Here as you can see, EJB1LogBean(session bean) is calling a second EJB, EJB2LogBean (entity bean). TestVal is a sample value object passed. It is plain java class and can vary from app to app and it has got nothing to do with ejbs.
    "java:comp/env/ejb" is a J2EE standard and while getting a home interface, you have to append the home interface class name to "java:comp/env/ejb". Here I am passing "java:comp/env/ejb/EJB2LogHome" and "1" to getHome method, whose job is to get a reference to a home interface. getHome method is a local method. "1" is passed just to give a flexibility to getHome method as you can have more ejbs to invoked. In that case, you can go on adding different case statements for 2, 3 etc.
    The only thing you have to keep in mind is that your deployment descriptor for EJB1LogBean will contain the entires for both the beans i.e. for EJB1LogBean and EJB2LogBean. This is because EJB2LogBean is wrapped by EJB1LogBean.
    Hope this helps.
    Please let me know if you need anything more.
    - Amit

  • In a single program how to lookup different EJB from different application

    Hi,
    I have deployed two applications app1 and app2 on oc4j.
    There is a stateless session bean in a1 called ejb1.
    And there is also a stateless session bean ejb2 in app2.
    I write a test jsp in app1 to lookup ejb1 and ejb2 as an application client. So I need to create an application-client.xml for it.
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.2//EN" "http://java.sun.com/j2ee/dtds/application-client_1_2.dtd">
    <application-client>
    <display-name>ejbs</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb1</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>class_of_ejb1Home</home>
    <remote>class_of_ejb1</remote>
    </ejb-ref>
    <ejb-ref>
    <ejb-ref-name>ejb2</ejb-ref-name>
    <ejb-ref-type>ejb2</ejb-ref-type>
    <home>class_of_ejb2Home</home>
    <remote>class_of_ejb2</remote>
    </ejb-ref>
    </application-client>
    However, When I run the test.jsp, It will report following error:
    javax.naming.NamingException: Error reading application-client descriptor: No location specified and no suitable instance of the type 'class_of_ejb2' found for the ejb-ref ejb2
    In fact, if I only lookup any of the ejb and the application-client.xml just specify only the according ejb-ref, everything is alright.
    But how to construct the application-client.xml so that it can suitable for 2 different ejb in different application? Do I miss something in doing it?
    Kindly advice!
    Queeny Tang

    Hi Debabrata Panda,
    I did add parent in web.xml, but it still encounter
    "Error reading application-client descriptor: No location specified and no suitable instance of the type 'class_of_ejb2' found for the ejb-ref ejb2"
    In my program, a jsp in app2 will lookup ejb1 of app1. In the same way, a jsp in app1 will lookup ejb2 of app2.
    if I declare in server.xml
    <application name="app2" path="../applications/app2.ear" parent="app1" auto-start="true" />
    <application name="app1" path="../applications/app1.ear" parent="app2" auto-start="true" />
    That will cause error reading application-client.xml for all
    ejbs.
    How to solve this.
    Thanks in advance!
    Yours Queeny

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • Trouble in communicating with another EJB from an EJB

    I have created a stateless session bean, and inside this bean I have methods that calls methods in another stateless session bean (called myEJB, for example). When I run the code, it kept giving me the "noClassDefFoundError":
    java.rmi.RemoteException: Error in ejbCreate:; nested exception is:
         java.lang.NoClassDefFoundError: com.mybean.myEJBHome
    Someone suggested to me that this is because they aren't remote objects, so I created local interfaces for "myEJB". When I run the code again (by binding to the Local interface now), I got this error:
    javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: Unable to resolve
    'app/ejb/mybeans.jar#myEJB/local-home' Resolved: 'app/ejb/ Unresolved:'mybeans.jar#myEJB' ;
    remaining name 'mybeans.jar#myEJB/local-home']; Link Remaining Name:
    'java:app/ejb/mybeans.jar#myEJB/local-home'
    Any ideas??
    Thanks

    To refer a Ejb from another Ejb include <ejb-ref> in ejb-jar.xml
    <session>
    <ejb-name>EjbA</ejb-name>
    <ejb-ref>
    <ejb-ref-name>Ejb2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.ejb.Ejb2Home</home>
    <remote>com.ejb.Ejb2</remote>
    </ejb-ref>
    <session>
    Include a <reference-discriptor> in weblogic-ejb-jar.xml
    <weblogic-enterprise-bean>
    <ejb-name>EjbA</ejb-name>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>Ejb2</ejb-ref-name>
    <jndi-name>protocol://<Ejb2host>:<PortNumber>/com.ejb.Ejb2Home</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    Example <jndi-name>:http://localhost:7001/com.ejb.Ejb2Home
    In EjbA bean class refer to Ejb2 method with a reference to Ejb2 remote interface.
    InitialContext initialContext = new InitialContext();
    Ejb2Home ejb2Home = (Ejb2Home)initialContext.lookup("protocol://<Ejb2host>:<PortNumber>/com.ejb.Ejb2Home");

  • How do I view multiple images from different projects at the same time?

    Hello
    I've been trying to find the answer in the user manual, but no luck so far.
    I did find how to open 2 projects at once, but I can only see one image at a time in the viewer and I have to keep going back and forth between projects to compare images. (These are scans of old photos and I want to eliminate the ones that are poorer quality, so need to compare numerous images from 2 sets of scans)
    How can I view an image from one project at the same time as an image from another? I know that it can be done in the same project by apple-clicking the second, third etc image, but this doesn't work if the images are from different projects.
    Thank you
    Elizabeth

    Thank you again Tony
    I've now created an album, independent of the projects, and dragged test images into it and it does just the job I needed. Now i just need to keep my brain sorted with which ones are which while i'm working
    Elizabeth

  • How to update data in database from different region of the same page

    Hi,
    I have pepared two regions of tabular form based on the same table,each region is selecting different columns of the same table.
    I want to update the values from different regions in the database using single submit button.
    Regards
    Shashi

    I presume that the two regions are working fine with their individual buttons and your issue is how to make them both save with one button.
    Here is how
    a. You will have 2 ApplyMRU and 1 ApplyMRD processes for each of the regions. Right? Lets say you have 2 "Save" (i.e. label=Save) buttons, one has name SUBMIT and the other SAVE ( SUBMIT and SAVE being the requests that will be sent when they are clicked , respectively)
    b. Make the Display condition on one of the buttons 'Never'. Now it won't show when you run the page. Lets say you made SAVE's conditional Display 'Never'
    c. Go and change the condition on all ApplyMRU and ApplyMRD processes from "When Button Pressed" to "Request is contains in Expression1". In Expression1 enter SUBMIT,SAVERegards

  • How do i get my contacts from different resources to icloud?

    My contacts comes from different resources (gmail.com, icloud), How do i get my contacts from before icloud into icloud?

    Welcome to the Apple community.
    If you deleted your contacts from your contacts app, they will also be deleted in iCloud.
    However if you deleted your account or simply turned contacts syncing off, you should be able to log back into your account or re-enable contacts syncing and they would repopulate your contacts app.
    Could you perhaps tell us which of these you have done.

  • "HowTo" Call EJB from different EAR in WLS7

    Hi,
    Im trying to deploy two EAR application modules, both on same WLS7.0 SP2 server
    . I have several problems to give visibility between EAR applications. There is
    dependences between both applications ( I will call them FirstEAR and SecondEAR)
    . A FirstEAR EJB ( FirstEAREJB) uses an EJB from the SecondEAR ( SecondEAREJB
    The deployment result is a "Unable to initialize method info for remote or home
    interface The error is java.lang.NoClassDefFoundError: myPackage.myPackage.SECONDEAREJB"
    when deploy the FirstEAREJB. I try the deployment of both using -iiop ejbc option.
    Which is the way to allow my FirstEAREJB to use SECONDEAREJB?
    I have try
    - to set the manifest Class-Path property for FirstEAREJB with no results.
    - to set the descriptor ejb-jar properties for EJBRefs with no results.
    - to set the SecondEAREJB path in the weblogic start script classpath, with no
    results.
    - to set the SecondEAR classpath at the ejbc -cp option for FirstEAREJB ejbc
    compile, with no results again.
    Is there another way to allow my FirstEAREJB to use SecondEAREJB ?

    Take a look at this documentation on WebLogic Server Application
    Classloading.
    It might be helpful.
    http://edocs.bea.com/wls/docs70/programming/classloading.html
    /k
    "Adolfo Cortés" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi,
    Im trying to deploy two EAR application modules, both on same WLS7.0 SP2server
    I have several problems to give visibility between EAR applications.There is
    dependences between both applications ( I will call them FirstEAR andSecondEAR)
    A FirstEAR EJB ( FirstEAREJB) uses an EJB from the SecondEAR (SecondEAREJB
    The deployment result is a "Unable to initialize method info for remote orhome
    interface The error is java.lang.NoClassDefFoundError:myPackage.myPackage.SECONDEAREJB"
    when deploy the FirstEAREJB. I try the deployment of both using -iiop ejbcoption.
    >
    Which is the way to allow my FirstEAREJB to use SECONDEAREJB?
    I have try
    - to set the manifest Class-Path property for FirstEAREJB with noresults.
    - to set the descriptor ejb-jar properties for EJBRefs with no results.
    - to set the SecondEAREJB path in the weblogic start script classpath,with no
    results.
    - to set the SecondEAR classpath at the ejbc -cp option for FirstEAREJBejbc
    compile, with no results again.
    Is there another way to allow my FirstEAREJB to use SecondEAREJB ?

  • How to refer to enclosing instance from within the member class?

    Hi
    How to refer to the enclosing instance from within the member class?
    I have the following code :
    import java.awt.*;
    import java.awt.event.*;
    public class MyDialog extends Dialog
         public MyDialog(Frame fr,boolean modal)
              super(fr,modal);
              addWindowListener(new MyWindowAdapter());
         public void paint(Graphics g)
              g.drawString("Modal Dialogs are sometimes needed...",10,10);
         class MyWindowAdapter extends WindowAdapter
              public void windowClosing(WindowEvent evt)
                   //MyDialog.close(); // is this right?
    In the above code, how can I call the "close()" method of the "Dialog" class (which is the enclosing class) from the inner class?
    Thanks in advance.
    Senthil.

    Hi Senthil,
    You can directly call the outer class method. Otherwise use the following way MyDialog.this.close(); (But there is no close() method in Dialog!!)
    If this is not you expected, give me more details about problem.
    (Siva E.)

  • How to unify multiple iPhoto libraries from different Mac OS versions?

    I am pretty good with the Mac itself and have been a long time user. I knew full well acumulating multiple iphoto libraries in older backups (intead of building up on one) was not a great idea but for several reasons I have had to live that way. Now is the time to clean it all up once and for all and I need some wisdom;
    -I got my external drive as my new iphoto library now. It's being used, there are already albums in it and it's ready to accept older libraries.
    -What I want is that the older libraries (about 10 of them from different Mac OS versions) to show up in the new external drive as they looked in iphot back then. As albums in other words.
    -I do not want them imported in a single folder that's full of photos.
    Any help is much appreciated,
    Cheers.
    M

    If you imported a previous iphoto library into your new one, it created a folder inside the iphoto called "imported".
    That was the problem. One should never import one library into another.  Only iPhoto 6 libraries and earlier can be imported into a library now.  With the introduction of iPhoto 7 the library was changed from a folder to a package which can't be imported by the current iPhoto version.
    To use an older library with a new iPhoto version one just opens that library with iPhoto and lets iPhoto update it as necessary.  No importing necessary.
    Also you can use the paid verson of  iPhoto Library Manager  to merge those additional libraries into your current working library (be sure to have a current backup of your current library before merging).  What will be included are albums, Events, keywords, titles, descriptions, places.  Books, slideshows, calendars in the other libraries will be copied over as just albums.
    OT

Maybe you are looking for