Fuse Datasource Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Fuse Datasource Problem

raja
Hi,

  I don't know whether it is the right place to ask.Im trying to create datasource in fuse. The Datasource works fine as Camel standalone Application.

Im using ANT for build task(not maven).

 

Fuse DataSource:

<bean id="ds" class="org.apache.commons.dbcp.BasicDataSource">

    <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerConnection"/>           

    <property name="url" value="${dburl}"/>

    <property name="username" value="${dbuname}"/>

    <property name="password" value="${dbpwd}"/>       

</bean>

 

In camel I used "org.springframework.jdbc.datasource.SimpleDriverDataSource" as class.

 

When I convert it to blueprint and deploy it in the Fuse following error Shows:

 
2017-06-08 10:17:07,617 | ERROR | l Console Thread | BlueprintContainerImpl       | 23 - org.apache.aries.blueprint.core - 1.4.5 | Unable to start blueprint container for bundle name.jar/0.0.0

org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to load class org.apache.commons.dbcp.BasicDataSource from recipe BeanRecipe[name='ds']

    at org.apache.aries.blueprint.di.AbstractRecipe.doLoadType(AbstractRecipe.java:195)

    at org.apache.aries.blueprint.di.AbstractRecipe.loadType(AbstractRecipe.java:161)

    at org.apache.aries.blueprint.container.BeanRecipe.loadClass(BeanRecipe.java:250)

    at org.apache.aries.blueprint.container.BeanRecipe.getType(BeanRecipe.java:917)

    at org.apache.aries.blueprint.container.BeanRecipe.getInstanceFromType(BeanRecipe.java:341)

    at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:282)

    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:830)

    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)

    at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)

    at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]

    at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)

    at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:247)

    at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)

    at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:688)

    at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:383)

    at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:270)

    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)

    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)

    at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)

    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[17:org.apache.aries.util:1.1.0]

    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[17:org.apache.aries.util:1.1.0]

    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[17:org.apache.aries.util:1.1.0]

    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[17:org.apache.aries.util:1.1.0]

    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)

    at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)

    at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)

    at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)

    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)

    at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)

    at org.apache.felix.framework.Felix.updateBundle(Felix.java:2412)

    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:994)

    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:981)

    at org.apache.karaf.util.bundles.BundleUtils.update(BundleUtils.java:43)

    at org.apache.karaf.util.bundles.BundleUtils.update(BundleUtils.java:36)

    at org.apache.karaf.shell.osgi.UpdateBundle.doExecute(UpdateBundle.java:37)

    at org.apache.karaf.shell.osgi.BundleCommand.doExecute(BundleCommand.java:41)

    at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)

    at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)

    at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_121]

    at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_121]

    at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:54)[19:org.apache.aries.proxy.impl:1.0.5]

    at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119)[19:org.apache.aries.proxy.impl:1.0.5]

    at org.apache.karaf.shell.console.commands.$BlueprintCommand2065848678.execute(Unknown Source)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.karaf.shell.console.jline.Console.run(Console.java:197)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

    at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)[38:org.apache.karaf.shell.console:2.4.0.redhat-630187]

Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource not found by camelEmail.jar [335]

    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)

    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)

    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_121]

    at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1853)

    at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:958)

    at org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:439)

    at org.apache.aries.blueprint.container.BlueprintRepository.loadClass(BlueprintRepository.java:410)

    at org.apache.aries.blueprint.container.GenericType.parse(GenericType.java:113)

    at org.apache.aries.blueprint.di.AbstractRecipe.doLoadType(AbstractRecipe.java:168)

    ... 52 more

 

 

I also tried to wrap using:

osgi:install -s wrap:mvn:commons-dbcp/commons-dbcp/1.4

wrap result:

>osgi:list
[ 338] [Active ] [         ] [   ] [   80] Commons DBCP (1.4)

 

 

How to resolve this problem?
Reply | Threaded
Open this post in threaded view
|

Re: Fuse Datasource Problem

jjansen
I don't think that this is a problem of camel, more your integration into the OSGi container.
May you should post your question also to the servicemix forum.

In servicemix 7.0.0 there should be no need to wrap the commons-dbcp as it is provided out of the box.

karaf@root>exports | grep org.apache.commons.dbcp
org.apache.commons.dbcp.cpdsadapter     | 1.4.0 | 94  | org.apache.commons.dbcp
org.apache.commons.dbcp.datasources     | 1.4.0 | 94  | org.apache.commons.dbcp
org.apache.commons.dbcp.managed         | 1.4.0 | 94  | org.apache.commons.dbcp
org.apache.commons.dbcp                       | 1.4.0| 94  | org.apache.commons.dbcp
org.apache.commons.jocl                        | 1.4.0 | 94  | org.apache.commons.dbcp


karaf@root>list |grep -i commons
 93 | Active   |  50 | 3.2.2                              | Apache Commons Collections
 94 | Active   |  50 | 1.4                                 | Commons DBCP
 95 | Active   |  50 | 2.0.1                              | Commons JEXL
 97 | Active   |  50 | 3.4.0                              | Apache Commons Lang
 98 | Active   |  50 | 3.5.0                              | Apache Commons Net
 99 | Active   |  50 | 1.6.0                              | Commons Pool
100 | Active  |  50 | 2.4.2                              | Apache Commons Pool
karaf@root>

Also you should check the dependency to it in ant.

Rgds,
Jörg
Reply | Threaded
Open this post in threaded view
|

Re: Fuse Datasource Problem

Grzegorz Grzybek
Hello, the problem is opposite. You have:

org.apache.commons.dbcp.BasicDataSource not found by camelEmail.jar
>

which means it's camelEmail.jar that has wrong Import-Package.

regards
Grzegorz Grzybek

2017-06-09 8:01 GMT+02:00 jjansen <[hidden email]>:

> I don't think that this is a problem of camel, more your integration into
> the
> OSGi container.
> May you should post your question also to the servicemix forum.
>
> In servicemix 7.0.0 there should be no need to wrap the commons-dbcp as it
> is provided out of the box.
>
> karaf@root>exports | grep org.apache.commons.dbcp
> org.apache.commons.dbcp.cpdsadapter     | 1.4.0 | 94  |
> org.apache.commons.dbcp
> org.apache.commons.dbcp.datasources     | 1.4.0 | 94  |
> org.apache.commons.dbcp
> org.apache.commons.dbcp.managed         | 1.4.0 | 94  |
> org.apache.commons.dbcp
> org.apache.commons.dbcp                       | 1.4.0| 94  |
> org.apache.commons.dbcp
> org.apache.commons.jocl                        | 1.4.0 | 94  |
> org.apache.commons.dbcp
>
>
> karaf@root>list |grep -i commons
>  93 | Active   |  50 | 3.2.2                              | Apache Commons
> Collections
>  94 | Active   |  50 | 1.4                                 | Commons DBCP
>  95 | Active   |  50 | 2.0.1                              | Commons JEXL
>  97 | Active   |  50 | 3.4.0                              | Apache Commons
> Lang
>  98 | Active   |  50 | 3.5.0                              | Apache Commons
> Net
>  99 | Active   |  50 | 1.6.0                              | Commons Pool
> 100 | Active  |  50 | 2.4.2                              | Apache Commons
> Pool
> karaf@root>
>
> Also you should check the dependency to it in ant.
>
> Rgds,
> Jörg
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Fuse-Datasource-Problem-tp5802578p5802699.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Fuse Datasource Problem

raja
This post has NOT been accepted by the mailing list yet.
thank you for your reply jjansen and Grzegorz Grzybek.
Im working on it