Hi,
I got NameNotFoundException for my following client main method program.
package client;
/*
* HelloClient.java
*
* Created on January 27, 2007, 8:37 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
import hello.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import javax.ejb.*;
import java.util.*;
/**
*
* @author Administrator
*/
public class HelloClient {
/** Creates a new instance of HelloClient */
public HelloClient() {
}
/**
* @param args the command line arguments
*/
public static void main(
String[] args) {
// TODO code application logic here
try
{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
p.put(Context.PROVIDER_URL,"file://localhost:3700"); //1099
Context context = new InitialContext(p);
Context ctx=(Context)context.lookup("java:/comp/env");
Object o=ctx.lookup("HelloLocalHome");
System.out.println("home object has been brought");
HelloLocalHome home=(HelloLocalHome)o;
HelloLocal advice=home.create();
System.out.println(advice.sayHello());
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}
but I got the error as follows.I need to get the answer.help me to solve it.
init:
deps-jar:
compile-single:
run-main:
javax.naming.NameNotFoundException; remaining name 'E:\localhost:3700'
at com.sun.jndi.fscontext.FSContext.checkExists(FSContext.java:850)
at com.sun.jndi.fscontext.FSContext.checkIsDirectory(FSContext.java:883)
at com.sun.jndi.fscontext.FSContext.<init>(FSContext.java:108)
at com.sun.jndi.fscontext.FSContext.<init>(FSContext.java:81)
at com.sun.jndi.fscontext.RefFSContext.<init>(RefFSContext.java:97)
at com.sun.jndi.fscontext.RefFSContextFactory.createContext(RefFSContextFactory.java:42)
at com.sun.jndi.fscontext.RefFSContextFactory.createContextAux(RefFSContextFactory.java:47)
at com.sun.jndi.fscontext.FSContextFactory.getInitialContext(FSContextFactory.java:49)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at client.HelloClient.main(HelloClient.java:36)
BUILD SUCCESSFUL (total time: 0 seconds)