Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 23628 invoked from network); 26 Apr 2009 19:13:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Apr 2009 19:13:54 -0000 Received: (qmail 40649 invoked by uid 500); 26 Apr 2009 19:13:54 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 40585 invoked by uid 500); 26 Apr 2009 19:13:54 -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 40575 invoked by uid 99); 26 Apr 2009 19:13:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Apr 2009 19:13:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gert.vanthienen@gmail.com designates 209.85.218.226 as permitted sender) Received: from [209.85.218.226] (HELO mail-bw0-f226.google.com) (209.85.218.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Apr 2009 19:13:43 +0000 Received: by bwz26 with SMTP id 26so1867948bwz.20 for ; Sun, 26 Apr 2009 12:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=KfCMI/L5cDiYnpbLNFzxJID7bfaL4XVuRDLgReZTnPM=; b=XMMBoX//GBdTOVKH/+yvpKW943fakdDyxuhm7pmxaBX87K5a1Qf8FGGrxvmSJRBL40 K0X6MWVXVZvHou+s+j3mPlB1ioUV8T2POB6FnPK9ELj04Paef+cc95lF+zGwSD+w/Ou2 /KJ4X66tmEFyH4zMzX/Yih1Ar3ZIxG/jeMJi0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mv+OP7bguceGBlgJV8nRPjRgjG5PzfJQvIRtD1VqUCyapaV+A4W58R1ZDkTXEMjr9C 0Enfq2WAJkaKJWp5M0pJSmrZj1T5fGRJMpm7i9Dg2Yiud/gFpGNgoER1iFsvDFlopR5+ 83eX0EfwuC3NyJIoU4OLVSIgm4PGNAJ7A1U7Q= MIME-Version: 1.0 Received: by 10.204.59.76 with SMTP id k12mr4477411bkh.136.1240773202421; Sun, 26 Apr 2009 12:13:22 -0700 (PDT) In-Reply-To: <23242524.post@talk.nabble.com> References: <23197888.post@talk.nabble.com> <5380c69c0904232152v75b0f809kdd6ac90e223c6da5@mail.gmail.com> <23240445.post@talk.nabble.com> <67a6ab030904260508s2ecb0e88ia6e6ada4bf3e3932@mail.gmail.com> <23242524.post@talk.nabble.com> Date: Sun, 26 Apr 2009 21:13:22 +0200 Message-ID: <67a6ab030904261213m7b7118a8s60b5a1671b85f458@mail.gmail.com> Subject: Re: porting camel routers (camel-jdbc) to servicemix4.0 From: Gert Vanthienen To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Matteo, Could you try adding an OSGi import for the dbcp or spring-jdbc packages to your bundle? The bundle plugin doesn't look into the Spring XML file to figure out what imports to add to your bundle, so it might not be able to see the class you're looking for. Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/4/26 Matteo Redaelli : > > Thanks for the quick answers > > FYI, I found and installed commons-dbcp and spring-jdbc =A0using features= /list > and features/install (without adding new features urls, I use smx 4.0) bu= t, > as I said, I have the same error messages.... > > In the meanwhile I'll keep my old camel-jdbc-spring projects outside smx4 > :-( > > Many thanks > Matteo > > > Gert Vanthienen wrote: >> >> Matteo, >> >> The camel-jdbc feature doesn't load the commons-dbcp or spring-jdbc >> stuff because it doesn't really depend on it. =A0As you have shown >> yourself, you can use either one of them to define the DataSource >> object (there are even other options out there, e.g. C3PO), so I guess >> we can't really manage those for you. >> >> Doing another tutorial page would be a good idea though, so we can >> give people an idea on how to solve this kind of issue. =A0From a >> development perspective, I'm also wondering if we can't make this a >> bit more easy for end users by reading the Spring context file and >> doing more imports or something... >> >> ServiceMix 4 itself ships with JNDI support, so you could use JNDI >> there, but for ServiceMix Kernel, I guess the OSGi Service Registry >> would be the best way to share a DataSource. =A0You could e.g. use >> Spring-DM to define the service in one bundle and then refer to that >> from another bundle. =A0Have a look at >> http://static.springframework.org/osgi/docs/1.2.0/reference/html/service= -registry.html >> to find our more about this. >> >> Regards, >> >> Gert Vanthienen >> ------------------------ >> Open Source SOA: http://fusesource.com >> Blog: http://gertvanthienen.blogspot.com/ >> >> >> >> 2009/4/26 Matteo Redaelli : >>> >>> Thanks for answer >>> >>> I installed also other features like >>> >>> =A0[ 161] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] Apache ServiceMix= Bundles: >>> commons-dbcp-1.2.2 (1.2.2.3) >>> =A0[ 181] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] Spring JDBC (2.5.= 6) >>> >>> but I have the same problem. I'll go on adding something more. But from >>> the >>> end user point of view this is quite strange: should the feature >>> "camel-jdbc" be responsable of loading all other "low level" necessary >>> libraries? >>> >>> In any case, if I can give a suggestion to Camel/smx4 team, it would be >>> nice >>> to have an example/wiki page about using camel-jdbc in smx4/osgi. And h= ow >>> to >>> share more than one datasource in smx4/kernel >>> >>> http://trenaman.blogspot.com/2008/12/how-to-share-single-jdbc-pool-acro= ss.html >>> http://trenaman.blogspot.com/2008/12/sharing-oracle-jdbc-pool-in-smx4.h= tml >>> >>> "Cameling" with databases is quite common, smx doesn't have at the mome= nt >>> a >>> jbi servicemix-jdbc component, so camel-jdbc is the way if you do not >>> want >>> to write java code... >>> >>> Regards >>> Matteo >>> >>> >>> Claus Ibsen-2 wrote: >>>> >>>> Hi >>>> >>>> You need some additional .jars on the classpath. So you need to >>>> install more .jars into the OSGi. >>>> >>>> You should look at the exception: >>>> =A0Cannot >>>>> find class [org.apache.commons.dbcp.BasicDataSource] for bean with na= me >>>>> 'xxxxDB" >>>> >>>> Where it states that it cannot find the class above. Then you need to >>>> find the .jar that contains this .class and install it. >>>> >>>> Some of the .jars can be found here: >>>> http://servicemix.apache.org/SMX4/bundles-repository.html >>>> >>>> >>>> >>>> >>>> >>>> On Thu, Apr 23, 2009 at 9:19 PM, Matteo Redaelli >>>> wrote: >>>>> >>>>> ciao >>>>> >>>>> I'm trying to port a maven project to the osgi container servicemix4.= 0. >>>>> I >>>>> created a new project with >>>>> >>>>> mvn archetype:create =A0 =A0\ >>>>> =A0 =A0 =A0 =A0-DarchetypeGroupId=3Dorg.springframework.osgi =A0 =A0 = \ >>>>> =A0 =A0 =A0 =A0-DarchetypeArtifactId=3Dspring-osgi-bundle-archetype = =A0 =A0 =A0\ >>>>> =A0 =A0 =A0 =A0-DarchetypeVersion=3D1.2.0-m2 =A0 =A0 \ >>>>> =A0 =A0 =A0 =A0-DgroupId=3Dpire.upms =A0 =A0 \ >>>>> =A0 =A0 =A0 =A0-DartifactId=3Dpire-upms-users >>>>> =A0 =A0 =A0 =A0-Dversion=3D1.0-SNAPSHOT >>>>> >>>>> I installed all supposed camel features >>>>> >>>>> smx@root:/> osgi/list|grep camel >>>>> [ =A065] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-core (1.6.= 0) >>>>> [ =A066] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-osgi (1.6.= 0) >>>>> [ =A067] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-spring (1.= 6.0) >>>>> [ 159] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-ognl (1.6.0) >>>>> [ 160] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-jms (1.6.0) >>>>> [ 162] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-quartz (1.6.= 0) >>>>> [ 164] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-jdbc (1.6.0) >>>>> [ 170] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-velocity (1.= 6.0) >>>>> [ 172] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-juel (1.6.0) >>>>> [ 182] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-sql (1.6.0) >>>>> [ 186] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-spring-integ= ration (1.6.0) >>>>> [ 195] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-jpa (1.6.0) >>>>> [ 201] [Active =A0 =A0 ] [ =A0 =A0 =A0 ] [ =A0 60] camel-ibatis (1.6.= 0) >>>>> >>>>> I also added the same dependences in pom.xml I used in my old camel >>>>> project >>>>> >>>>> but when I deploy my .jar in deploy folder I get >>>>> >>>>> "Error creating bean with name 'camelContext:beanPostProcessor': Cann= ot >>>>> resolve reference to bean 'camelContext' while setting bean property >>>>> 'camelContext'; nested exception is >>>>> org.springframework.beans.factory.BeanCreationException: Error creati= ng >>>>> bean >>>>> with name 'camelContext': Invocation of init method failed; nested >>>>> exception >>>>> is org.springframework.beans.factory.CannotLoadBeanClassException: >>>>> Cannot >>>>> find class [org.apache.commons.dbcp.BasicDataSource] for bean with na= me >>>>> 'xxxxDB" >>>>> >>>>> >>>>> I have a similar error if I switch in my bean definition of datasourc= e >>>>> >>>>> from >>>>> =A0class=3D"org.apache.commons.dbcp.BasicDataSource" >>>>> to >>>>> =A0class=3D"org.springframework.jdbc.datasource.DriverManagerDataSour= ce" >>>>> >>>>> What's worng? missing features/bundles? >>>>> >>>>> Regards >>>>> Matteo Redaelli >>>>> http://www.redaelli.org/matteo/ >>>>> >>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://www.nabble.com/porting-camel-routers-%28camel-jdbc%29-to-servi= cemix4.0-tp23197888p23197888.html >>>>> Sent from the Camel - Users mailing list archive at Nabble.com. >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Claus Ibsen >>>> Apache Camel Committer >>>> >>>> Open Source Integration: http://fusesource.com >>>> Blog: http://davsclaus.blogspot.com/ >>>> Twitter: http://twitter.com/davsclaus >>>> Apache Camel Reference Card: >>>> http://refcardz.dzone.com/refcardz/enterprise-integration >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Porting-camel-routes-%28camel-jdbc%29-to-servicem= ix-4.0-tp23197888p23240445.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> ----- >> --- >> Gert Vanthienen >> http://gertvanthienen.blogspot.com >> > > -- > View this message in context: http://www.nabble.com/Porting-camel-routes-= %28camel-jdbc%29-to-servicemix-4.0-tp23197888p23242524.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >