Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 54814 invoked from network); 25 Aug 2010 12:12:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Aug 2010 12:12:28 -0000 Received: (qmail 19154 invoked by uid 500); 25 Aug 2010 12:12:28 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 19026 invoked by uid 500); 25 Aug 2010 12:12:27 -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 19017 invoked by uid 99); 25 Aug 2010 12:12:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Aug 2010 12:12:26 +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 (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Aug 2010 12:12:21 +0000 Received: by qyk31 with SMTP id 31so476109qyk.11 for ; Wed, 25 Aug 2010 05:12:01 -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 :content-transfer-encoding; bh=sSsnQdMPRoIohgO/FbBQ+D986H2FCMb6cVbUWMoyeFo=; b=Wn7MQew8mxC7v31AGSjbQZsANVMlXH2sMNL9be/I+ADpsmMtDt1kwX3yPhDxh9+yJB MIbJtrkv82GEb9yUDk65zA0B3pOfWNUyzlRJN3NhrXxQdbqNPuo0Z+cnMYFBk3RCxJt7 RaRldVl2uLGACtqUxuQX+oHOMOMSVhYHJ8xYY= 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:content-transfer-encoding; b=Z4as/HgER1fp4cRrtiHdv7k01kqPwMLvtSP/VKDE/Bb5rDcOyI6vSlFRkJ+Ph5ZDmS K9T7C8sWCj3iYexa2ZP2rI3jOES6xUlCC+oZ2LSryLcadzA0IEs1MtMj6j01MGAxyQ0Q pdCdZay3zg4zehaZnoBL2UP+Gu4rP5EwlLkDQ= Received: by 10.229.96.16 with SMTP id f16mr5929125qcn.255.1282738320461; Wed, 25 Aug 2010 05:12:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.1.200 with HTTP; Wed, 25 Aug 2010 05:11:40 -0700 (PDT) In-Reply-To: <4C750764.5070004@scanmine.com> References: <4C750764.5070004@scanmine.com> From: Claus Ibsen Date: Wed, 25 Aug 2010 14:11:40 +0200 Message-ID: Subject: Re: camelContext depending on dataSource To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Can you post the code of your route On Wed, Aug 25, 2010 at 2:07 PM, Tarjei Huse wrote: > Hi, after upgrading to Camel 2.4.0 I am having a problem with some > routes that depend on Hibernate daos. > > It all started with this error message: > ... > Caused by: org.springframework.beans.factory.BeanCreationException: > Error creating bean with name 'dataSource' defined in class path > resource [applicationContext-HSQLdb.xml]: Initialization of bean failed; > nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'camelContext': Invocation of init method failed; nested > exception is org.apache.camel.RuntimeCamelException: > org.springframework.beans.factory.BeanCurrentlyInCreationException: > Error creating bean with name 'sessionFactory': FactoryBean which is > currently in creation returned null from getObject > ... > Caused by: org.springframework.beans.factory.BeanCreationException: > Error creating bean with name 'camelContext': Invocation of init method > failed; nested exception is org.apache.camel.RuntimeCamelException: > org.springframework.beans.factory.BeanCurrentlyInCreationException: > Error creating bean with name 'sessionFactory': FactoryBean which is > currently in creation returned null from getObject.. > > It seems that when I define a bean with dependencies on hibernate DAOs, > then the Camelcontext also becomse dependant on the sessionFactory, > someting I find very odd. > > This whole setup worked very nicely before I upgraded to Spring 3/Camel > 2.4.0. I just cannot understand what has causing this. According to > google the error usually shows up when I have circular dependencies, but > in this case that does not seem to be the issue. > > I have now refactored all objects so that they use setter injection, but > this doesn't help. No dice. It seems that the camelContext changes the > order that beans are created in. > > Basicly, this does not create the error: > =A0 =A0xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" > xmlns:aop=3D"http://www.springframework.org/schema/aop" > =A0 =A0xmlns:context=3D"http://www.springframework.org/schema/context" > =A0 =A0xmlns:camel=3D"http://camel.apache.org/schema/spring" > =A0 =A0xsi:schemaLocation=3D" > =A0 =A0 =A0 http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans.xsd > =A0 =A0 =A0 http://camel.apache.org/schema/spring > http://camel.apache.org/schema/spring/camel-spring.xsd > =A0 =A0 =A0 =A0 =A0 =A0http://www.springframework.org/schema/aop > =A0 =A0 =A0 =A0 =A0 =A0http://www.springframework.org/schema/aop/spring-a= op.xsd > =A0 =A0 =A0 =A0 =A0 http://www.springframework.org/schema/context > =A0 =A0 =A0 =A0 =A0 http://www.springframework.org/schema/context/spring-= context.xsd > =A0 =A0 =A0 "> > class=3D"com.scanmine.router.routes.IndexLookupRoute" =A0/> > > =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0* > =A0 =A0 =A0 =A0 > > > But the route is not loaded into the camel process. While this: > =A0 =A0 > =A0 =A0 =A0 =A0 > > > Generates the error above. > > Any tips? > > -- > > Regards / Med vennlig hilsen > Tarjei Huse > Mobil: 920 63 413 > > --=20 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