Menu

#2755 ZK JPA cause Exception

5.0.7
closed-fixed
nobody
5
2011-07-04
2011-07-01
BenBai
No

just config JPA as below,
the exception occurred when connect to a page.

zk.xml

<zk>
<system-config>
<disable-event-thread/>
</system-config>
<!-- JPA -->
<!-- -->
<preference>
<name>JpaUtil.PersistenceUnitName</name>
<value>HibJpaTest</value>
</preference>
<!-- Specify JPA "OpenEntityManagerInView" Listener -->
<listener>
<description>JPA "OpenEntityManagerInView" Listener</description>
<listener-class>org.zkoss.zkplus.jpa.OpenEntityManagerInViewListener
</listener-class>
</listener>
</zk>

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="HibJpaTest">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost/xdb"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
</properties>
</persistence-unit>
</persistence>

Discussion

  • BenBai

    BenBai - 2011-07-04
    • status: open --> closed-fixed
     
  • BenBai

    BenBai - 2011-07-04

    fixed since 2011-07-04

     

Log in to post a comment.