Hi,

There are quite a number of examples related to JMS usage that comes with 
the JBoss source. Take a look at it. What you need should be in there.

Thomas Hii


>From: "thomas" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>Subject: Re: [JBoss-dev] Help With Exception: 
>java.lang.NoClassDefFoundError: org/jboss/security/SecurityAssociation
>Date: Fri, 20 Apr 2001 17:43:38 +0800
>
>Hello EveryBody:
>         Does somebody Know how to use jndi to lookup JMS Service ??
>I am getting in trouble in doing this ...(Can't find the name)Because there
>is do documentation for us to
>resolve this problem ..As follows is my test code to find
>java:/DefaultJMSProvider service.
>Please Help me...Thanks A Lot.
>....
>
>import java.util.Properties;
>import javax.jms.*;
>import javax.naming.*;
>import java.util.*;
>
>public class TestServer {
>     Context jndi;
>     Hashtable env=new Hashtable();
>   public TestServer() throws
>javax.jms.JMSException,javax.naming.NamingException{
>
>env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFac
>tory");
>     env.put(Context.PROVIDER_URL,"localhost");
>    // env.put("java.naming.rmi.security.manager","yes");
>    // env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming");
>
>     jndi=new InitialContext(env);
>     Object _ref = jndi.lookup("JmsTopicConnectionFactory");
>     //JMSProviderAdapter _ref =(JMSProviderAdapeter)
>jndi.lookup("java:/DefaultJMSProvider");
>     System.out.println(_ref.toString());
>   }
>   public static void main(String[] args)throws 
>NamingException,JMSException
>{
>     TestServer testServer1 = new TestServer();
>   }
>}
>
>
>
>
>
>
>_______________________________________________
>Jboss-development mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/jboss-development

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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

Reply via email to