Quantcast

Oracle DB access via Karaf

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Oracle DB access via Karaf

sijujohn
We are trying to configure the oracle database access through karaf.

Below is the link that we used as a reference.
https://github.com/cschneider/Karaf-Tutorial/blob/master/db/datasource/datasource-oracle.xml

The blueprint for datasource-oracle.xml for ojdbc6.jar:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">   
                <bean id="dataSource" class="oracle.jdbc.OracleDriver">     
                                <property name="url" value="jdbc:oracle:thin:@10.75.38.124:1521:D20KSTN"/>     
                                <property name="user" value="workflow_app"/>     
                                <property name="password" value="pass_w0rd"/> 
                </bean>   
               
                <service interface="javax.sql.DataSource" ref="dataSource">   
                                <service-properties>           
                                                <entry key="osgi.jndi.service.name" value="jdbc/oracleds"/>   
                                </service-properties> 
                </service>
</blueprint>


However, in karaf list we get the following error.

In Karaf list:
[ 201] [Active     ] [            ] [       ] [   60] wrap_mvn_ojdbc_ojdbc_11.2.0.2.0 (0)
[ 207] [Active     ] [Failure     ] [       ] [   60] datasource-oracle.xml (0.0.0)

karaf@trun> display-exception
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to find property descriptor url on class oracle.jdbc.OracleDriver
        at org.apache.aries.blueprint.container.BeanRecipe.getPropertyDescriptor(BeanRecipe.java:820)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:802)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:773)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:754)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:720)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:640)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:331)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)[9:org.apache.aries.blueprint:0.3.1]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_31]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_31]
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_31]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_31]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)[:1.6.0_31]
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_31]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_31]
        at java.lang.Thread.run(Thread.java:662)[:1.6.0_31]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oracle DB access via Karaf

uromahn
Kind of a late reply, but I hope this is still usefull:

properties of a Javabean defined in the blueprint.xml are case sensitive.

Please look at the detailed Javadoc for the oracle.jdbc.OracleDriver class and see how the url property is spelled:
Url or maybe URL?

Then adjust your blueprint.xml accordingly and everything should be happy.

-Uli
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Oracle DB access via Karaf

Siju
Thanks...
A day after my post, I got a response on a different forum that it should be uppercase (URL).
That fixed the issue.
Loading...