wood burning stoves
The moose likes EJB and other Java EE Technologies and the fly likes Naming Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Naming Exception" Watch "Naming Exception" New topic

Naming Exception

arya bhat

Joined: Jun 17, 2005
Posts: 2

I ve this piece of code for the JNDI lookup in the Weblogic server 7.0 and i ve implemented this in the init() method of the Java Applet.I am getting the exception(in the client console) as given below.

This is the code:

Properties initialContextProperties = new Properties();
try {
String host=null;
InitialContext InitialContext;
String url = "t3://localhost:7001" ;
initialContextProperties.put(Context.PROVIDER_URL, url);
initialContextProperties.put(Context.SECURITY_PRINCIPAL, "xxx");
initialContextProperties.put(Context.SECURITY_CREDENTIALS, "yyy");
InitialContext = new InitialContext( initialContextProperties );
}catch( NamingException e ) {throw e;}

this is the exception i am getting--

javax.naming.CommunicationException. Root exception is java.net.ConnectException: No server found at T3://localhost:7001

at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:161)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:200)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContex tFactoryDelegate.java:195)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContex tFactoryDelegate.java:148)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory .java:123)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.ebag.espan.viewer.InvokingApplet.getConnection(InvokingApplet.java:165)
at com.ebag.espan.viewer.InvokingApplet.init(InvokingApplet.java:39)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Can anyone suggest a solution for this problem.?

Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Substitute localhost with the IP address or hostname of your machine and see if it works.

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
jQuery in Action, 3rd edition
subject: Naming Exception
It's not a secret anymore!