[jboss-user] [JNDI and Naming] - Re: javax.naming.CommunicationException

Derya Altuntas do-not-reply at jboss.com
Wed Apr 13 16:47:04 EDT 2011


Derya Altuntas [http://community.jboss.org/people/deryaaltuntas] created the discussion

"Re: javax.naming.CommunicationException"

To view the discussion, visit: http://community.jboss.org/message/599924#599924

--------------------------------------------------------------
I am receiving same error.My client class is below.In lookup method Communication error exits.I will send print of JMX-Console service=Naming
screen.I see that my port is 1098.I am setting correct URL?

public class Test {
 /**
  * @param args
  */
 public Test() {
 }

 public static void main(String[] args) throws FileNotFoundException, IOException, SecurityException{
  Test searchFacadeTest = new Test();
  searchFacadeTest.doTest();
 }

 public void doTest() throws FileNotFoundException, IOException{ 
  try {
   Context jndiContext = getInitialContext();
   FileManagerBeanRemote fileManager= (FileManagerBeanRemote)jndiContext.lookup("FileManagerBean/remote");
   //fileManager.moveFile("C:\\test.txt", "C:\\Documents and Settings\\tr1a6358\\bowling.txt");
  } 
  catch (Exception e) {
   e.printStackTrace();
  }
 }
 
 // developed for JBoss only. this is vender dependency
 public static Context getInitialContext( ) throws javax.naming.NamingException {
  Properties p = new Properties( );
  p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
  p.put(Context.PROVIDER_URL, "jnp://localhost:1098");
  Context context = new InitialContext(p);
  return context;
 }
}
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/599924#599924]

Start a new discussion in JNDI and Naming at Community
[http://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/20110413/4d9d1e4a/attachment.html 


More information about the jboss-user mailing list