-
1. Re: [jboss 3.0] jndi problem (NamingContextFactory)
dgadd Apr 25, 2002 8:56 PM (in response to dgadd)FURTHER on this:
I'm running my tests from unix command line, and I think it may be my classpath setting. It seems to work fine in jBoss 2.4.4, just not in jBoss 3.0.0 (where I need it to work).
Here's my procedure:
1) Start jBoss2.4.4
2) In the client window, set the following classpath environment:
setenv CLASSPATH "/System/Library/Frameworks/JavaVM.framework/Versions/1.3/Classes/classes.jar:/usr/local/jakarta-tomcat-4.0.3/common/lib/servlet.jar:/usr/local/jakarta-tomcat-4.0.3/webapps/ROOT/WEB-INF/bin/mm.mysql-2.0.11-bin.jar:/usr/local/jakarta-tomcat-4.0.3/webapps/ROOT/WEB-INF/classes:/usr/local/jboss2/jboss/lib/ext/jboss-j2ee.jar:/usr/local/jboss2/jboss/client/jboss-client.jar"
3) Run the client as follows:
java com.gaddzeit.zzexercises.CountClient
This works fine.
I then quit jBoss 2.4.4. And then:
1) Start jBoss3.0.0beta
2) In the client window, set the following classpath environment:
setenv CLASSPATH "/System/Library/Frameworks/JavaVM.framework/Versions/1.3/Classes/classes.jar:/usr/local/jakarta-tomcat-4.0.3/common/lib/servlet.jar:/usr/local/jakarta-tomcat-4.0.3/webapps/ROOT/WEB-INF/bin/mm.mysql-2.0.11-bin.jar:/usr/local/jakarta-tomcat-4.0.3/webapps/ROOT/WEB-INF/classes:/usr/local/jboss-3.0.0beta/lib/ext/jboss-j2ee.jar:/usr/local/jboss-3.0.0beta/client/jboss-client.jar"
3) Run the client as follows:
java com.gaddzeit.zzexercises.CountClient
In this case, I get the NamingException error as stated in the first message.
So--why does the same client connect to jndi on jBoss2.4.4, but not on jBoss 3.0.0? Does anybody see anything wrong with my classpath settings?
Thanks,
David Gadd -
2. Re: [jboss 3.0] jndi problem (NamingContextFactory)
vkie001 May 9, 2002 5:02 AM (in response to dgadd)Make sure the compiler can see "org.jnp.interfaces.NamingContextFactory", you should have this jar in your classpath when compile. This is one of the jboss jnpclient.jar locate in jboss/client directory.
-
3. Re: [jboss 3.0] jndi problem (NamingContextFactory)
ezaydens Dec 10, 2002 5:14 PM (in response to dgadd)I have a very similar problem. I wrote a small JMS client that sends msgs to pub/sub topic. I am trying to run it from the command line. I have compiled it with the classpath that included jnp-client.jar which contains NamingContextFactory. Still errors out. Any other ideas would be greatly appreciated...
-
4. Re: [jboss 3.0] jndi problem (NamingContextFactory)
nicknewman Dec 10, 2002 5:41 PM (in response to dgadd)Putting the JNDI properties in the code is not the standard way to do this in J2EE. It may be that JBoss has become a little stricter in what it will allow between 2.4 and 3.0.
The standard method is ALWAYS to get the initial context using the default constructor. Then, in the module's class path (i.e. under WEB-INF/classes if this is a web module, or at the root of the classes if this is an EJB module) create a jndi.properties file with the properties you need defined there. So it should look like:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost
java.naming.factory.url.pkgs=org.jboss.interfaces
I'd be interested to know if this fixes the problem. -
5. Re: [jboss 3.0] jndi problem (NamingContextFactory)
ezaydens Dec 11, 2002 12:01 PM (in response to dgadd)Nope, that did not do it (at least for me). What eliminated a problem was switching from jdk1.4.1_01 to 1.3.1_06 version. Something is not quite working correctly in the Sun's new release. Uf, was starting to get desperate there... :)
-
6. Re: [jboss 3.0] jndi problem (NamingContextFactory)
klagesb5 Mar 18, 2003 9:12 AM (in response to dgadd)I have this problem and I am actually using jdk1.3.1_06! Anyone any other ideas?