Hello
I am trying to create the queues though the mbean but facing a problem when trying to do so.
Here is the code
try {
InitialContext iniCtx = new InitialContext();
RMIAdaptor server = (RMIAdaptor) iniCtx.lookup("jmx/rmi/RMIAdaptor");
ObjectName name = new ObjectName("jboss.mq:service=DestinationManager");
server.invoke( name, "createQueue", new Object[] { queueName,queueName }, new String[] {String.class.getName(),String.class.getName()});
boolean done = false;
Object tmp;
tmp = iniCtx.lookup("ConnectionFactory");
System.err.println("Found ConnectionFactory!");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
queue = (Queue) iniCtx.lookup("queue/requestq");
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
}
catch (Exception e){
System.err.println("Exception Caught! " + e);
e.printStackTrace();
throw e;
}
}
Whenever the jboss trys to load this mbean in the start up it gives up exception saying "ConnectionFactory not bound" but the interesting part is that once the jboss is up and running if I do the hot deploy mbean works perfectly.
Jboss-service.xml looks like
jboss.mq:service=DestinationManager
jboss:service=Naming
I would appreciate any help