Hey i have figured out how to access a EJB from a client, not packaged in a
.ear.
If i tryed to access the bean by calling
context.lookup("java:comp/env/ejb/SomeBean");
, you get a exception stating the client must be a J2EE component.

The way around was to look at the file
E:\orion\application-deployments\AppName\hello-world-ejb.jar\orion-ejb-jar.x
ml, a get the value of location within <session-deployment.
That give the JNDI location of the bean, so now you can call it from a
client with
context.lookup("whatever_location_is");

It was so simple, but took me ages to get working!
You still need to have a application-client.xml file in the META-INF, but
you don't need to package and deploy the client to access EJB's.
Also you call System.setProperty() for each of the propertys in the
JNDI.properties file, if you don't want to use a seperate file.



Reply via email to