Hello,
I got the project working by adding these to the pom:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.2.ga</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.0</version>
</dependency>
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-jta</artifactId>
<version>1.0-M1</version>
<scope>test</scope>
</dependency>
And
<repository>
<id>Agile Java</id>
<url>http://agilejava.com/maven/</url>
</repository>
I am not sure if this is correct or not but I can interact with the DB and
have the tutorial at
http://wiki.apache.org/tapestry/Tapestry5HowToUseTapestryHibernate
Working.
I still cannot find a good Tapestry-Hibernate tutorial though. I have a
rather large database created and would like to generate objects from
it(this tutorial is the other way around). I am assuming this may be a
hibernate situation and not tapestry-hibernate but any nudge in the right
direction would be appreciated.
Thanks,
--James
-----Original Message-----
From: James Sherwood [mailto:[EMAIL PROTECTED]
Sent: October-25-08 2:11 PM
To: Tapestry users
Subject: T5: Using with hibernate and Mysql
Hello,
I was wondering if anyone has a good example of using Tapestry 5 with
Hibernate and Mysql or can tell me what I am doing wrong
I use Eclipse/Tomcat/Mysql.
I created a new project using Maven:
mvn archetype:create -DarchetypeGroupId=org.apache.tapestry
-DarchetypeArtifactId=quickstart -DgroupId=com.james -DartifactId=taphib
-DpackageName=com.james.taphib -Dversion=1.0.0-SNAPSHOT
I added this to my pom.xml
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-hibernate</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.5</version>
</dependency>
I created a filed called: hibernate.cfg.xml in src/main/resources
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.url
">jdbc:mysql://localhost/dbname?charset=utf8</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password"></property>
<!-- pool via c3p0 which knows how to reconnect to server and does it
nicely-->
<property name="connection.provider_class">
org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">100</property> <!--
seconds -->
<property name="hibernate.c3p0.max_size">10</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.min_size">1</property>
<property name="hibernate.c3p0.timeout">100</property> <!-- seconds -->
</session-factory>
</hibernate-configuration>
When I try to package using "mvn package" so I can deploy to eclipse I get
the error:
INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.hibernate
-DartifactId=hibernate-co
mmons-annotations -Dversion=3.1.0.GA -Dpackaging=jar -Dfile=/path/to/file
I found a hibernate-commons-annotations.jar but I believe I am doing
something wrong to cause this error.
Thanks,
--James
__________ Information from ESET Smart Security, version of virus signature
database 3536 (20081019) __________
The message was checked by ESET Smart Security.
http://www.eset.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]