Lily
Lily

Reputation: 215

Failure to find com.oracle:ojdbc14:jar:10.4.4

I am trying to run a spring mvc and hibernate project, I am getting the following error:

Failed to execute goal on project spring-mvc-tiles-hibernate: Could not resolve dependencies for project com.sprin.mvc:spring-mvc-tiles-hibernate:war:0.0.1-SNAPSHOT: Failure to find com.oracle:ojdbc14:jar:10.4.4 in http://192.168.200.35:8080/artifactory/libs-release was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

Below is my pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sprin.mvc</groupId>
  <artifactId>spring-mvc-tiles-hibernate</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>spring-mvc-tiles-hibernate</name>
  <url>http://maven.apache.org</url>
  <build>
        <finalName>spring-mvc-tiles-hibernate</finalName>
        <!-- <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> 
            <configuration> In version 2.1-alpha-1, this was incorrectly named warSourceExcludes 
            <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> <archive> <manifest> 
            <addClasspath>true</addClasspath> <classpathPrefix>C:/Users/hunaid.husain/workspace/rest-web-app/target/rest-web-app/WEB-INF/lib/</classpathPrefix> 
            </manifest> </archive> </configuration> </plugin> </plugins> -->
    </build>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>3.2.2.RELEASE</spring.version>
        <java.version>1.6</java.version>
        <servlet-api.version>2.5.0</servlet-api.version>
        <dwr.version>3.0.0-rc3-SNAPSHOT</dwr.version>
        <tiles-version>2.2.2</tiles-version>
        <slf4j.version>1.6.1</slf4j.version>
        <jackson.version>2.0.4</jackson.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>
        <!-- JSTL -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

        <!-- for compile only, your container should have this -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.8</version>
        </dependency>

        <!-- Hibernate dependencies -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.1.4.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>4.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.0.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc</artifactId>
            <version>10.2.0.4.0</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.7</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-core</artifactId>
            <version>${tiles-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>${tiles-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-api</artifactId>
            <version>${tiles-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-servlet</artifactId>
            <version>${tiles-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-template</artifactId>
            <version>${tiles-version}</version>
        </dependency>
                <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>
                 <!-- Json via Jackson 2.0 -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
    <dependency>
      <groupId>displaytag</groupId>
      <artifactId>displaytag</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
            <groupId>org.directwebremoting</groupId>
            <artifactId>dwr</artifactId>
            <version>${dwr.version}</version>
    </dependency>
    <dependency>
     <groupId>com.googlecode.json-simple</groupId>
     <artifactId>json-simple</artifactId>
     <version>1.1</version>
     </dependency> 


    </dependencies>
</project>

Upvotes: 1

Views: 10478

Answers (3)

agilob
agilob

Reputation: 6223

Click right on your project in your IDE, find where you can setup build path/libraries and you must add the .jar file manually in project properties.

btw. You are using very old spring and junit.

enter image description here

Upvotes: 0

hmrojas.p
hmrojas.p

Reputation: 582

I think, you have to review your dependencies, because the error show a differente version than you have in your pom.xml. You havve this in your pom.xml:

<dependency>
   <groupId>com.oracle</groupId>
   <artifactId>ojdbc</artifactId>
   <version>10.2.0.4.0</version>
</dependency>

The error show the version 10.4.4, maybe you have another project as dependency and it has ojdbc 10.4.4.

I hope this information helps you.

Good luck.

Upvotes: 0

Daniel Gurianov
Daniel Gurianov

Reputation: 551

I was in simmilar situation recently. Oracle does not provide driver package physically to maven, but maven has driver artifacts in its repository. So, when you set up dependency inside the pom.xml , you actually dowloading oracle license file only.

Solution for me was next :

  1. Pom dependency

    <dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc</artifactId>
    <version>10.2.0.4.0</version>
    </dependency>
    
  2. Build the project, it will except that it cannot download jar , but will create folders in local repository.

In my case under Windows :

  C:\Users\Daniel\.m2\repository\com\oracle\ojdbc\10.2.0.4.0\ 

This folder will have some files inside but no jar.

  1. Download driver manually from Oracle site ( ver 10.2.0.4.0) : Oracle JDBC drivers

  2. Instal driver into maven manually by running

     mvn install:install-file -Dfile={Path/to/your/ojdbc.jar} -DgroupId=com.oracle -DartifactId=ojdbc -Dversion=10.2.0.4.0 -Dpackaging=jar
    

Where com.oracle and ojdbc in command has to match with maven repo path elements ...\.m2\repository\com\oracle\ojdbc\10.2.0.4.0\

Upvotes: 2

Related Questions