Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advice Client Problem

 
Vijay Gade
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I know this is a question that has been asked very frequently, but I could not get it to work.

This is basically about the jndi set up in the AdviceClient.java.

This is what I did:



Thanks,
-Vijay
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
I guess some thing may wrong in the Initial context look-up.
Here what you did
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put (Context.PROVIDER_URL, "iiop://localhost:3700");

please look for the port number 3700 is correct? did you use default port while creating your domain? or did you mention 3700?

usually default would be 7001 ..so try with that if you want to..

In WebLogic
JNDI_FACTORY= "weblogic.jndi.WLInitialContextFactory";
url = "t3://localhost:7001";
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, url);


and one more thing is ..if you are client also running on the same box, then you can use default way also

lets say

Context jndiContext = null;

try
{

jndiContext = new InitialContext();

Object o = jndiContext.lookup("AdviceBean");
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow (o, AdviceHome.class);
Advice = AdviceHome.create();

try this ...


Thanks,
Ugender
[ August 16, 2006: Message edited by: Ugender Rekulampally ]
 
Vijay Gade
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am positive about the iiop port. I went to the Application Server's General Tab in the admin gui, and that was where I found that 3700 was the port.
Basically, I am using J2EE 1.4 and SDK 1.5. Can that be any reason?

Thanks,
-V
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay,
"I am using J2EE 1.4 and SDK 1.5. Can that be any reason?"
I don't think this causing anything there.
Basically, you are client not able to get/locate the home stub from the server/container.

Did you try using the default Context that I showed you?

Thanks,
Ugender
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic