EJB external/remote client

J

Jim Flath

I am trying to create a standalone Java application that will access
an EJB running in a WebLogic 8.1 server.

When I run the client code on the same server as the WebLogic and add
the weblogic.jar to the classpath everything works just fine.

My problem occurs when I try to run the client code on my Windows (yea
I know) machine. I am getting an ClassNotFoundException when
attempting to instantiate the InitialContext. That exception makes
sense because I don't have weblogic.jar on my Windows box.

So I guess my question would be how to configure the InitialContext on
a remote/external client with out having to bring all of the weblogic
classes along with it.

For what it's worth, here is how I am creating the InitialContext

private Context createInitialContext(){
Properties env = new Properties();
env.put( "java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory" );
env.put( "java.naming.provider.url",
"t3://10.0.124.68:7005" );
return new InitialContext( env );
}
 
S

Sudsy

Jim said:
I am trying to create a standalone Java application that will access
an EJB running in a WebLogic 8.1 server.

When I run the client code on the same server as the WebLogic and add
the weblogic.jar to the classpath everything works just fine.

My problem occurs when I try to run the client code on my Windows (yea
I know) machine. I am getting an ClassNotFoundException when
attempting to instantiate the InitialContext. That exception makes
sense because I don't have weblogic.jar on my Windows box.

So I guess my question would be how to configure the InitialContext on
a remote/external client with out having to bring all of the weblogic
classes along with it.

Quite simply, you can't. Look at the InitialContext factory you've
specified: weblogic.jndi.WLInitialContextFactory. Hence your client
needs access to that class, plus a bunch of other classes "under the
covers". There might be a smaller jar designed specifically for client
access; it might even be called client.jar.
You already know that you need your applications stubs as well, right?
 
J

Jim Flath

Sudsy said:
Quite simply, you can't. Look at the InitialContext factory you've
specified: weblogic.jndi.WLInitialContextFactory. Hence your client
needs access to that class, plus a bunch of other classes "under the
covers". There might be a smaller jar designed specifically for client
access; it might even be called client.jar.
You already know that you need your applications stubs as well, right?

Thanks for the thought. There is a wlclient.jar that comes with
WebLogic that is made for what I need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

TOMCAT 5 + EJB 1
What factory do I use? 4
Remote JNDI/EJB Problems 0
EJB Woes 5
EJB Session Remote Calls 0
[newbie-ejb...helppppppppppp]Remote ejb Connection 5
Using GIT to get remote code 1
JNDI searches 11

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top