• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Unable to access EJB from Client App

Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have successfully deployed the EJB under /myserver/ directory, but when I try to run the client program the following error is reported :
javax.Naming.NoIniitialContextException : Need to specify class name in one or system property or as an applet parameter or in application resource
My client program is given below
import java.util.Properties;
import trial.*;
import javax.naming.*;
import java.rmi.*;
public class Client
public static void main(String s[])
Properties p = new Properties();
p.put(Context.PROVIDER_URL, "t3://localhost:7001";);
InitialContext ic = new InitialContext(p);
HelloHome home = (HelloHome)ic.lookup("trial.HelloHome");
Hello hel = home.create();
System.out.println("Msg from server...:" + hel.sayHello("Apt"));
}catch(Exception e){e.printStackTrace();}
Please help me out in solving the problem
Thanx in Advance
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roshini,
You have to first run setenv.cmd in your client window. You can find setenv.cmd in the WEBLOGIC_HOME directory. But doing this you will get the Weblogic classes in the CLASSPATH. Now run the client and it will not complain.
Hope this helps.
Roshini Sridharan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Desai.
I got it right. Thanx for ur help.
expectation is the root of all heartache - shakespeare. tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic