Ashish,
To run a java client program against WebSphere 3.5, besides your deployed
bean jar file and support jars if any, ejs.jar, and ujc.jar in your
classpath you will also need:
c:\WebSphere\AppServer\jdk\jre\lib\ext\iioprt.jar
c:\WebSphere\AppServer\jdk\jre\lib\ext\jndi.jar
c:\WebSphere\AppServer\jdk\jre\lib\ext\rmiorb.jar
As you have heard from the list, you will also need to run the same Java as
your WebSphere 3.5 server is running. And if you are on Windows, you will
also need this in your PATH:
c:\WebSphere\AppServer\jdk\jre\bin\ioser12.dll
Here is some sample code for getting the initial context and reference to
the home interface for your bean. The urlName is the machine:port string
where your WebSphere 3.5 name server is running, e.g. localhost:900.
//[IBM WebSphere Server v3.5.0 getHomeInterface]
com.beantest.customer.CustomerHome getHomeInterface(String urlName)
throws Throwable
{
//[Get the initial context]
Hashtable env = new Hashtable();
env.put(javax.naming.Context.PROVIDER_URL, "iiop://" + urlName);
env.put("java.naming.factory.initial",
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
env.put("javax.naming.Context.INITIAL_CONTEXT_FACTORY",
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
javax.naming.InitialContext jndi = new
javax.naming.InitialContext(env);
if (jndi == null)
throw (new NullPointerException ("InitialContext returned
null"));
//[Get the reference to the bean's home interface]
Object homeObject = jndi.lookup("OECustomer");
com.beantest.customer.CustomerHome home =
(com.beantest.customer.CustomerHome)
javax.rmi.PortableRemoteObject.narrow((org.omg.CORBA.Object) homeObject,
com.beantest.customer.CustomerHome.class);
if (home == null)
throw (new NullPointerException("jndi.lookup returned null"));
return home;
}
Hope this helps,
Chris Thompson
Software Design Engineer
Web Application Test Group
p| 781.993.8825 f| 781.993.8601 m| 781.424.1644
email | [EMAIL PROTECTED]
1430 Main Street | Waltham, MA | 02451
E M P I R I X
http://www.empirix.com
-----Original Message-----
From: Arul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 6:02 AM
Subject: Re: WebSphere3.5 Client Running Problem
Hi ashish...
Just check out the Context.put in ur client program
Arul
----- Original Message -----
From: "Ashish Patel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 4:08 PM
Subject: WebSphere3.5 Client Running Problem
> hi to all,
>
> I am using IBM WebSphere 3.5 for my deployment. I am
> new in WebSphere. I wants to know how i can run my
> client application ??
> Means after successfully deployment of HelloWorld EJB
> when i am going to run client program it gives me
> following error :
>
>
> javax.naming.ServiceUnavailableException [Root
> exception is java.lang.ClassCastException:
> com.sun.corba.se.internal.io.FVDCodeBaseImpl]
>
> My classpath is set to HelloWorld.jar file &
> ejs.jar,ujc.jar files also.
> My Administrative Client is running with HelloWorld
> EJB in running State.
>
> Can anybody help me in this error ??
>
> Thanks in Advance.
>
>
> =====
> Ashish Patel.
> Baeurer Infotech Ltd.
> India.
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year! http://personal.mail.yahoo.com/
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".