Thanks for your answer Jean-Francois.
The QueueConnectionFactory indeed isnt defined in my web.xml <environment>
tags. I will see if I can find a good j2ee list to help me get along on the
road, but thx for tips

Gr
Ronald

----- Original Message -----
From: "Jean-Francois Arcand" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, October 24, 2002 23:31
Subject: Re: Retry, problems using j2ee JMS in Tomcat 4.x.x


> OK I will give a try. I think you have to define your
>
> QueueConnectionFactory
>
> in your web.xml file in order. Is it the case? Look at the Servlet Spec
for more info:
>
> http://jcp.org/aboutJava/communityprocess/first/jsr154/
>
> Specifically in the DTD section. Also, maybe a j2ee related list might be
the place to have a faster answer ;-)
>
> -- Jeanfrancois
>
>
>
> Ronald Haring wrote:
>
> >Hi all,
> >
> >Using win2k, JDK1.3.1, J2ee1.3.1.
> >
> >I have created a small JMS system to generate pdf files. I created a very
> >short test servlet.
> >In tomcat 3.2.3 my queue is found. In tomcat 4.0.4 and 4.1.12 I get the
next
> >error:
> >
> >NamingException
> >javax.naming.NameNotFoundException: Name QueueConnectionFactory is not
bound
> >in
> >this Context
> >at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
> >at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
> >at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
> >at org.apache.naming.NamingContext.lookup(NamingContext.java:181)
> >at org.apache.naming.NamingContext.lookup(NamingContext.java:822)
> >at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
> >at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
> >at javax.naming.InitialContext.lookup(InitialContext.java:350)
> >
> >My code is :
> >
> >protected void handle(HttpServletRequest request, HttpServletResponse
> >response) throws ServletException, IOException {
> >   try {
> >      // Create the initial context
> >      Context ctx = new InitialContext();
> >      Hashtable env = ctx.getEnvironment();
> >      Enumeration enum = env.keys();
> >      while (enum.hasMoreElements()) {
> >         String key = (String) enum.nextElement();
> >         System.out.println(key + " = " + env.get(key));
> >      }
> >      QueueConnectionFactory queueConnectionFactory = null;
> >      Queue queue = null;
> >      try {
> >         // The next definition works in tomcat 3.2.3
> >         queueConnectionFactory = (QueueConnectionFactory)
> >ctx.lookup("QueueConnectionFactory");
> >         queue = (Queue) ctx.lookup("generatePDF");
> >         // The next definition doesnt work in either tomcat
> >         //queueConnectionFactory = (QueueConnectionFactory)
> >ctx.lookup("java:comp/env/QueueConnectionFactory");
> >         //queue = (Queue) ctx.lookup("java:comp/env/generatePDF");
> >         System.out.println("Found the queue generatePDF");
> >      }
> >      catch (NamingException e) {
> >         System.out.println("NamingException");
> >         e.printStackTrace();
> >      }
> >      // Close the context when we're done
> >      ctx.close();
> >   }
> >   catch (NamingException e) {
> >      System.err.println("Problem " + e);
> >   }
> >}
> >
> >
> >And here is my JmsDestination and JmsFactory listing:
> >D:\jakarta-tomcat-4.0.4\bin>j2eeadmin -listJmsDestination
> >JmsDestination
> >--------------
> >< JMS Destination : sendPDF , javax.jms.Queue >
> >< JMS Destination : jms/Topic , javax.jms.Topic >
> >< JMS Destination : jms/Queue , javax.jms.Queue >
> >< JMS Destination : generatePDF , javax.jms.Queue >
> >D:\jakarta-tomcat-4.0.4\bin>j2eeadmin -listJmsFactory
> >JmsFactory
> >----------
> >< JMS Cnx Factory : QueueConnectionFactory , Queue , No properties >
> >< JMS Cnx Factory : jms/TopicConnectionFactory , Topic , No properties >
> >< JMS Cnx Factory : TopicConnectionFactory , Topic , No properties >
> >< JMS Cnx Factory : jms/QueueConnectionFactory , Queue , No properties >
> >D:\jakarta-tomcat-4.0.4\bin>
> >
> >After running the servlet on 3.2.3 I get 2 errors for loading ejb and
> >security.properties file, but after that it prints the following for the
> >enumeration
> >on the context:
> >java.naming.corba.orb = com.sun.enterprise.iiop.POAEJBORB@a49e0
> >
> >and for tomcat 4.0.4
> >java.naming.factory.initial =
org.apache.naming.java.javaURLContextFactory
> >java.naming.factory.url.pkgs =
org.apache.naming:com.sun.enterprise.naming
> >
> >So here is a big difference. The one from 3.2.3 appears to be an instance
of
> >a class
> >whereas the ones from 4.0.4 are just string representations of classes to
> >load.
> >
> >Now how can I activate my Jms system, in order for Tomcat 4.0.4 to find
it?
> >Or what should I do so Tomcat will be able to find my queues and use
them?
> >
> >
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-user-help@;jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to