Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 71524 invoked from network); 19 Jan 2007 19:37:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jan 2007 19:37:19 -0000 Received: (qmail 71804 invoked by uid 500); 19 Jan 2007 19:37:25 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 71787 invoked by uid 500); 19 Jan 2007 19:37:25 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 71778 invoked by uid 99); 19 Jan 2007 19:37:25 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2007 11:37:25 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of sukoneru@cisco.com designates 171.68.10.86 as permitted sender) Received: from [171.68.10.86] (HELO sj-iport-4.cisco.com) (171.68.10.86) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2007 11:37:13 -0800 Received: from sj-dkim-7.cisco.com ([171.68.10.88]) by sj-iport-4.cisco.com with ESMTP; 19 Jan 2007 11:36:50 -0800 Received: from sj-core-4.cisco.com (sj-core-4.cisco.com [171.68.223.138]) by sj-dkim-7.cisco.com (8.12.11/8.12.11) with ESMTP id l0JJaoue007802 for ; Fri, 19 Jan 2007 11:36:50 -0800 Received: from xbh-sjc-211.amer.cisco.com (xbh-sjc-211.cisco.com [171.70.151.144]) by sj-core-4.cisco.com (8.12.10/8.12.6) with ESMTP id l0JJaknF016620 for ; Fri, 19 Jan 2007 11:36:50 -0800 (PST) Received: from xmb-sjc-21a.amer.cisco.com ([171.70.151.152]) by xbh-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 19 Jan 2007 11:36:43 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: active mq and tomcat 5.5 Date: Fri, 19 Jan 2007 11:36:42 -0800 Message-ID: <5BD9FA70F5EDAC43AB816A5FDE30F6AC0374259B@xmb-sjc-21a.amer.cisco.com> In-Reply-To: <45B117CA.1060702@exist.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: active mq and tomcat 5.5 Thread-Index: Acc7/ad4/bLxTQhkTbGU2cYCZ/eOqgAAo/mA From: "Suchitha Koneru \(sukoneru\)" To: X-OriginalArrivalTime: 19 Jan 2007 19:36:43.0886 (UTC) FILETIME=[265188E0:01C73C01] DKIM-Signature: v=0.5; a=rsa-sha256; q=dns/txt; l=4373; t=1169235410; x=1170099410; c=relaxed/simple; s=sjdkim7002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=sukoneru@cisco.com; z=From:=20=22Suchitha=20Koneru=20\(sukoneru\)=22=20 |Subject:=20RE=3A=20active=20mq=20and=20tomcat=205.5 |Sender:=20; bh=KTs0bHWGw+0xFqyVI9iHsjwesFxushvW6pCkYh67RK4=; b=kSx0eEz6sR7VRoURF1mQlC0KzRuKFCtxIVjLdmqbAE9jpMcpfRQL1YNW8XDwnM7mLX/gZI+g vFp4YBV9e/GK7uzpgfbxWQ92kYEvpVbIfPciGd1IbCLl6FZwk0f6LFTO; Authentication-Results: sj-dkim-7; header.From=sukoneru@cisco.com; dkim=pass ( sig from cisco.com/sjdkim7002 verified; ); X-Virus-Checked: Checked by ClamAV on apache.org Thanks for your response , I tried using the latest version of activemq jars (i.e 4.1) The class of the object being returned=20 Is=20 org.apache.activemq.ActiveMQConnectionFactory. I tried casting it to this type as well, but still I get the class cast exception=20 java.lang.ClassCastException: org.apache.activemq.ActiveMQConnectionFactory at com.cpnm.common.messaging.PNMSubscriber.(PNMSubscriber.java:45) I am not sure , as to what is going worng.=20 -----Original Message----- From: Adrian Co [mailto:aco@exist.com]=20 Sent: Friday, January 19, 2007 11:11 AM To: activemq-users@geronimo.apache.org Subject: Re: active mq and tomcat 5.5 Have you tried using the 4.1 jars? What is the class of the object being returned? Suchitha Koneru (sukoneru) wrote: > Hello active mq users , > > is there any good tutorial, which will explain configuring active mq=20 > on tomcat 5.5 ? I am running into the following issue. > > I have the following configuration on my system > > tomcat 5.5 > > java 1.5.09 > > activemq jars version 4.0 > > The active MQ broker is started , from the application .=20 > > the code for it is > > public void contextInitialized(ServletContextEvent arg0) { > > try{ > > System.out.println("Starting ActiveMQ Broker Service..."); > > broker.addConnector("tcp://localhost:61616?trace=3Dtrue"); > > broker.start(); > > System.out.println("Active MQ Broker Started at local host port=20 > 61616"); > > }catch(Exception e){ > > System.err.println(e.getMessage()); > > e.printStackTrace(); > > throw new RuntimeException(e); > > } > > } > > =20 > > In server.xml , I placed the JNDI resources as follows=20 > > > > auth=3D"Container"=20 > > type=3D"org.apache.activemq.ActiveMQConnectionFactory"=20 > > description=3D"JMS Connection Factory" > > factory=3D"org.apache.activemq.jndi.JNDIReferenceFactory"=20 > > brokerURL=3D"tcp://localhost:61716"=20 > > brokerName=3D"LocalActiveMQBroker"/> > > > auth=3D"Container"=20 > > type=3D"org.apache.activemq.command.ActiveMQTopic"=20 > > description=3D"sample Topic" > > factory=3D"org.apache.activemq.jndi.JNDIReferenceFactory"=20 > > physicalName=3D"FOO.BAR"/> > > > > I have a web app called UI , I am trying to access these global jndi=20 > recources from this web app, Hence the context.xml for this web app=20 > has the following > > > > name=3D"ConnectionFactory"global=3D"jms/TopicConnectionFactory" = type=3D=20 > "org.apache.activemq.ActiveMQConnectionFactory" /> > > "org.apache.activemq.command.ActiveMQTopic" /> > > > > The subsciber class in the UI context is as follows > > public class PNMSubscriber { > > TopicConnection tConn ; > > TopicConnectionFactory tFactory ; > > Topic pnmTopic; > > ActiveMQTopicSession pnmSession ; > > public PNMSubscriber(){ > > try{ > > InitialContext initialContext =3D new InitialContext(); > > Context envContext =3D (Context) = initialContext.lookup("java:comp/env"); > > tFactory > =3D(TopicConnectionFactory)envContext.lookup("ConnectionFactory"); > > tConn =3D tFactory.createTopicConnection(); > > pnmSession =3D (ActiveMQTopicSession) tConn.createTopicSession(true,=20 > Session.AUTO_ACKNOWLEDGE); > > pnmTopic =3D (Topic)envContext.lookup("PNMTopic"); > > pnmSubscriber =3D pnmSession.createSubscriber(pnmTopic); > > }catch(Exception e){ > > e.printStackTrace(); > > } > > } > > I get a class cast exception as follows > > java.lang.ClassCastException: > org.apache.activemq.ActiveMQConnectionFactory > > at > com.cpnm.common.messaging.PNMSubscriber.(PNMSubscriber.java:40) > > The exception is raised , at the following line , in the code above. > > tFactory =3D > (TopicConnectionFactory)envContext.lookup("ConnectionFactory"); > > I tried casting the object to "ActiveMQConnectionFactory" , I still=20 > get the same exception. > > I think, Iam missing something in the configuration, please let me=20 > know, if I need to add anything else. > > thank you, > > Suchitha. > > > =20