Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 36808 invoked from network); 19 Jul 2010 18:15:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Jul 2010 18:15:29 -0000 Received: (qmail 20805 invoked by uid 500); 19 Jul 2010 18:15:29 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 20758 invoked by uid 500); 19 Jul 2010 18:15:28 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 20749 invoked by uid 99); 19 Jul 2010 18:15:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jul 2010 18:15:28 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 74.125.82.173 as permitted sender) Received: from [74.125.82.173] (HELO mail-wy0-f173.google.com) (74.125.82.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jul 2010 18:15:23 +0000 Received: by wyb35 with SMTP id 35so4619583wyb.32 for ; Mon, 19 Jul 2010 11:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=vhxggUKiYAZbHR04OdGX4uxL74+bFT7pqHMQUXKaROg=; b=S96JsJZQ18Ztfg+zTjxcA/bkIUsdmO5j2uN7J3GYa7rsT0d5VCBDdeqK5e/wAucKQi +vsDC0KJVHdWsC83k+e/upyPaSTnfODI/G0hSaG1Y7pFf4x/7GUHXR6g2eYaAMJHsiZ9 rFHQfEG1rmYv0ZCpOXrFiVHdhSQTpwCaN9iyU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=whK8HWyZwKXMPaxQss3MRi4LCddTWbdpYWjLIUD+VCnzML+p7TleKaKIJ6grwx5utB U259I7yfEqrN4uahi+ir9N6EJoG9R82o6lAJJFg8lXYnm715GDXS0Y2c4pT5NQ1lJCFm b0KVqL3jS914byhm23SrD9Pptzh5RV515gP+o= Received: by 10.227.142.201 with SMTP id r9mr3127077wbu.38.1279563242181; Mon, 19 Jul 2010 11:14:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.230.16 with HTTP; Mon, 19 Jul 2010 11:13:41 -0700 (PDT) In-Reply-To: References: From: Claus Ibsen Date: Mon, 19 Jul 2010 20:13:41 +0200 Message-ID: Subject: Re: JMS Component WITHOUT Spring To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi On Mon, Jul 19, 2010 at 8:06 PM, Ron Smith wrote: > Where I work, Spring has been declared "evil" so I am attempting to use > camel without any of the Spring JARs but I can't find any examples of how to > setup a JMS component without a Spring dependency. I am using Tibco as the > JMS provider and it is providing JNDI. > It must be a touch workplace when a general considered standard framework is considered evil? The camel-jms component leverages spring-jms for sending and receiving JMS messages and therefore you cannot use it without spring-jms. You can use plain JMS API if you want to avoid Spring and build a JMS consumer. For examples see the ActiveMQ in Action which shows that. And I am sure you may find other examples by googling as well. To send the message to Camel is very easy from Java code. For example just use the ProducerTemplate API. > Here is a sample code snippet which shows the JNDI and JMS setup that I need > for the component: > > final CamelContext context = new DefaultCamelContext(); > final Hashtable env = new Hashtable(); > env.put(Context.INITIAL_CONTEXT_FACTORY, > "com.tibco.tibjms.naming.TibjmsInitialContextFactory"); > env.put(Context.PROVIDER_URL, Constants.TOPIC_PROVIDER_URL)); > env.put(Context.SECURITY_PRINCIPAL, Constants.TOPIC_SECURITY_PRINCIPAL)); > env.put(Context.SECURITY_CREDENTIALS, > Constants.TOPIC_SECURITY_CREDENTIALS)); > final Context jndiContext = new InitialContext(env); > final TopicConnectionFactory topicConnectionFactory = > (TopicConnectionFactory) > jndiContext.lookup(Constants.TOPIC_CONNECTION_FACTORY)); > > context.addComponent("tibco", > JmsComponent.jmsComponentAutoAcknowledge(topicConnectionFactory)); > > > This compiles without any Spring JARs but, when I run it I get the following > exception thrown by the last line of code: > > > Caused by: java.lang.ClassNotFoundException: > org.springframework.context.ApplicationContextAware > > > > NOTE: I am currently looking into the possibility that this is actually an > issue with the DefaultCamelContext being dependent on Spring rather that it > being a JMS or component issue. In any case, I would appreciate any advice > or guidance on this. > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus