I want to write a Remote Client communicating with a Topic deployed on my JBoss 3.2.6.
I have performed following steps.
1) Go to \\default\deploy\jms\jbossmq-destinations-service.xml.
2) Create a New Topic by adding following XML declaration to the file
<mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=myTopic">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
Now my AppClient looks as follows :
public class JBossClient {
public JBossClient()throws Exception {
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
properties.put(Context.PROVIDER_URL, "localhost:1099");
Context ctx = new InitialContext(properties);
System.out.println("Context Established ...");
Object ob = ctx.lookup("topic/myTopic");
System.out.println("Lookup successful ..." + ob);
}
public static void main(String[] args)throws Exception {
JBossClient client = new JBossClient();
}
}
Now the problem is I am not able to lookup the topic that i had configured in JBoss.
Can anybody tell me if I am wrong in Configuring the Topic itself or whether making any mistake while performing lookup ?