2009/8/4 jworkman <jwork...@oidev.com>: > > I really need help, I am struggling to create queues and topics in ActiveMQ > and have them accessible from JNDI lookups. I need this > creation/registration to be done without bringing the server down, and done > without manual configuration. > > Something like: > > //create the jndi context > InitialContext jndiContext = new InitialContext(loadConnectionProps()); > > // Create a ConnectionFactory > ConnectionFactory connectionFactory = (ConnectionFactory) > jndiContext.lookup(loadConnectionProps().getProperty(Context.OBJECT_FACTORIES)); > > // Create a Connection > Connection connection = connectionFactory.createConnection(); > > // Create a Session > Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); > > // Create the destination (Topic or Queue) > session.createQueue(qname); > > ************this below doesn't work*********** > > //get the topic from jndi > topic = (Topic) ctx.lookup(name);
What names are you looking up? Did you read the section on "Dynamically creating destinations" here? http://activemq.apache.org/jndi-support.html -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/