Error installing jdbc oracle in eclipse

Asked

Viewed 321 times

-1

I am finding impediments in the installation of oracle jdbc.

Canvas inserir a descrição da imagem aqui

Error message:

Error Reading file C: Users alex.jose.silva.m2 Repository with oracle ojdbc14 10.2.0.3.0 ojdbc14-10.2.0.3.0.jar C: Users alex.jose.silva.m2 Repository with oracle ojdbc14 10.2.0.3.0 ojdbc14-10.2.0.3.0.jar (System cannot find specified file)

Commando

mvn install:install-file -Dgroupid=com.oracle -Dartifactid=o jdbc14 -Dversion=10.2.x.x.x -Dpackaging=jar -Dfile=ojdbc14.jar -Dgeneratepom=true

Command response

inserir a descrição da imagem aqui

Pow.xml

<?xml version="1.0" encoding="UTF-8"?>
<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>br.com.devmedia</groupId>
   <artifactId>crud_cadastro_cliente</artifactId>
   <packaging>war</packaging>
   <version>0.0.1-SNAPSHOT</version>
   <name>crud_cadastro_cliente Maven Webapp</name>
   <url>http://maven.apache.org</url>
   <dependencies>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>3.8.1</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.sun.jersey</groupId>
         <artifactId>jersey-server</artifactId>
         <version>1.8</version>
      </dependency>
      <dependency>
         <groupId>com.sun.jersey</groupId>
         <artifactId>jersey-json</artifactId>
         <version>1.8</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-validator</artifactId>
         <version>4.2.0.Final</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate.common</groupId>
         <artifactId>hibernate-commons-annotations</artifactId>
         <version>4.0.1.Final</version>
         <classifier>tests</classifier>
      </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.1.Final</version>
      </dependency>

      <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc14</artifactId>
            <version>10.2.0.3.0</version>
        </dependency>

      <dependency>
         <groupId>mysql</groupId>
         <artifactId>mysql-connector-java</artifactId>
         <version>5.1.6</version>
         <scope>compile</scope>
      </dependency>     


   </dependencies>
   <build>
      <finalName>crud_cadastro_cliente</finalName>
      <plugins>
         <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.0</version>
            <configuration>
               <path>/</path>
               <port>8080</port>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>
  • how’s your pom.xml ?

  • I added Pow.xml

2 answers

1


<dependency>
   <groupId>com.oracle</groupId>
   <artifactId>ojdbc14</artifactId>
   <version>10.2.0.3.0</version>
 </dependency>

Error Reading file C: Users alex.jose.silva.m2 Repository with oracle ojdbc14 10.2.0.3.0 ojdbc14-10.2.0.3.0.jar C: Users alex.jose.silva.m2 Repository with oracle ojdbc14 10.2.0.3.0 ojdbc14-10.2.0.3.0.jar (System cannot find specified file)

The mavem is treating 10.2.0.3.0 as a name of a folder the correct would be to be subfolders where mavem organizes each version of its libs.

Error Reading file C: Users alex.jose.silva.m2 Repository com oracle ojdbc14 10 2 0 3 0 ojdbc14-10.2.0.3.0.jar

see the error !!

(System cannot find specified file)

if you installed ojdbc14 driver manually organize correctly the folder and sub folder that will work that will work.

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.x.x.x -Dpackaging=jar -Dfile=C:\Users\alex.jose\ojdbc14\ojdbc14.jar -DgeneratePom=true

C: Users alex.Jose ojdbc14 ojdbc14.jar is where your driver is on your disk..

0

Can solve using two steps:

  1. Running the command:

mvn install:install-file -Dfile=C: Users alex.jose.silva Dow nloads ojdbc7.jar -Dgroupid=com.oracle -Dartifactid=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar

  1. Add to Pow.xml:

       <dependency>
              <groupId>com.oracle</groupId>
              <artifactId>ojdbc7</artifactId>
              <version>12.1.0</version>
       </dependency> 
    

inserir a descrição da imagem aqui

  • That’s right!! I’m glad it worked out so well..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.