Hello Rahul,
If you're using WebLogic Server 5.1.0 (not WebLogic Enterprise), your client
must look like:
java.util.Properties prop = new java.util.Properties();
prop.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
prop.put(javax.naming.Context.PROVIDER_URL,
"t3://myserver.mydomain:7001");
ctx = new InitialContext(prop);
I had a lot of problems when trying to execute examples of Roman Book; for
example, the source 6.9. ;-)
I would advise you to run firstly the weblogic\setEnv.cmd (or setEnv.sh if
you have Unix), and then run the client without "-D" parameters: you don't
need to define any environment variable.
By the way, I think the best EJB book is Richard Monson-Haefel's (O'Reilly).
Regards.
Luis Canals.
-----Original Message-----
From: Rahul Naithani [mailto:[EMAIL PROTECTED]]
Sent: lunes, 06 de noviembre de 2000 13:24
To: [EMAIL PROTECTED]
Subject: Unable to start my first EJB sample.
Dear Ejb-Interest list,
I made my first EJB application which constitutes of a stateless session
bean at the server end and a simple java program at the client side.
The server is deployed in Weblogic 5.1.0 and my jar file is in place.
Just to avoid any problems, I copied the whole jar file in the directory
which has my client and compiled the client successfully.
But I am not able to find a way to execute this client. I went through Ed
Roman's book and did exactly what's written there but still I get an error
when I try to execute the client. This is the error:
"Exception in thread "main"java.lang.NoClassDefFoundError:
javax/naming/Context"
On seeing this error I tried to look for a jar file in weblogic/lib which
might be having a javax.naming.Context class. On finding such jar, which was
weblogicaux.jar, and other naming stuff I tried to run the client like this
at the command prompt:
"java
Djava..naming.factory.initial=weblogic.jndi.TengahInitialContextFactory -Dja
va.naming.provider.url=t3://localhost:7001 -classpath
e:\weblogic\lib\weblogicaux.jar HelloClient".
But my bad luck still did not part company with me. Then I got an even
longer error :) which is as follows:
javax.naming.NoInitialContextException: cannot instantiate class:
weblogic.jndi.TengahInitialContextFactory
Can somebody be kind enough to tell me where can I find this
TengahInitialContextFactory class so that I can add that too to my
classpath. I have not been able to locate this class anywhere.
Or is it not related to any classpath problem?
Thank you in advance,
Rahul Naithani.
===========================================================================
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".
This message and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
No confidentiality or privilege is waived or lost by any wrong transmission.
If you have received this message in error, please immediately destroy it
and kindly notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or
copy any part of this message if you are not the intended recipient.
Opinions, conclusions and other information in this message that do not
relate to the official business of Newknow shall be understood as neither
given nor endorsed by it.
===========================================================================
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".