1

I would like to implement Oracle Pooling DataSource using Spring as described here: http://docs.spring.io/spring-data/jdbc/docs/current/reference/html/orcl.datasource.html

However, I am getting this problem:

Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/data/orcl]
Offending resource: class path resource [applicationContext.xml]

In my understanding, this problem is caused because Spring is not able to locate Oracle JDBC Driver. However, the driver is in my classpath; so, I don't know what could be causing this problem.

applicationContext.xml

<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:tx="http://www.springframework.org/schema/tx"
     xmlns:jdbc="http://www.springframework.org/schema/jdbc"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:orcl="http://www.springframework.org/schema/data/orcl"
     xsi:schemaLocation="
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
     http://www.springframework.org/schema/data/orcl http://www.springframework.org/schema/data/orcl/spring-data-orcl-1.0.xsd">

<orcl:pooling-datasource
    id="dataSource"
    url="jdbc:oracle:thin:@//abc.ca:1527/abc_default.abc.ca"
    username="abc"
    password="abc"/>

pom.xml

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0</version>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.retry</groupId>
        <artifactId>spring-retry</artifactId>
        <version>1.1.2.RELEASE</version>
    </dependency>
2
  • Did you ever get to the bottom of this? I'm facing the same issue.
    – Jon C
    Jan 19, 2016 at 10:42
  • I gave up on this. I had too much problems with Oracle Pooling Datasource; so, I moved to C3P0 as described here: stackoverflow.com/questions/33553532/…
    – Rafa
    Jan 19, 2016 at 18:56

2 Answers 2

3

Seems there is missing dependency to spring-data-oracle. Try this:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-oracle</artifactId>
  <version>1.2.1.RELEASE</version>
</dependency>
0

JDBC drivers will not be accessible on the maven repository. You will need to download JDBC drivers manually from OTN

Install this on Maven using the following command.

mvn install:install-file -Dfile=/lib/12102/ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.1 -Dpackaging=jar -DgeneratePom=true

You can include the dependency in pom.xml as shown.

<dependency>
      <groupId>com.oracle</groupId>
      <artifactId>ojdbc7</artifactId>
      <version>12.1.0.1</version>
    </dependency>
1
  • JDBC Driver is already installed in my repository using similar approach. However, this brings me to a new question. I am second guessing if I have downloaded the correct driver. Will, re-download and test again. Thanks
    – Rafa
    Aug 15, 2015 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.