client-remote-ejb-tomee

3 Jan

How write a client remote for a EJB deployed on TOMEE

http://tomee.apache.org/clients.html

Remote Client with HTTP (in TomEE)


Properties p = new Properties();
p.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
p.put("java.naming.provider.url", "http://127.0.0.1:8080/tomee/ejb");
// user and pass optional
p.put("java.naming.security.principal", "myuser");
p.put("java.naming.security.credentials", "mypass");

InitialContext ctx = new InitialContext(p);

MyBean myBean = (MyBean) ctx.lookup("MyBeanRemote");
------------------------------------------------------------

————————————————————————————–

Local Client (embedded container)

Properties p =newProperties();
p.put("java.naming.factory.initial","org.apache.openejb.client.LocalInitialContextFactory");InitialContext ctx =newInitialContext(p);MyBean myBean =(MyBean) ctx.lookup("MyBeanRemote");

................................................................................................

Lookup Of Ejbs

http://tomee.apache.org/examples-trunk/lookup-of-ejbs/README.html

————————————————————————————————

Lookup Of Ejbs with Descriptor

http://tomee.apache.org/examples-trunk/lookup-of-ejbs-with-descriptor/README.html

———————————————————————–

Injection Of Ejbs

http://tomee.apache.org/examples-trunk/injection-of-ejbs/README.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: