You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by willbro <ll...@yahoo.fr> on 2012/11/09 00:17:18 UTC
HibernateSessionManager
Hi,
I just started learning Tapestry with mysql & Hibernate and i can not manage
to store some form data into a database. I still get this error message
Error invoking method public static
org.apache.tapestry5.hibernate.HibernateSessionManager
org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionManager(org.apache.tapestry5.hibernate.HibernateSessionSource,org.apache.tapestry5.ioc.services.PerthreadManager):
org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
This his how my pom looks like
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>tutorial Tapestry 5 Application</name>
<dependencies>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.7.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>4.1.7.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.7.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-c3p0</artifactId>
<version>4.1.7.Final</version>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-yuicompressor</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng-release-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>${easymock-release-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-test</artifactId>
<version>${tapestry-release-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet-api-release-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-javadoc</artifactId>
<version>${tapestry-release-version}</version>
<scope>provided</scope>
</dependency>
<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.21</version>
</dependency>
</dependencies>
<build>
<finalName>tutorial</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<optimize>true</optimize>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<systemPropertyVariables>
<tapestry.execution-mode>Qa</tapestry.execution-mode>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.16</version>
<configuration>
<requestLog
implementation="org.mortbay.jetty.NCSARequestLog">
<append>true</append>
</requestLog>
<systemProperties>
<systemProperty>
<name>tapestry.execution-mode</name>
<value>development</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<reporting/>
<repositories>
<repository>
<id>apache-staging</id>
<url>https://repository.apache.org/content/groups/staging/</url>
</repository>
</repositories>
<properties>
<tapestry-release-version>5.3.6</tapestry-release-version>
<servlet-api-release-version>2.5</servlet-api-release-version>
<testng-release-version>5.14.10</testng-release-version>
<easymock-release-version>3.0</easymock-release-version>
</properties>
</project>
thanks for any help
--
View this message in context: http://tapestry.1045711.n5.nabble.com/HibernateSessionManager-tp5717841.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: HibernateSessionManager
Posted by willbro <ll...@yahoo.fr>.
it's working now with the following dependencies in the pom
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>5.3.6</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>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
I will probably be back soon ;-)
Danke Kalle & jm
--
View this message in context: http://tapestry.1045711.n5.nabble.com/HibernateSessionManager-tp5717841p5717858.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: HibernateSessionManager
Posted by willbro <ll...@yahoo.fr>.
<!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">com.mysql.jdbc.Driver</property>
<property
name="hibernate.connection.url">jdbc:mysql://localhost/tapestry</property>
<property
name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property
name="hibernate.connection.username">root</property>
<property
name="hibernate.connection.password">mysql</property>
<property name="hbm2ddl.auto">update</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="connection.pool_size">1</property>
<property name="current_session_context_class">thread</property>
<property
name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<mapping class="com.example.tutorial.entities.Address"/>
</session-factory>
</hibernate-configuration>
--
View this message in context: http://tapestry.1045711.n5.nabble.com/HibernateSessionManager-tp5717841p5717852.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: HibernateSessionManager
Posted by Jean-Michel OLTRA <jm...@imereos.fr>.
Bonjour,
Le jeudi 08 novembre 2012, willbro a écrit...
> Problem accessing /Tapestry%20Tutorial/. Reason:
> Exception constructing service 'ValueEncoderSource': Error invoking
> service contribution method
> org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,
Can you, please, send your hibernate.cfg?
--
jm
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: HibernateSessionManager
Posted by willbro <ll...@yahoo.fr>.
Thanks for answering
i removed hibernate 4.1.7 and added Hibernate 3.5.6-Final
now i have this by starting the application
HTTP ERROR 500
Problem accessing /Tapestry%20Tutorial/. Reason:
Exception constructing service 'ValueEncoderSource': Error invoking
service contribution method
org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,
boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess,
LoggerSource): Exception constructing service 'HibernateSessionSource':
Error invoking constructor public
org.apache.tapestry5.internal.hibernate.HibernateSessionSourceImpl(org.slf4j.Logger,java.util.List):
org/hibernate/annotations/common/reflection/MetadataProvider
Caused by:
java.lang.RuntimeException: Exception constructing service
'ValueEncoderSource': Error invoking service contribution method
org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,
boolean, HibernateSessionSource, Session, TypeCoercer, PropertyAccess,
LoggerSource): Exception constructing service 'HibernateSessionSource':
Error invoking constructor public
org.apache.tapestry5.internal.hibernate.HibernateSessionSourceImpl(org.slf4j.Logger,java.util.List):
org/hibernate/annotations/common/reflection/MetadataProvider
at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:75)
at
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:54)
at $ValueEncoderSource_1488869a1aac.delegate(Unknown Source)
at $ValueEncoderSource_1488869a1aac.getValueEncoder(Unknown Source)
at
org.apache.tapestry5.internal.services.ComponentDefaultProviderImpl.defaultValueEncoder(ComponentDefaultProviderImpl.java:124)
at $ComponentDefaultProvider_1488869a1ab0.defaultValueEncoder(Unknown
Source)
at
org.apache.tapestry5.corelib.components.Loop.defaultEncoder(Loop.java:316)
at
org.apache.tapestry5.corelib.components.Loop$Shim_1488869a1af2.invoke(Unknown
Source)
at
org.apache.tapestry5.internal.plastic.MethodHandleImpl.invoke(MethodHandleImpl.java:48)
at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.invokeDefaultMethod(ParameterWorker.java:430)
at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.getDefaultBindingForParameter(ParameterWorker.java:412)
at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1.load(ParameterWorker.java:336)
at
org.apache.tapestry5.internal.transform.ParameterWorker$3$1$1.run(ParameterWorker.java:204)
at
org.apache.tapestry5.internal.structure.PageImpl.invokeCallbacks(PageImpl.java:362)
This are my dependencies:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-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-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-hibernate</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
--
View this message in context: http://tapestry.1045711.n5.nabble.com/HibernateSessionManager-tp5717841p5717843.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: HibernateSessionManager
Posted by Kalle Korhonen <ka...@gmail.com>.
Tapestry-hibernate 5.3.x is not compatible with Hibernate 4.x. If you need
to use 4.x, you can just recompile tapestry-hibernate yourself. T5.4 is
already using Hibernate 4.x as dependency.
Kalle
On Thu, Nov 8, 2012 at 3:17 PM, willbro <ll...@yahoo.fr> wrote:
> Hi,
> I just started learning Tapestry with mysql & Hibernate and i can not
> manage
> to store some form data into a database. I still get this error message
>
> Error invoking method public static
> org.apache.tapestry5.hibernate.HibernateSessionManager
>
> org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionManager(org.apache.tapestry5.hibernate.HibernateSessionSource,org.apache.tapestry5.ioc.services.PerthreadManager):
> org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
>
> This his how my pom looks like
>
>
> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://maven.apache.org/POM/4.0.0">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.example</groupId>
> <artifactId>tutorial</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>war</packaging>
> <name>tutorial Tapestry 5 Application</name>
> <dependencies>
>
> <dependency>
> <groupId>org.apache.tapestry</groupId>
> <artifactId>tapestry-core</artifactId>
> <version>${tapestry-release-version}</version>
> </dependency>
>
>
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-core</artifactId>
> <version>4.1.7.Final</version>
> </dependency>
>
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-annotations</artifactId>
> <version>4.1.7.Final</version>
> </dependency>
>
>
>
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-entitymanager</artifactId>
> <version>4.1.7.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-c3p0</artifactId>
> <version>4.1.7.Final</version>
> </dependency>
>
>
> <dependency>
> <groupId>org.apache.tapestry</groupId>
> <artifactId>tapestry-yuicompressor</artifactId>
> <version>${tapestry-release-version}</version>
> </dependency>
>
>
>
>
>
> <dependency>
> <groupId>org.testng</groupId>
> <artifactId>testng</artifactId>
> <version>${testng-release-version}</version>
> <scope>test</scope>
> </dependency>
>
> <dependency>
> <groupId>org.easymock</groupId>
> <artifactId>easymock</artifactId>
> <version>${easymock-release-version}</version>
> <scope>test</scope>
> </dependency>
>
> <dependency>
> <groupId>org.apache.tapestry</groupId>
> <artifactId>tapestry-test</artifactId>
> <version>${tapestry-release-version}</version>
> <scope>test</scope>
> </dependency>
>
>
> <dependency>
> <groupId>javax.servlet</groupId>
> <artifactId>servlet-api</artifactId>
> <version>${servlet-api-release-version}</version>
> <scope>provided</scope>
> </dependency>
>
>
> <dependency>
> <groupId>org.apache.tapestry</groupId>
> <artifactId>tapestry-javadoc</artifactId>
> <version>${tapestry-release-version}</version>
> <scope>provided</scope>
> </dependency>
>
> <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.21</version>
> </dependency>
>
> </dependencies>
> <build>
> <finalName>tutorial</finalName>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> <optimize>true</optimize>
> </configuration>
> </plugin>
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.7.2</version>
> <configuration>
> <systemPropertyVariables>
>
> <tapestry.execution-mode>Qa</tapestry.execution-mode>
> </systemPropertyVariables>
> </configuration>
> </plugin>
>
>
> <plugin>
> <groupId>org.mortbay.jetty</groupId>
> <artifactId>maven-jetty-plugin</artifactId>
> <version>6.1.16</version>
> <configuration>
>
> <requestLog
> implementation="org.mortbay.jetty.NCSARequestLog">
>
> <append>true</append>
> </requestLog>
> <systemProperties>
> <systemProperty>
> <name>tapestry.execution-mode</name>
> <value>development</value>
> </systemProperty>
> </systemProperties>
> </configuration>
> </plugin>
> </plugins>
> </build>
>
> <reporting/>
>
> <repositories>
>
>
> <repository>
> <id>apache-staging</id>
> <url>https://repository.apache.org/content/groups/staging/
> </url>
> </repository>
> </repositories>
>
> <properties>
> <tapestry-release-version>5.3.6</tapestry-release-version>
> <servlet-api-release-version>2.5</servlet-api-release-version>
> <testng-release-version>5.14.10</testng-release-version>
> <easymock-release-version>3.0</easymock-release-version>
> </properties>
> </project>
>
> thanks for any help
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/HibernateSessionManager-tp5717841.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>