JBoss AS6 + HibernateSpatial 1.1-SNAPSHOT

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JBoss AS6 + HibernateSpatial 1.1-SNAPSHOT

Brice
Hello,

I'm facing the following issue:

When invoking a DAO deployed on JBoss to query spatial data, the following exception is raised:

2010-12-16 15:31:08,953 WARN  [org.hibernate.util.JDBCExceptionReporter] (WorkerThread#0[127.0.0.1:2539]) SQL Error: 0, SQLState: 07006
2010-12-16 15:31:08,953 ERROR [org.hibernate.util.JDBCExceptionReporter] (WorkerThread#0[127.0.0.1:2539]) Can't infer the SQL type to use for an instance of org.postgis.PGgeometry. Use setObject() with an explicit Types value to specify the type to use.
2010-12-16 15:31:08,953 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (WorkerThread#0[127.0.0.1:2539]) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.SQLGrammarException: could not execute query

Wich seems to be an integration issue because when running out of the container in a Java SE environmnent, it works fine.

Could you please help me?

Thanks

My configuration is:

JBoss 6.0.0.20101110-CR1 (with bundled Hibernate 3.6.0.Final)
HibernateSpatial 1.1-SNAPSHOT build with Hibernate 3.6.0.Final (instead of 3.6.0-SNAPSHOT no more available)
PostgreSQL 9.0.1 / PostGIS 1.5.2
postgis-jdbc: 1.3.3
postgresql-9.0-801.jdbc4

The entity mappings are made with JPA annotations and the Type annotation from HibernateCore.

persistence.xml:
<persistence-unit name="test" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>

        <jta-data-source>java:jdbc/postgis-cde4tests</jta-data-source>
        <mapping-file>/orm.xml</mapping-file>

<class>...</class>
<class>...</class>
<class>...</class>
<properties>
<property name="hibernate.default_schema" value="cde" />
<property name="hibernate.dialect" value="org.hibernatespatial.postgis.PostgisDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>

I think every class needed seems to be in the classpath, because there's no deployment error, and the content of the ear archive is :

cde-ear-0.1-SNAPSHOT.ear (Stateless EJBs + a data source)

        cde-dao-0.1-SNAPSHOT.jar
        cde-domain-0.1-SNAPSHOT.jar
        cde-service-0.1-SNAPSHOT.jar
<REP>   lib
<REP>   META-INF
        postgres-ds.xml

 cde-ear-0.1-SNAPSHOT.ear\lib

        ant-optional-1.5.1.jar
        cde-detection-0.1-SNAPSHOT.jar
        cde-domain-0.1-SNAPSHOT.jar
        cde-geometry-core-0.1-SNAPSHOT.jar
        common-2.2.1.jar
        commons-beanutils-1.4.jar
        commons-jxpath-1.2.jar
        commons-logging-1.0.jar
        commons-pool-1.5.4.jar
        ecore-2.2.2.jar
        geoapi-2.3-M1.jar
        geoapi-pending-2.3-M1.jar
        gt-api-2.7-M3.jar
        gt-coverage-2.7-M3.jar
        gt-cql-2.7-M3.jar
        gt-geojson-2.7-M3.jar
        gt-graph-2.7-M3.jar
        gt-main-2.7-M3.jar
        gt-metadata-2.7-M3.jar
        gt-referencing-2.7-M3.jar
        gt-xml-2.7-M3.jar
        gt-xsd-core-2.7-M3.jar
        gt-xsd-filter-2.7-M3.jar
        gt-xsd-gml2-2.7-M3.jar
        gt-xsd-gml3-2.7-M3.jar
        gt-xsd-ows-2.7-M3.jar
        gt-xsd-wfs-2.7-M3.jar
        hibernate-spatial-1.1-SNAPSHOT.jar
        hibernate-spatial-postgis-1.1-SNAPSHOT.jar
        imageio-ext-tiff-1.0.7.jar
        imageio-ext-utilities-1.0.7.jar
        jai_codec-1.1.3.jar
        jai_core-1.1.3.jar
        jai_imageio-1.1.jar
        javassist-3.9.0.GA.jar
        jdom-1.0.jar
        json-simple-1.1.jar
        jsr-275-1.0-beta-2.jar
        jts-1.11.jar
        net.opengis.ows-2.7-M3.jar
        net.opengis.wfs-2.7-M3.jar
        org.w3.xlink-2.7-M3.jar
        picocontainer-1.2.jar
        postgis-jdbc-1.3.3.jar
        postgis-stubs-1.3.3.jar
        postgresql-9.0-801.jdbc4.jar
        vecmath-1.3.2.jar
        xml-apis-1.0.b2.jar
        xml-apis-xerces-2.7.1.jar
        xsd-2.2.2.jar

cde-ear-0.1-SNAPSHOT.ear\META-INF

        application.xml
        jboss-app.xml
        persistence.xml

Setting for the data source:
    <jndi-name>jdbc/postgis-cde4tests</jndi-name>
    <connection-url>jdbc:postgresql://localhost:5432/cde4tests</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
and username, password and so.

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: JBoss AS6 + HibernateSpatial 1.1-SNAPSHOT

Brice
Hello,

I finally fixed the issue by outing the datasource definition (with PostgresSQL/PostGIS related jars)  from the EAR.

Regards

2010/12/16 Brice <[hidden email]>
Hello,

I'm facing the following issue:

When invoking a DAO deployed on JBoss to query spatial data, the following exception is raised:

2010-12-16 15:31:08,953 WARN  [org.hibernate.util.JDBCExceptionReporter] (WorkerThread#0[127.0.0.1:2539]) SQL Error: 0, SQLState: 07006
2010-12-16 15:31:08,953 ERROR [org.hibernate.util.JDBCExceptionReporter] (WorkerThread#0[127.0.0.1:2539]) Can't infer the SQL type to use for an instance of org.postgis.PGgeometry. Use setObject() with an explicit Types value to specify the type to use.
2010-12-16 15:31:08,953 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (WorkerThread#0[127.0.0.1:2539]) javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.SQLGrammarException: could not execute query

Wich seems to be an integration issue because when running out of the container in a Java SE environmnent, it works fine.

Could you please help me?

Thanks

My configuration is:

JBoss 6.0.0.20101110-CR1 (with bundled Hibernate 3.6.0.Final)
HibernateSpatial 1.1-SNAPSHOT build with Hibernate 3.6.0.Final (instead of 3.6.0-SNAPSHOT no more available)
PostgreSQL 9.0.1 / PostGIS 1.5.2
postgis-jdbc: 1.3.3
postgresql-9.0-801.jdbc4

The entity mappings are made with JPA annotations and the Type annotation from HibernateCore.

persistence.xml:
<persistence-unit name="test" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>

        <jta-data-source>java:jdbc/postgis-cde4tests</jta-data-source>
        <mapping-file>/orm.xml</mapping-file>

<class>...</class>
<class>...</class>
<class>...</class>
<properties>
<property name="hibernate.default_schema" value="cde" />
<property name="hibernate.dialect" value="org.hibernatespatial.postgis.PostgisDialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>

I think every class needed seems to be in the classpath, because there's no deployment error, and the content of the ear archive is :

cde-ear-0.1-SNAPSHOT.ear (Stateless EJBs + a data source)

        cde-dao-0.1-SNAPSHOT.jar
        cde-domain-0.1-SNAPSHOT.jar
        cde-service-0.1-SNAPSHOT.jar
<REP>   lib
<REP>   META-INF
        postgres-ds.xml

 cde-ear-0.1-SNAPSHOT.ear\lib

        ant-optional-1.5.1.jar
        cde-detection-0.1-SNAPSHOT.jar
        cde-domain-0.1-SNAPSHOT.jar
        cde-geometry-core-0.1-SNAPSHOT.jar
        common-2.2.1.jar
        commons-beanutils-1.4.jar
        commons-jxpath-1.2.jar
        commons-logging-1.0.jar
        commons-pool-1.5.4.jar
        ecore-2.2.2.jar
        geoapi-2.3-M1.jar
        geoapi-pending-2.3-M1.jar
        gt-api-2.7-M3.jar
        gt-coverage-2.7-M3.jar
        gt-cql-2.7-M3.jar
        gt-geojson-2.7-M3.jar
        gt-graph-2.7-M3.jar
        gt-main-2.7-M3.jar
        gt-metadata-2.7-M3.jar
        gt-referencing-2.7-M3.jar
        gt-xml-2.7-M3.jar
        gt-xsd-core-2.7-M3.jar
        gt-xsd-filter-2.7-M3.jar
        gt-xsd-gml2-2.7-M3.jar
        gt-xsd-gml3-2.7-M3.jar
        gt-xsd-ows-2.7-M3.jar
        gt-xsd-wfs-2.7-M3.jar
        hibernate-spatial-1.1-SNAPSHOT.jar
        hibernate-spatial-postgis-1.1-SNAPSHOT.jar
        imageio-ext-tiff-1.0.7.jar
        imageio-ext-utilities-1.0.7.jar
        jai_codec-1.1.3.jar
        jai_core-1.1.3.jar
        jai_imageio-1.1.jar
        javassist-3.9.0.GA.jar
        jdom-1.0.jar
        json-simple-1.1.jar
        jsr-275-1.0-beta-2.jar
        jts-1.11.jar
        net.opengis.ows-2.7-M3.jar
        net.opengis.wfs-2.7-M3.jar
        org.w3.xlink-2.7-M3.jar
        picocontainer-1.2.jar
        postgis-jdbc-1.3.3.jar
        postgis-stubs-1.3.3.jar
        postgresql-9.0-801.jdbc4.jar
        vecmath-1.3.2.jar
        xml-apis-1.0.b2.jar
        xml-apis-xerces-2.7.1.jar
        xsd-2.2.2.jar

cde-ear-0.1-SNAPSHOT.ear\META-INF

        application.xml
        jboss-app.xml
        persistence.xml

Setting for the data source:
    <jndi-name>jdbc/postgis-cde4tests</jndi-name>
    <connection-url>jdbc:postgresql://localhost:5432/cde4tests</connection-url>
    <driver-class>org.postgresql.Driver</driver-class>
and username, password and so.


_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users