If you want to access the ejb which deployed in orion from a client
application do the following.

create a file named jndi.properties with the following properties in it.

java.naming.factory.initial=com.evermind.server.ApplicationClientInitialCont
extFactory
java.naming.provider.url=ormi://localhost/<applicationname>
java.naming.security.principal=admin
java.naming.security.credentials=123

make sure that this file should be available in classpath.

in your META-INF directory write a application-client.xml which should
specify which ejb you want refer.

A sample application-client.xml like the following

<?xml version="1.0"?>
<!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE
Application Client 1.2//EN"
"http://java.sun.com/j2ee/dtds/application-client_1_2.dtd";>
<application-client>
 <ejb-ref>
  <ejb-ref-name>MyCart</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>CartHome</home>
  <remote>Cart</remote>
 </ejb-ref>
</application-client>

Hope this will work for you.

----- Original Message -----
From: "Mustafa Cayci" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Saturday, June 02, 2001 12:00 PM
Subject: Creating a client application


> I have been going over the O'Reilly's Enterprise Java
> Beans and trying to run an EJB that I deployed in
> Orion using an external client.  I went into the
> Console and I verified that so called application
> cabin is deployed.  When I try to run the client I am
> getting the below exception.  Here is my client code
> that I have initialContext
>
>  public static Context getInitialContext() throws
> javax.naming.NamingException {
>   Hashtable env = new java.util.Hashtable();
>
>
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClie
ntInitialContextFactory");
>
> env.put(Context.PROVIDER_URL,"ormi://localhost/cabin");
>   return new javax.naming.InitialContext(env);
>  }
> ****************************************************
> Exception:
>
> javax.naming.NamingException: Error reading
> application-client descriptor: No location specified
> and no suitable instance of the type 'Cabin' found for
> the ejb-ref Cabin
> javax.naming.Context
>
com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext
(java.util.Hashtable)
> javax.naming.Context
> javax.naming.spi.NamingManager.getInitialContext(java.util.Hashtable)
> javax.naming.Context
> javax.naming.InitialContext.getDefaultInitCtx()
> void
> javax.naming.InitialContext.init(java.util.Hashtable)
> void
> javax.naming.InitialContext.<init>(java.util.Hashtable)
> javax.naming.Context
> com.titan.cabin.Client_1.getInitialContext()
> void
> com.titan.cabin.Client_1.main(java.lang.String[])
>
>
> Any help is appreciated.
>
> Thanks,
> Mustafa
>
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>

Reply via email to