[jboss-user] [JNDI and Naming] - JNDI error

TOM smith do-not-reply at jboss.com
Tue Jan 8 19:33:44 EST 2013


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&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130108/03491b63/attachment-0001.html 


More information about the jboss-user mailing list