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
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.
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"your factory class");
Context ctx = new InitialContext(p);
Object ref = ctx.lookup("EJB JNDI name");
...narrow the object to the home interface
Hope this helps
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
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.