You must use -Poracle when you want it to connect to Oracle. So you need to do:

mvn -Pprod appfuse:gen-model



On Aug 19, 2008, at 1:11 PM, WalterScott wrote:



dusty wrote:

When you run  maven do you run: mvn -Poracle test?

-D

When I run mvn -Poracle test, I get following:

[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building AppFuse Spring MVC Application
[INFO]    task-segment: [test]
[INFO]
------------------------------------------------------------------------
Downloading:
http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.1.0.2.0/ojdbc14-10.1.0.2.0.pom
Downloading:
http://static.appfuse.org/repository/com/oracle/ojdbc14/10.1.0.2.0/ojdbc14-10.1.0.2.0.pom
Downloading:
http://repo1.maven.org/maven2/com/oracle/ojdbc14/10.1.0.2.0/ojdbc14-10.1.0.2.0.jar
Downloading:
http://static.appfuse.org/repository/com/oracle/ojdbc14/10.1.0.2.0/ojdbc14-10.1.0.2.0.jar
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.oracle:ojdbc14:jar:10.1.0.2.0

 Try downloading the file manually from the project website.

 Then, install it using the command:
mvn install:install-file -DgroupId=com.oracle - DartifactId=ojdbc14
-Dversion=10.1.0.2.0 -Dpackaging=jar -Dfile=ojdbc14-10.1.0.2.0.jar

Alternatively, if you host your own repository you can deploy the file
there:
     mvn deploy:deploy-file -DgroupId=com.oracle -DartifactId=ojdbc14
-Dversion=10.1.0.2.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

 Path to dependency:
        1) ru.advert:advert:war:1.0-SNAPSHOT
        2) com.oracle:ojdbc14:jar:10.1.0.2.0

----------
1 required artifact is missing.

for artifact:
 ru.advert:advert:war:1.0-SNAPSHOT

from the specified remote repositories:
 appfuse (http://static.appfuse.org/repository),
 central (http://repo1.maven.org/maven2)






I downloading ojdbc14-10.1.0.2.0.jar and install how describe above.
Now, when I run mvn -Poracle test, it creates tables in oracle such as
app_user, role, etc.
It means that connect to oracle successfully established.

But when I run mvn appfuse:gen-model it's trying to connect to MySQL again.



dusty wrote:

Do you have more than one profile active by default?

It`s my database and container profiles:
       <!-- ================= Database Profiles ================= -->
       <profile>
           <id>derby</id>
           <properties>

<hibernate.dialect>org.hibernate.dialect.DerbyDialect</ hibernate.dialect>
               <jdbc.groupId>org.apache.derby</jdbc.groupId>
               <jdbc.artifactId>derbyclient</jdbc.artifactId>
               <jdbc.version>10.2.2.0</jdbc.version>

<jdbc.driverClassName>org.apache.derby.jdbc.ClientDriver</ jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:derby://localhost/advert;create=true]]></ jdbc.url>
               <jdbc.username>any</jdbc.username>
               <jdbc.password>value</jdbc.password>
           </properties>
       </profile>
       <profile>
           <id>h2</id>
           <properties>

< dbunit .dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</ dbunit.dataTypeFactoryName>

<hibernate.dialect>org.hibernate.dialect.H2Dialect</hibernate.dialect>
               <jdbc.groupId>com.h2database</jdbc.groupId>
               <jdbc.artifactId>h2</jdbc.artifactId>
               <jdbc.version>1.0.20061217</jdbc.version>
<jdbc.driverClassName>org.h2.Driver</ jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:h2:${java.io.tmpdir}/advert]]></jdbc.url>
               <jdbc.username>sa</jdbc.username>
               <jdbc.password></jdbc.password>
           </properties>
       </profile>
       <profile>
           <id>hsqldb</id>
           <properties>

< dbunit .dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</ dbunit.dataTypeFactoryName>

<hibernate.dialect>org.hibernate.dialect.HSQLDialect</ hibernate.dialect>
               <jdbc.groupId>hsqldb</jdbc.groupId>
               <jdbc.artifactId>hsqldb</jdbc.artifactId>
               <jdbc.version>1.8.0.7</jdbc.version>

<jdbc.driverClassName>org.hsqldb.jdbcDriver</jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:hsqldb:${java.io.tmpdir}/ advert;shutdown=true]]></jdbc.url>
               <jdbc.username>sa</jdbc.username>
               <jdbc.password></jdbc.password>
           </properties>
       </profile>
       <profile>
           <id>oracle</id>
                        <activation>
                                <activeByDefault>true</activeByDefault>
                        </activation>
           <properties>

< dbunit .dataTypeFactoryName>org.dbunit.ext.oracle.OracleDataTypeFactory</ dbunit.dataTypeFactoryName>
               <dbunit.schema>SYSTEM</dbunit.schema> <!-- Make sure to
capitalize the schema name -->

<hibernate.dialect>org.hibernate.dialect.Oracle9Dialect</ hibernate.dialect>
               <jdbc.groupId>com.oracle</jdbc.groupId>
               <jdbc.artifactId>ojdbc14</jdbc.artifactId>
               <jdbc.version>10.1.0.2.0</jdbc.version>

<jdbc.driverClassName>oracle.jdbc.OracleDriver</jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:oracle:thin:@127.0.0.1:1521:ORCL]]></jdbc.url>
               <jdbc.username>system</jdbc.username>
               <jdbc.password>shjuchgu</jdbc.password>
           </properties>
       </profile>
       <profile>
           <id>postgresql</id>
           <properties>

<hibernate.dialect>org.hibernate.dialect.PostgreSQLDialect</ hibernate.dialect>
               <jdbc.groupId>postgresql</jdbc.groupId>
               <jdbc.artifactId>postgresql</jdbc.artifactId>
               <jdbc.version>8.1-407.jdbc3</jdbc.version>

<jdbc.driverClassName>org.postgresql.Driver</jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:postgresql://localhost/advert]]></jdbc.url>
               <jdbc.username>postgres</jdbc.username>
               <jdbc.password>postgres</jdbc.password>
           </properties>
       </profile>
       <profile>
<!-- You need to enable TCP/IP Connections for SQL Server 2005
after installing. -->
           <!-- http://www.mattwoodward.com/blog/index.cfm?commentID=211
-->
           <id>sqlserver</id>
           <properties>

< dbunit .dataTypeFactoryName>org.dbunit.ext.mssql.MsSqlDataTypeFactory</ dbunit.dataTypeFactoryName>

<dbunit.operation.type>MSSQL_CLEAN_INSERT</dbunit.operation.type>

<hibernate.dialect>org.hibernate.dialect.SQLServerDialect</ hibernate.dialect>
               <jdbc.groupId>net.sourceforge.jtds</jdbc.groupId>
               <jdbc.artifactId>jtds</jdbc.artifactId>
               <jdbc.version>1.2</jdbc.version>

<jdbc.driverClassName>net.sourceforge.jtds.jdbc.Driver</ jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:jtds:sqlserver://localhost:3683/advert]]></ jdbc.url>
               <jdbc.username>sa</jdbc.username>
               <jdbc.password>appfuse</jdbc.password>
           </properties>
       </profile>

       <!-- ================= Container Profiles ================= -->
       <profile>
           <id>jboss</id>
           <properties>
               <cargo.container>jboss4x</cargo.container>

<cargo.container.home>${env.JBOSS_HOME}</cargo.container.home>

<cargo.container.url>http://easynews.dl.sourceforge.net/sourceforge/jboss/jboss-4.0.5.GA.zip </cargo.container.url>
           </properties>
       </profile>
   </profiles>

   <properties>
       <!-- Application settings -->
       <copyright.year>2008</copyright.year>
       <dao.framework>hibernate</dao.framework>
       <web.framework>spring</web.framework>
       <amp.genericCore>true</amp.genericCore>
       <amp.fullSource>false</amp.fullSource>

       <!-- Framework dependency versions -->
       <appfuse.version>2.0.2</appfuse.version>
       <spring.version>2.5.4</spring.version>

       <!-- Testing dependency versions -->
       <jmock.version>2.4.0</jmock.version>
       <jsp.version>2.0</jsp.version>
       <junit.version>4.4</junit.version>
       <servlet.version>2.4</servlet.version>
       <wiser.version>1.2</wiser.version>

       <!-- WebTest dependency versions  -->
       <webtest.version>R_1702</webtest.version>

       <!-- Cargo settings -->
       <cargo.container>tomcat5x</cargo.container>
<cargo.container.home>${env.CATALINA_HOME}</ cargo.container.home>

<cargo.container.url>http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.zip </cargo.container.url>
       <cargo.host>localhost</cargo.host>
       <cargo.port>8081</cargo.port>
       <cargo.wait>false</cargo.wait>

       <!-- Database settings -->

< dbunit .dataTypeFactoryName >org.dbunit.dataset.datatype.DefaultDataTypeFactory</ dbunit.dataTypeFactoryName>
       <dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>

<hibernate.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</ hibernate.dialect>
       <jdbc.groupId>mysql</jdbc.groupId>
       <jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
       <jdbc.version>5.0.5</jdbc.version>
<jdbc.driverClassName>com.mysql.jdbc.Driver</ jdbc.driverClassName>

<jdbc.url><![CDATA[jdbc:mysql://localhost/advert? createDatabaseIfNotExist =true&amp;useUnicode=true&amp;characterEncoding=utf-8]]></jdbc.url>
       <jdbc.username>root</jdbc.username>
       <jdbc.password></jdbc.password>
   </properties>


MySQL profile active by default as before?

Excuse me for my english:)
--
View this message in context: 
http://www.nabble.com/oracle-database-profile%3Aorg.hibernate.exception.JDBCConnectionException-tp19035653s2369p19057712.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to