#1 2012-06-13 00:52:26

sijujohn
Member
Registered: 2012-05-29
Posts: 16

[resolved] Oracle DB access via Karaf

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

[This issue probably is not related to talend but wanted to see if anyone has encounter similar problems.]

Below is the link that we used.
https://github.com/cschneider/Karaf-Tut … 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]

Offline

#2 2012-06-13 09:13:37

cschneider
Talend Team
Registered: 2011-05-27
Posts: 23
Website

Re: [resolved] Oracle DB access via Karaf

You are using the wrong class from Oracle. Try to use oracle.jdbc.pool.OracleDataSource instead of OracleDriver.

Christian

Offline

#3 2012-06-13 16:08:02

sijujohn
Member
Registered: 2012-05-29
Posts: 16

Re: [resolved] Oracle DB access via Karaf

The result was the same using oracle.jdbc.pool.OracleDataSource.

Thanks.

Offline

#4 2012-06-13 16:36:56

zbe
Member
Registered: 2011-05-31
Posts: 59

Re: [resolved] Oracle DB access via Karaf

I suspect you still inadvertently use the old blueprint file with the wrong class. Bundles (and the blueprint file is seen as bundle by the OSGi container) are cached in the data directory. Make sure to explicitly uninstall the datasource-oracle.xml bunlde before installing the new one. Removing bundles or blueprint configurations from the deploy folder does not lead to uninstallation of the bundle.
oracle.jdbc.pool.OracleDataSource is definetly the way to go.

Zsolt

Offline

#5 2012-06-13 16:42:08

cschneider
Talend Team
Registered: 2011-05-27
Posts: 23
Website

Re: [resolved] Oracle DB access via Karaf

I just checked on my karaf and you are right. The problem is that the URL property has to be in uppercase. I just corrected the git datasource file. The bean should now look like this:

<bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource">
      <property name="URL" value="jdbc:oracle:thin:@localhost:1521:orcl"/>
      <property name="user" value="test"/>
      <property name="password" value="test"/>
  </bean>

Does this work for you?

Last edited by cschneider (2012-06-13 16:42:38)

Offline

#6 2012-06-13 17:19:33

sijujohn
Member
Registered: 2012-05-29
Posts: 16

Re: [resolved] Oracle DB access via Karaf

Excellent.... It works. Thanks a lot...

Offline

Board footer

Powered by FluxBB