Hi,
I'm new to JBoss and JMS, although I've used the J2EE
on other app servers. I've got a couple of questions about
connecting to JMS queues from standalone Java applications
(i.e., not from an EJB):

1) I'd like to use the default constructor for InitialContext,
   but no matter what I do to the CLASSPATH, the jndi.properties
   file isn't found. Is this because I'm connecting as a standalone
   client? Anyway, here are my attempts to set the CLASSPATH (in Windows 98):

SET
CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\lib\ext\jboss.jar;%JBOSS_HOME%\client\ejb.jar;%JBOSS_HOME%\client\jaas.jar;%JBOSS_HOME%\client\jbosssx-client.jar;%JBOSS_HOME%\client\jboss-client.jar;%JBOSS_HOME%\client\jbossmq-client.jar;%JBOSS_HOME%\client\jnp-client.jar
SET
CLASSPATH=%CLASSPATH%;%JBOSS_HOME%\lib\ext\jndi.jar;%JBOSS_HOME%\lib\ext\jms.jar;%JBOSS_HOME%\conf\default

I also tried explicitly naming jndi.properties on the CLASSPATH, but that didn't work 
either. So, I
was forced
to do the following (not very pretty):

            Context jndiContext = null;
            Properties env = new Properties();
            
            env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
            env.setProperty(Context.PROVIDER_URL, "localhost:1099");
            jndiContext = new InitialContext(env);

Does anyone know how to make jndi.properties appear on the CLASSPATH correctly so the 
InitialContext
default
constructor works properly?


2) I'd like to create my own Queue or Topic and then connect to it, but am unable to 
do so. I am
however, able
   to connect to Queue/Topic that JBoss already knows about (e.g., testQueue). While 
this is OK, how
do I create
   my own Queue/Topic? I've tried adding the following to jbossmq.xml (according to the
documentation):

        <Queue><Name>Votes</Name></Queue>

   However, this doesn't seem to work. I get the following - 
javax.naming.NameNotFoundException:
Votes not bound
   I'm assuming that I'm either not doing something OR that I'm doing something wrong. 
So, besides
adding the above
   entry to jbossmq.xml, what else do I need to do? Do I need to add this to a EAR 
file? Is there
some script I can
   run to create a new Queue/Topic?

Other than these issues, JMS seems to work OK on JBoss. Thanks for your help.

Tom Marrs

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to