Hm. After spending a lot of time trying to figure out what went wrong, I finally tried rebooting the machine -- which I hate doing only because it doesn't explain anything -- and now I am able to communicate with JNDI (I do not get that infernal CommunicationException).

Thanks anyways for your input, Steven and Bill.


Erik





Steven Harris wrote:
The jndi.properties file that comes with the examples for the Admin and
Development guide loks like this:

### JBossNS properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

This works for us with ant.

-----Original Message-----
From: Erik Price [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 3:20 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] JNDI no longer working?




Bill Burke wrote:


It looks like you do not have any provider url set.  When this is true,
JBoss will try to discover the JNDI service via multicast.  Multicast may
not be running on your machine.  Are you running unplugged from network?


Hm... no, the machine has a dedicated network connection. Do you mean the java.naming.provider.url? I am running the client from within an Ant build file, and have defined it as a system property. Here is an example:

   <java
    classname="examples.${client.class}"
    failonerror="true"
    fork="true">
     <classpath refid="compile.classpath"/>
     <classpath refid="client.classpath"/>
     <sysproperty key="java.naming.factory.initial"
                  value="org.jnp.interfaces.NamingContextFactory"
     />
     <sysproperty key="java.naming.provider.url"
                  value="localhost:1099"
     />
   </java>

and just to make sure that the system properties are indeed being passed into my simple client program, I have even hardcoded these values like so:

         try {
             java.util.Properties props = new java.util.Properties();
             props.setProperty(
                 "java.naming.factory.initial",
                 "org.jnp.interfaces.NamingContextFactory");
             props.setProperty(
                 "java.naming.provider.url", "localhost:1099");
             Context ctx =
                 // new InitialContext(System.getProperties());
                 new InitialContext(props);
             Object obj = ctx.lookup("Account");
             AccountHome home =
                 (AccountHome)PortableRemoteObject.narrow(
                     obj,
                     AccountHome.class);

And in addition to "localhost:1099", I've tried "jnp://localhost:1099", as shown in the 3.2.x docs (p. 180).

I'm really bewildered. I've made no changes to the network settings of this box (Win2K w/Cygwin), and since I'm using a freshly-downloaded JBoss 3.2.1, I can't think of a single configuration within JBoss that may have caused the problem. It's just like the client program can't find an InitialContext or something.



Erik



-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps1 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user




------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to