tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miller, Andy" <Andy.Mil...@hp.com>
Subject Tomcat / JBoss / JNDI lookup not working - HELP!
Date Mon, 03 Jun 2002 16:48:14 GMT
I have seperate instances of Tomcat and JBoss running on the same
machine.  I'm trying to do a JNDI lookup of a JMS queue that's
configured in JBoss from Tomcat but cannot get it to work.  I can see
the JNDI tree from the JBoss' JNDIView and all looks fine, here's a a
snapshot of the Global JNDI Namespace:
 

Global JNDI Namespace

  +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  +- jmx:miller-dp:rmi (class: org.jboss.jmx.server.RMIConnectorImpl)
  +- TopicConnectionFactory[link -> ConnectionFactory] (class:
javax.naming.LinkRef)
  +- UserTransactionSessionFactory (class:
org.jboss.tm.usertx.server.UserTransactionSessionFactoryImpl)
  +- RMIXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  +- QueueConnectionFactory[link -> ConnectionFactory] (class:
javax.naming.LinkRef)
  +- topic (class: org.jnp.interfaces.NamingContext)
  |   +- example (class: org.jboss.mq.SpyTopic)
  |   +- testTopic (class: org.jboss.mq.SpyTopic)
  |   +- bob (class: org.jboss.mq.SpyTopic)
  +- queue (class: org.jnp.interfaces.NamingContext)
  |   +- D (class: org.jboss.mq.SpyQueue)
  |   +- C (class: org.jboss.mq.SpyQueue)
  |   +- loggingQueue (class: org.jboss.mq.SpyQueue)
  |   +- B (class: org.jboss.mq.SpyQueue)
  |   +- A (class: org.jboss.mq.SpyQueue)
  |   +- controlQueue (class: org.jboss.mq.SpyQueue)
  |   +- testQueue (class: org.jboss.mq.SpyQueue)
  |   +- ex (class: org.jboss.mq.SpyQueue)
  |   +- DLQ (class: org.jboss.mq.SpyQueue)
  |   +- F (class: org.jboss.mq.SpyQueue)
  |   +- E (class: org.jboss.mq.SpyQueue)
  +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
  +- RMIConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
  +- UserTransaction (class:
org.jboss.tm.usertx.client.ClientUserTransaction)
  +- jmx (class: org.jboss.jmx.server.JMXAdaptorImpl)
  +- servercollector (class: org.jboss.management.ServerDataCollector)
  +- UILXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  +- UILConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)

I've copied the JNDI Properties to the tomcat/common/classes directory,
and copied all the client JARS to the tomcat/classes/lib directory.
Froma JSP running under Tomcat,  I do a new InitialContext() and then do
a  lookup on "QueueConnectionFactory" I get:
 
javax.servlet.ServletException: Name QueueConnectionFactory is not bound
in this Context
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:463)
	at
org.apache.jsp.test_0005fjndi$jsp._jspService(test_0005fjndi$jsp.java:17
3)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.java:202)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
	at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

When i I do execute the following code:
 
    Hashtable env = ctx.getEnvironment();
    Enumeration enum = env.keys();
    System.out.println("displayEnv number of keys "+env.size());
    while (enum.hasMoreElements()) {
        String key = (String)enum.nextElement();
        Object value = env.get(key);
        System.out.println(key+"="+value);
    }
I get:

	
java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
	java.naming.provider.url=localhost:1099
	
java.naming.factory.url.pkgs=org.apache.naming:org.jboss.naming:org.jnp.
interfaces

 
What am I doing wrong??? I've been banging my head against a wall for
three days over this.  Does anyone have any clues??? Oh, btw, I tried
changing the JBoss JNDI port to 1066, but it made no difference. Thanks.
 
Andy Miller
andy.miller@hp.com
HP Invent

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message