TOM smith [
https://community.jboss.org/people/gjx_xiang] created the discussion
"JNDI error"
To view the discussion, visit:
https://community.jboss.org/message/789432#789432
--------------------------------------------------------------
Properties prop = new Properties();
prop.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");
prop.put(Context.SECURITY_PRINCIPAL,
System.getProperty("username","user1"));
prop.put(Context.SECURITY_CREDENTIALS,
System.getProperty("password","12345"));
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
final Context ctx = new InitialContext(prop);
Object ref =
ctx.lookup("java:/eis/unionpayConnectionFactory");
unionpayConnectionFactory
acf=(unionpayConnectionFactory)ref;
unionpayConnection ac=acf.getConnection();
when the code was runned, there will be such a mistake:
javax.naming.NameNotFoundException: eis/unionpayConnectionFactory -- service
jboss.naming.context.java.jboss.exported.eis.unionpayConnectionFactory
at
org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)
at
org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
at
org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/789432#789432]
Start a new discussion in JNDI and Naming at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]