How to use EJB in Distributed Environment

Hello
    I have to use the EJB in a distributed environment. There will be a Application server at one system which will access the Application server at another system which will be running ejb. I am using SAP J2EE Engine as application server.
So I would be thankful if anybody could tell me what are the steps to implement EJB in such a distributed Environment.
Venkat

You can implement your EJB as usual.
On the client side (i think this is also SAP J2EE, right?) you'll need the ejbclient.jar to have the interfaces of the EJBs available. In addition you need to feed the context factory with provider, username, password and context factory. etc.
An example can be found here:
http://help.sap.com/saphelp_nw70/helpdata/en/9b/a420ff77d6854bac64d0c4f1599ed0/frameset.htm
The example above uses a Corba factory for connection. The EJB standard RMI IIOP factory is "com.sap.engine.services.jndi.CosNamingInitialContextFactoryImpl" I think.
Markus

Similar Messages

  • How to use EJB in JSP...urgent!!!

    hello,
    i am novice programmer in EJB.
    i am using weblogic 6.1 ...
    my problem is how to use EJB in jsp page.
    my code is as follow..but its not displaying any result.
    <%@ page import="javax.naming.InitialContext,
    javax.naming.Context,
    java.util.Properties,
    firstEJB.First,
    firstEJB.FirstHome"%>
    <%
         long t1 = System.currentTimeMillis();
         System.out.println(t1);
         Properties props = new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
         props.put(Context.PROVIDER_URL, "localhost:7001");
         Context ctx = new InitialContext(props);
         FirstHome home = (FirstHome)ctx.lookup("FirstEJB");
         First bean = home.create();
         String time = bean.getTime();
         bean.remove();
         ctx.close();
         long t2 = System.currentTimeMillis();
    %>
    <html>
         <head>
              <style>p { font-family:Verdana;font-size:12px; }</style>
         </head>
         <body>
              <p>Message received from bean = "<%= time %>".<br>Time taken :
              <%= (t2 - t1) %> ms.</p>
         </body>
    </html>
    please tell me the solution.

    Hi, I don't know if it may be the cuase of your problems, but you should narrow the Object obtained doing the lookup, like this:
    FirstHome home = (FirstHome) PortableRemoteObject.narrow(ctx.lookup("FirstEJB"), FirstHome.class);

  • How To Use EJB in JSP

    I've used beans in JSP.. but how to use EJB's in beans ??
    EJB's are deployed in Oracle 8i
    Please Help
    Thank You.

    Please find the answer in this HOWTO:
    http://technet.oracle.com:89/ubb/Forum2/HTML/006404.html
    HOWTO's are archived on the JDeveloper Documentation page:
    http://technet.oracle.com/docs/products/jdev/listing.htm (Click on Documentation Tab)
    Thanks,
    -Roel.

  • How to use EJB Remote with Netbeans7.0 ?

    I try to create Session Bean in Netbeans 7.0 but when I select Remote then I have to select Java Application in Netbeans. It different from Netbeans 6.8 ,6.9 which in Netbeans6.8, 6.9 not have dropdown for select Java Application when we choose Remote. So I don't know how to use EJB Remote in Netbeans7.0 then I click finish. After that, I create Project is Enterprise Application Client. but in Main.java at this line
    BLSessionRemote obj = (BLSessionRemote)ctx.lookup("TestBean");
    It can't find BLSessionRemote in Session Beans. How to use EJB Remote with Netbeans7.0 ?

    Why don't you ask this question in the Netbeans mailing lists, where it belongs. Come here when you have problems with code you wrote yourself.

  • How to use drools in NWDS Environment

    Hi,
       I have downloaded Drools 4.0.4 version.It contains only jar files in it.I would like to use drools in NWDS Environment.How can i achieve this?
        Or is there any other link through which i can get a proper download file for drools?
    Regards,
    Nithyapriya Ganesan.

    You can implement your EJB as usual.
    On the client side (i think this is also SAP J2EE, right?) you'll need the ejbclient.jar to have the interfaces of the EJBs available. In addition you need to feed the context factory with provider, username, password and context factory. etc.
    An example can be found here:
    http://help.sap.com/saphelp_nw70/helpdata/en/9b/a420ff77d6854bac64d0c4f1599ed0/frameset.htm
    The example above uses a Corba factory for connection. The EJB standard RMI IIOP factory is "com.sap.engine.services.jndi.CosNamingInitialContextFactoryImpl" I think.
    Markus

  • How to use ejbs for accessing Function Module.

    Hi,
    I want to call ABAP function module using ejb(Since I want to expose them as web service on different server). I know how to do that using Models, but dont know how to go ahead using ejbs.
    Could you please guide me on this?
    Regards,
    Abhijeet.

    Hi,
    In another thread with a similar question I found these references:
    /people/kathirvel.balakrishnan2/blog/2005/07/26/remote-enable-your-rfchosttoip-to-return-host-ip-to-jco
    Re: interfacing SAP with an existing java applications
    And this code example:
              HashMap result = new HashMap();
              Object ret = new Object();
              JCO.Client mConnection = null;
              mConnection = getConnection();
              JCO.Repository mRepository;
              mRepository = new JCO.Repository("R3", mConnection);
              JCO.Function function =
                   createFunction("Z_ISA_GET_ORDER_ITEM_INFO", mRepository);
              function.getImportParameterList().setValue(orderNum, "ORDER");
              if (function != null) {
                   mConnection.execute(function);
                   JCO.Table codes = function.getTableParameterList().getTable("INFO");
                   for (int i = 0; i < codes.getNumRows(); i++) {
                        codes.setRow(i);
                        int tmp = new Integer(codes.getString("POSNN")).intValue();
                        String tmpStr = new String(Integer.toString(tmp));
                        ret = result.put(tmpStr, codes.getString("VBELN"));
              } else {
                   System.out.print("Fxn call failed for Z_ISA_GET_ORDER_ITEM_INFO");
              JCO.releaseClient(mConnection);
    Good luck,
    Roelof

  • How to use ejb control in jsp

    hi,
    I created an entity bean and I created an ejb control. Now I would like to
    use this ejb control inside of a jsp (no page flow).
    When I use the ejb without the control I do the follwing steps :
    - get the local home
    - call finder methode
    - get the local object
    - call getMethod() and display content
    Can someone please post an example how to use the netui-data tags to do this
    steps or do I have to use the controls in a total different way?
    Can someone please tell me how to use the ejb control inside a normal java
    class?
    Michael

    Do you want to use taglibs or develop custom tags? Either way take a look at these:
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
    http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
    http://jakarta.apache.org/taglibs/tutorial.html
    http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
    http://www.herongyang.com/jsp/tag.html

  • How to use ejb methods

    hi
    i created 8 methods in ejb now
    i want to use them in web dyn pro
    but to display the response of every method i need to create table i.e in all 8 tables.
    each table foe each response
    is ther any other way out
    can't i use single table for all

    Hi Mitesh,
    Sorry if I got you wrong, but if you are asking how to use an ejb in WebDynpro this thread may help you https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=http%3A//forums.sdn.sap.com/profile.jspa%3FuserID%3D635050 If your question is how to display the retrieved data on the screen, then you yourself will be best person to decide as no one else knows what data is being retrieved and how large they are.
    Best Regards,
    Nibu.

  • How to use Ejb with Hibernate in netbeans

    hello everybody
    i am developing a project using ejb and hibernate as a persistance provider. i need some idea how to develop a web application in netbeans. I went through a example in netbeans but it's not helping me.If any body can give me some idea
    many thanks
    sri

    Well, I've never used a JProgressBar before, so I'm
    not sure. If I add it to the frame, can I call it
    whenever I need to use it like when I click the
    JMenuItem do I just call it?Questions like these are better answered by the tutorials:
    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

  • How can use EJB local call in WLS 7.0 without EAR

    I have web application as jsp files.
    and I made .jar for some EJBs
    and I used local call for calling EJB from jsps in WLS 6.1
    but in WLS 7.0 .. occured error calling EJB as Local call
    while JNDI lookup.
    So I packed all applications as EAR and deployed then all works good.
    but in developing I want to use JSPs as jsp files.
    There is no way to use Local call to EJB in WLS 7.0 without packing EAR ? (like
    WLS 6.1)

    The way JNDI lookups were implemented in 6.1 allowed to deploy individual ejb-jars
    and access their local interfaces via JNDI lookups from other ejb-jars during
    development. In production all ejb-jars will be packaged into an ear.
    This is extremely helpful on large projects. E.g. my current project has over
    120 CMP entity beans and over 40 session beans. Even on 2GHz class machine with
    1Gb memory and JDK 1.4 (to enable full-speed debugging) it takes almost a minute
    to deploy the ear (no matter whether it is exploded or not). It takes minutes
    with 1.3 and debugging turned on.
    6.1 implementation allowed to "pre-deploy" relatively static ejb-jars and still
    access their local interfaces (by putting them on WL system classpath and deploying
    as individual ejb-jars, so classes are accessible to local clients; it requires
    WL restart when they are changed, but they don't change often). So during development
    only changed jars (typically session facade) need to be redeployed on changes,
    which takes only seconds. We didn't have problem with JNDI lookup performance
    since we use the EJBHomeFactory pattern.
    The behind-the-scene JNDI optimization "improvement" introduced in 7.0 makes it
    no longer possible to use this technique, since even though classloading still
    works in the same way, no objects are bound to JNDI tree and thus could not be
    access from another ejb-jar. This significantly impacts developer productivity
    (in our large project). It's not only about minutes lost (which btw makes hours
    over time), it just disrupts developer's train of thought to have such long round
    trip times. In fact this is the reason we are not going to migrate to WL 7.0.
    Is it possible to provide an option to turn this "optimization" off and actually
    bind JNDI objects?
    Thank you,
    Sergey
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Park <[email protected]> wrote:
    Thanks Rakitine.
    I wonder if I use EAR while developing could I apply changes to EARwhithout packing
    again.Sure - you can simply deploy your app as an 'exploded' EAR during development.
    There is no probelm delivering time but in developing time ..
    If I can not use that kind of way how can I make modification ?
    Plz. let me know.
    And I have one more question.
    When I use EAR I met some problem.
    I packed all JSP into one .war file.
    fot that I had to inclde requred classes into .war because jsps usethese classes.
    then I packed EAR file with WAR and some EJB jar files.
    After then I deployed EAR file to WLS.
    But If remove classes from classpth while EJB deploying Error occured.Because
    EJBs reference these classes.
    I thoght if I packed classes into .WAR .. there is no problem.
    But Error occured.
    I have to include classes into classpth for that ? or
    Any mistakes in my way.No, you do not have to add anything to the system classpath. In fact,
    you should
    make sure that none of your application classes are in the system classpath.
    thank you.
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Yup, that appears to be the difference between 6.1 and 7.0 - in
    6.1 success of a local invocation depended only on the Classloaders
    arrangement, so everything worked when you added your classes to the
    system classpath. In 7.0 looks like it also depends on the application
    context - that's why you cannot do a JNDI lookup from another deployment
    unit.
    Is there any reason why you do not want to use EAR's ???
    Park <[email protected]> wrote:
    in WLS 6.1 ..
    I have EJB as jar files. (deployed each to WLS)
    and I added EJB interface class to classpath.
    and I made WebApplication as Directory (not war file).
    in that webappication jsp call EJB as Local interface.
    These environment .. local call workes well in WLS 6.1.
    but in 7.1 not works .. (JNDI look up error)
    of course Remote call works well. and If I make EAR .. works well.
    Rob Woollen <[email protected]> wrote:
    You can have an exploded EAR and have it work.
    Can you give some more detail on how you are deploying in 6.1. Is
    it
    an
    exploded EAR, or do you have the ejb interfaces in the classpath?
    This behavior should not have changed between 6.1 and 7.0.
    -- Rob
    park wrote:
    I have web application as jsp files.
    and I made .jar for some EJBs
    and I used local call for calling EJB from jsps in WLS 6.1
    but in WLS 7.0 .. occured error calling EJB as Local call
    while JNDI lookup.
    So I packed all applications as EAR and deployed then all works
    good.
    but in developing I want to use JSPs as jsp files.
    There is no way to use Local call to EJB in WLS 7.0 without packingEAR ? (like
    WLS 6.1)
    Dimitri
    Dimitri

  • [b]how to use EJB QL for LIKE and ROWNUM[/b]

    Hi,
    i am using CMP EJB with OC4J server
    i face two problems in it when i make any query like
    select object(o) from Partymas o where o.stationCode like '?1' and o.rownum &gt;='?2' and o.rownum &lt;='?3' order by party_name
    then it shows error on rownum so i cant understand how to solve it
    second is when i use LIKE statment in EJB QL like this:-
    select object(o) from Partymas o where o.pinCode like '%?%'
    then it shows error so can any one help me
    thanks
    warm regards
    vikassheelgupta

    <ejb-ql>select object(o) from Partymas o where o.stationCode like '?1' and
    rownum >='?2' and rownum <='?3' order by party_name</ejb-ql>Try this:
    rownum >= ?2 and rownum <= ?3
    <ejb-ql>select object(o) from Partymas o where o.partyName like '%?%'</ejb-ql>Try this:
    like ?1

  • How to use DESNAME and DISTRIBUTE to mail

    Hello,
    I am using Oracle Reports 10g. I have a report (clients' invoices) which repeats on INVOICE_NO. (setup to burst).
    I go to Property Inspector >> Distribution:
    DISTRIBUTION ID: EMAIL_ADDRESS
    DESNAME: EMAIL_ADDRESS (this is the column in the database table which holds the emails of each clients, to whom the report is going to be sent; each client receives his/hers invoice)
    DESFORMAT: PDF
    DESTYPE: MAIL
    COPIES: 1
    I save, and then File >> Distribute, (asks me that is going to be send to multiple destinations) says: Distribution completed succesfully. BUT nothing happens (no emails).
    Questions:
    1. How should i write in order to distribute to each clients' email?
    2. Where could i see the activity logs of the application (are there any), where i could investigate what is going on in the backend?
    Thank you,
    Michael.

    Hi there guys,
    I have tracked down my mistaked.
    in the object navigator, i clicked on main, then in the body i have spotted down the R_ section, clicked on it, and then in the report design i have deleted. Then it worked like a charm.
    I have filled in the distribution box like this: &<subscriber_name>, and then i got each PDF bursted and distributed in each mail. That's great!!!
    The question is now:
    1. How can i configure all the details that will be displayed in the email? (like sender, subject, body etc.) Using the distribution box it gives me no alternative, in the distribution XML i can do this by editting all the details.
    2. How can i log all the responses that i get from each e-mail address to which has an email been sent. For example, one e-mail address is not valid anymore, i want to grep the answer that the mail server receives and in the end, to make a report ( out of 100% - 20% failed, 80% succesfully delivered). How can i accomplish this task?
    Thank you,
    Michael.

  • How to use EJB 3.0 in Visual Pack Web ?

    Hello everybody !
    is there someone who can explain me how to bind a TABLE component visually with a particular business method of an EJB.3.0 (in Netbeens 5.5 / Visual Web Pack)
    -Is there a way to do the same thing as we can do it in Sun Java Studio Creator ?
    -otherwise is there a tutorial / example / resource on the web witch can help me resolve this problem ?
    thanks

    I have a similar question: How can you set up entities and persistence units when working in a visual web project created using the Visual Web Developer pack?
    Perhaps the Visual Web Developer pack could use a couple of sample projects showing how these things are done.

  • How to use AppStore in business environment

    Hi Community,
    I've a few questions about the usage of the AppStore in business environments.
    We have round about 25 Macs in our office.
    Nobody of our users have an AppleAccount or an Apple-ID.
    Not every Mac have an internet connection.
    Nobody own a credit card from the company.
    Okay, I have an Apple-ID but only for my own personal usage combined with my own personal and private credit card. But I don't want to pay the company bills with my credit card. Can I create an Apple Account for business usage without having a credit card from the company? Like Amazon, where we have a business account and where we pay our bills by direct debit. This works fine, is there a possibility to pay in AppStore by direct debit?
    Next problem is that most of our Macs doesn't have an Internet connection. We are working for some government agencies and therefore we have strong limitations. How can we install software on these machines? Is it possible to download software on my Mac (with Internet connection), with the AppleAccount I addressed in the point above and put this installer on one of these machines?
    If this is possible, how can I install a software on more of these machines without an Internet connection? How will the system verify if the licence is still valid and not registered by another machine?
    For example we need Xcode on every machine and I download Xcode from Apples AppStore, do I have to download it as often as I need the software or only download it one time, what is useful because otherwise we would wasting bandwidth. What I've to do in such a case? Pay 10 times, download only one time and install it 10 times? And maybe I will get it for free because of my Apple Developers account, how can I pay with my business account for the others? If it is free, I've no other possibilities.
    Another example, we are downloading a Lion Installer for multiple machines, how does the target system (without Internet connection) verify that the target hardware originally was shipped with Lion (because reinstalling the operating system for example) and doesn't need a bought licence? Otherwise the opposite scenario is, we want to install Lion on a machine where we have to buy a licence. How can I respect this differences when I have only one "master administration machine" who is allowed to download and buy software?
    Can I use a Mac in future without an Internet connection?
    Maybe someone can bring some light into this dark and cold prospect.
    Thanks in advance & bye Tom

    At the moment there is now way you can get Volume Licensing for Mac OS X outside US (at least none that I've been able to find).
    This subject is also discussed HERE and, until now, no user or Apple official has been able to give us an answer to this question.
    Hopefully they care enough about their customers to, at least, give us a time interval until Mac OS X Lion will be available for businesses outside US.

  • Newbie-how to use EJB in JSP?

    Can some one please point me to any sources, tutorials, examples on using
              enterprise javabeans in JSP?
              How can I use an entity bean home interface or findByprimaryKey methods in
              JSP?
              Thanks in advance.
              

    look at /examples/jsp/EJBeanManagedClient.jsp in your WLS distribution.
              Kumar
              Manmari wrote:
              > Can some one please point me to any sources, tutorials, examples on using
              > enterprise javabeans in JSP?
              > How can I use an entity bean home interface or findByprimaryKey methods in
              > JSP?
              >
              > Thanks in advance.
              

Maybe you are looking for

  • I want only one Apple acct....please!

    I have 4 Apple related accounts: 2 "apple.com", 1 "daw.apple.com", 1 "secure1.store.apple.com" How can I have only one acct. for Apple,  iTunes, Cloud, etc.?

  • Make Screen field non editable

    Hi All, We have following requirement in our project: When entering infotype 1 in any action a check should be made to set default values in Work Contract. If Employee Group =u2019 1u2019, Work Contract u2018ZFu2019 should be set and this value must

  • How can I set ACR 5.2 to open RAW files as 16 Bit and not 8?

    Whenever I open RAW files in ACR 5.2 they open as 8 bit. I change the bit depth to 16 and work on a file... but when I open my next RAW file it's back to 8. Is there any way to set ACR so that it always opens my RAW files as 16 Bit.. and saves other

  • Mac G5 and second 23" display

    I already have one 23" (silver) display and would like to use another for all my post production. I'm using a GeForce 6800 Ultra DDL card and my mac is 2.3 ghz. If I get a second 23" display what kind if any issues will I have, even if I can even use

  • Selecting multiple images in different folders/projects?

    What is the most efficient way to go about this? On occasion I will export a web gallery using the FlashAlbumExporter. Simple if the images are in the same project. But sometimes I need to pull different images from all over the place. I created a ne