camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: porting camel routers (camel-jdbc) to servicemix4.0
Date Mon, 27 Apr 2009 03:36:11 GMT
Hi Gert,

I just found there is no spring-jdbc or common dbcp bundle below the
camel-jdbc feature.
Maybe we should consider reuse the spring-jdbc bundle or add the
commons-dbcp into ServiceMix bundle repository.

Willem


Gert Vanthienen wrote:
> 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 <matteo.redaelli@libero.it>:
>> Thanks for the quick answers
>>
>> FYI, I found and installed commons-dbcp and spring-jdbc  using features/list
>> and features/install (without adding new features urls, I use smx 4.0) but,
>> 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.  As 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.  From 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.  You could e.g. use
>>> Spring-DM to define the service in one bundle and then refer to that
>>> from another bundle.  Have 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 <matteo.redaelli@libero.it>:
>>>> Thanks for answer
>>>>
>>>> I installed also other features like
>>>>
>>>>  [ 161] [Active     ] [       ] [   60] Apache ServiceMix Bundles:
>>>> commons-dbcp-1.2.2 (1.2.2.3)
>>>>  [ 181] [Active     ] [       ] [   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 how
>>>> to
>>>> share more than one datasource in smx4/kernel
>>>>
>>>> http://trenaman.blogspot.com/2008/12/how-to-share-single-jdbc-pool-across.html
>>>> http://trenaman.blogspot.com/2008/12/sharing-oracle-jdbc-pool-in-smx4.html
>>>>
>>>> "Cameling" with databases is quite common, smx doesn't have at the moment
>>>> 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:
>>>>>  Cannot
>>>>>> find class [org.apache.commons.dbcp.BasicDataSource] for bean with
name
>>>>>> '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
>>>>> <matteo.redaelli@libero.it> 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    \
>>>>>>        -DarchetypeGroupId=org.springframework.osgi     \
>>>>>>        -DarchetypeArtifactId=spring-osgi-bundle-archetype      \
>>>>>>        -DarchetypeVersion=1.2.0-m2     \
>>>>>>        -DgroupId=pire.upms     \
>>>>>>        -DartifactId=pire-upms-users
>>>>>>        -Dversion=1.0-SNAPSHOT
>>>>>>
>>>>>> I installed all supposed camel features
>>>>>>
>>>>>> smx@root:/> osgi/list|grep camel
>>>>>> [  65] [Active     ] [       ] [   60] camel-core (1.6.0)
>>>>>> [  66] [Active     ] [       ] [   60] camel-osgi (1.6.0)
>>>>>> [  67] [Active     ] [       ] [   60] camel-spring (1.6.0)
>>>>>> [ 159] [Active     ] [       ] [   60] camel-ognl (1.6.0)
>>>>>> [ 160] [Active     ] [       ] [   60] camel-jms (1.6.0)
>>>>>> [ 162] [Active     ] [       ] [   60] camel-quartz (1.6.0)
>>>>>> [ 164] [Active     ] [       ] [   60] camel-jdbc (1.6.0)
>>>>>> [ 170] [Active     ] [       ] [   60] camel-velocity (1.6.0)
>>>>>> [ 172] [Active     ] [       ] [   60] camel-juel (1.6.0)
>>>>>> [ 182] [Active     ] [       ] [   60] camel-sql (1.6.0)
>>>>>> [ 186] [Active     ] [       ] [   60] camel-spring-integration (1.6.0)
>>>>>> [ 195] [Active     ] [       ] [   60] camel-jpa (1.6.0)
>>>>>> [ 201] [Active     ] [       ] [   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':
Cannot
>>>>>> resolve reference to bean 'camelContext' while setting bean property
>>>>>> 'camelContext'; nested exception is
>>>>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>>>>> 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
name
>>>>>> 'xxxxDB"
>>>>>>
>>>>>>
>>>>>> I have a similar error if I switch in my bean definition of datasource
>>>>>>
>>>>>> from
>>>>>>  class="org.apache.commons.dbcp.BasicDataSource"
>>>>>> to
>>>>>>  class="org.springframework.jdbc.datasource.DriverManagerDataSource"
>>>>>>
>>>>>> 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-servicemix4.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-servicemix-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.
>>
>>
> 


Mime
View raw message