Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat lookups JBossMQ name

Chris Wang
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In my Tomcat(4.1) application, I am trying to create a servlet to lookup a JBossMQ jms name in JBoss 3.2.1. The code is like this:

String icf = "org.jnp.interfaces.NamingContextFactory";
String url="jnp://localhost:1099";
Properties props = new Properties();
props.put( Context.INITIAL_CONTEXT_FACTORY, icf );
props.put( Context.PROVIDER_URL, url );
InitialContext ctx = new InitialContext(props);
System.out.println("got context!");
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup
System.out.println("found qcf!");

But I got an exception: "Name XAConnectionFactory is not bound in this Context".

What's wrong with above code? Or what kinds of jar files do I have to copy to Tomcat lib from Jboss?

Thank for any help!!!

[ May 02, 2005: Message edited by: chris wang ]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic