ejb lookup in swing client

Discussions

General J2EE: ejb lookup in swing client

  1. ejb lookup in swing client (3 messages)

    hi,

    i have an architecture in which my ejbs are deployed in the server in one location and the SWING Client in another location , my problem is that how to access the ejbs in the swing client location.
    I want to know how to lookup the ejb in swing app.

    thanks in advance
    srini

    Threaded Messages (3)

  2. ejb lookup in swing client[ Go to top ]

    As long as you have the necessary client code in your classpath, then your swing client looks up the EJB just like any other client.

    snippet:

    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,"your factory class");
    p.put(Context.PROVIDER_URL, "protocol://server:port");

    Context ctx = new InitialContext(p);

    Object ref = ctx.lookup("EJB JNDI name");

    ...narrow the object to the home interface

    Hope this helps
  3. ejb lookup in swing client[ Go to top ]

    hi,

    thanks for replying i know that we can do that way and can access the ejbs from the remote client...but my problem is that in the client side i need to store all the dependent class and weblogic.jar also...can u please tell the how can i implement so that i can have one jar file of my application and do with this architecture....

    thanks for replying
    srini
  4. ejb lookup in swing client[ Go to top ]

    Well I think you have pretty much 2 chioces. You either need to have the client code for your EJB's on the client, or you can have the client download the implementation over the network. You should probably do some research at java.sun.com for doing that.

    I obviously dont know what your app is doing, by I will say that needing the weblogic.jar on the client sounds pretty strange. You might want to revisit the design and maybe introduce a beter facade(Session Bean) for your clients, so they dont need welogic implemenentation to do their tasks.

    Good luck...hope Ive shed some light.