Re: Could not determine type for: org.hibernateespatial.GeometryUserType

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

Re: Could not determine type for: org.hibernateespatial.GeometryUserType

Per Engström
Hi!

I found this old thread on this list and I just ran in to the same
problem as Hila describes below. It has little to do with JAXB. The
problem boils down to the fact that when using a Spring context all
related objects must be JavaBeans. A JavaBean must provide a no-arg
constructor and getters and setters for all properties. The objects in
the com.vividsolutions.jts.geom.* package does not fulfill the
requirements of being a JavaBeans since they do not have no-args
constructors :(

Are there any plans to use some other implementation of spatial types
other than Java Topology Suit that are Plain Old JavaBeans? I would be
very, very interested in seeing that happening.

As there alreary is a JavaBean for Circle in
hibernate-spatial-1.0.jar, would it not be quite an easy task to
implement Point, Line and Polygon (and Multi*) as well and getting rid
of the dependency to jts?

Regards,
Per

Karel,

Thank you for your suggestion... I got the schema creation working;
however, now I am getting this error
"com.vividsolutions.jts.geom.Geometry does not have a no-arg default
constructor." on the jts geometry,
Event thought I've created an empty constructor in my domain object.
Below is code snippet from my domain object and the full error message.
Any idea or suggestion how to solve this issue?


@Column(name="LOCATION", columnDefinition = "MDSYS.SDO_GEOMETRY",
nullable = true)
@Type(type="org.hibernatespatial.GeometryUserType")
public Geometry getLocation() {
        return location;
}

public void setLocation(Geometry location) {
     this.location = location;
}


Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1
counts of
IllegalAnnotationExceptions
com.vividsolutions.jts.geom.Geometry does not have a no-arg default
constructor.

        this problem is related to the following location:
                at com.vividsolutions.jts.geom.Geometry
                at public com.vividsolutions.jts.geom.Geometry
com.solers.sushi.
pojo.target.model.ExternalTarget.getLocation()
                at com.solers.sushi.pojo.target.model.ExternalTarget

        at
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check
(IllegalAnnotationsException.java:102)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContex
tImpl.java:438)
        at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.ja
va:286)
        at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
139)
        at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
117)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
        at
org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContext(JAXBDataBinding
.java:457)
        at
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:2
38)
        ... 163 more


Regards

Hila

-----Original Message-----
From: hibernatespatial-users-bounces at lists.hibernatespatial.org
[mailto:hibernatespatial-users-bounces at lists.hibernatespatial.org] On
Behalf Of Karel Maesen
Sent: Monday, October 05, 2009 4:50 AM
To: Hibernate Spatial Users Discussion
Subject: Re: [hibernatespatial-users] Could not determine type
for:org.hibernateespatial.GeometryUserType

Hi,

In the @Column annotation, try setting columnDefinition =
"MDSYS.SDO_GEOMETRY".

Regards,
Karel
On 01 Oct 2009, at 23:21, Olumee, Milan wrote:

> Hi,
>
>
>
> I am using oracle hibernate spatial with spring framework, I get an
> error when I try to deploy my application in the jBoss.  This is
> how I defined the geometry column in the domain object.
>
>
>
> // Geometry column
>
>     @Column(name="LOCATION", columnDefinition="Geometry", nullable
> = true)
>
>     @Type(type="org.hibernatespatial.GeometryUserType")
>
>     private Geometry location;
>
>
>
>     public Geometry getLocation() {
>
>         return location;
>
>     }
>
>
>
>     public void setLocation(Geometry location) {
>
>         this.location = location;
>
>     }
>
>
>
> Here is part of my hibernate config file
>
>
>
> <prop
> key="hibernate.dialect">org.hibernatespatial.oracle.OracleSpatial10gDi

> alect</prop>
>
>                 <prop key="hibernate.connection.autocommit">false</
> prop>
>
>                 <prop key="hibernate.connection.shutdown">true</prop>
>
>                 <prop
> key="hibernate.cache.use_second_level_cache">false</prop>
>
>
>
>                 <!-- update should be used here so table is created
> on fresh install, but kept around thereafter -->
>
>                 <prop key="hibernate.hbm2ddl.auto">update</prop>
>
>                 <prop
> key="hibernate.current_session_context_class">thread</prop>
>
>                 <prop key="hibernate.transaction.factory_class
> ">org.hibernate.transaction.JDBCTransactionFactory</prop>
>
>
>
>
>
> I do not use a mapping file rather I use the annotation in the
> domain to create the schema, My question is can this be done
> without a mapping file? If not,  is there a workaround for it
> because I am converting an existing application to hibernate
> spatial and the current application does not have a mapping file
> defined.
>
>
>
>
>
> With these I get the following error:
>
>
>
> 2009-10-01 16:25:26,699 ERROR
> [org.springframework.web.context.ContextLoader] Context
> initialization failed
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionRegistry' defined in ServletContext
> resource [/WEB-INF/classes/security-beans.xml]: Initialization of
> bean failed; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'cxf' defined in class path resource [META-
> INF/cxf/cxf.xml]: Initialization of bean failed; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name
> 'org.springframework.transaction.interceptor.TransactionAttributeSourc

> eAdvisor': Cannot create inner bean '(inner bean)' of type
> [org.springframework.transaction.interceptor.TransactionInterceptor] w

> hile setting bean property 'transactionInterceptor'; nested
> exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name '(inner bean)#10': Cannot resolve reference
> to bean 'transactionManager' while setting bean property
> 'transactionManager'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'transactionManager' defined in
> ServletContext resource [/WEB-INF/classes/application-
> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
> while setting bean property 'sessionFactory'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
> of init method failed; nested exception is
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
> Caused by:
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'cxf' defined in class path resource [META-
> INF/cxf/cxf.xml]: Initialization of bean failed; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name
> 'org.springframework.transaction.interceptor.TransactionAttributeSourc

> eAdvisor': Cannot create inner bean '(inner bean)' of type
> [org.springframework.transaction.interceptor.TransactionInterceptor] w

> hile setting bean property 'transactionInterceptor'; nested
> exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name '(inner bean)#10': Cannot resolve reference
> to bean 'transactionManager' while setting bean property
> 'transactionManager'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'transactionManager' defined in
> ServletContext resource [/WEB-INF/classes/application-
> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
> while setting bean property 'sessionFactory'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
> of init method failed; nested exception is
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
> Caused by:
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name
> 'org.springframework.transaction.interceptor.TransactionAttributeSourc

> eAdvisor': Cannot create inner bean '(inner bean)' of type
> [org.springframework.transaction.interceptor.TransactionInterceptor] w

> hile setting bean property 'transactionInterceptor'; nested
> exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name '(inner bean)#10': Cannot resolve reference
> to bean 'transactionManager' while setting bean property
> 'transactionManager'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'transactionManager' defined in
> ServletContext resource [/WEB-INF/classes/application-
> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
> while setting bean property 'sessionFactory'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
> of init method failed; nested exception is
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
> Caused by:
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name '(inner bean)#10': Cannot resolve reference
> to bean 'transactionManager' while setting bean property
> 'transactionManager'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'transactionManager' defined in
> ServletContext resource [/WEB-INF/classes/application-
> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
> while setting bean property 'sessionFactory'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
> of init method failed; nested exception is
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
> Caused by:
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'transactionManager' defined in
> ServletContext resource [/WEB-INF/classes/application-
> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
> while setting bean property 'sessionFactory'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
> of init method failed; nested exception is
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
> Caused by:
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory' defined in ServletContext
> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
> of init method failed; nested exception is
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
> Caused by:
>
> org.hibernate.MappingException: Could not determine type for:
> org.hibernateespatial.GeometryUserType, for columns:
> [org.hibernate.mapping.Column(LOCATION)]
>
>                 at org.hibernate.mapping.SimpleValue.getType
> (SimpleValue.java:266)
>
>                 at org.hibernate.mapping.SimpleValue.isValid
> (SimpleValue.java:253)
>
>                 at org.hibernate.mapping.Property.isValid
> (Property.java:185)
>
>                 at org.hibernate.mapping.PersistentClass.validate
> (PersistentClass.java:440)
>
>                 at org.hibernate.mapping.RootClass.validate
> (RootClass.java:192)
>
>                 at org.hibernate.cfg.Configuration.validate
> (Configuration.java:1102)
>
>
>
> With respect
>
>
>
> Hila
_______________________________________________
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: Could not determine type for: org.hibernateespatial.GeometryUserType

Karel Maesen
Administrator
Hi,

A Geometry should be seen on the same level as Double, String or Date ( in Domain-Driven Design terminology they are Value objects, not Entities). So I find it surprising that they should ever need to instantiated directly by a BeanFactory - but then again, I don't use Spring very often. Could you sketch how in your application the Geometry instances are wired to some other object using Spring?

I don't like the idea of doing without JTS. It is a good library that provides, besides the basic Geometry types, a lot of extra functionality such as spatial algorithms, operators, etc.  (Btw, the Circle class is a utility class for linearizing arc-segments, and not a type of Geometry).  But I could ask the JTS developers whether they would consider providing no-arg constructors.

Regards,

Karel



On 28 May 2010, at 18:07, Per Engström wrote:

> Hi!
>
> I found this old thread on this list and I just ran in to the same
> problem as Hila describes below. It has little to do with JAXB. The
> problem boils down to the fact that when using a Spring context all
> related objects must be JavaBeans. A JavaBean must provide a no-arg
> constructor and getters and setters for all properties. The objects in
> the com.vividsolutions.jts.geom.* package does not fulfill the
> requirements of being a JavaBeans since they do not have no-args
> constructors :(
>
> Are there any plans to use some other implementation of spatial types
> other than Java Topology Suit that are Plain Old JavaBeans? I would be
> very, very interested in seeing that happening.
>
> As there alreary is a JavaBean for Circle in
> hibernate-spatial-1.0.jar, would it not be quite an easy task to
> implement Point, Line and Polygon (and Multi*) as well and getting rid
> of the dependency to jts?
>
> Regards,
> Per
>
> Karel,
>
> Thank you for your suggestion... I got the schema creation working;
> however, now I am getting this error
> "com.vividsolutions.jts.geom.Geometry does not have a no-arg default
> constructor." on the jts geometry,
> Event thought I've created an empty constructor in my domain object.
> Below is code snippet from my domain object and the full error message.
> Any idea or suggestion how to solve this issue?
>
>
> @Column(name="LOCATION", columnDefinition = "MDSYS.SDO_GEOMETRY",
> nullable = true)
> @Type(type="org.hibernatespatial.GeometryUserType")
> public Geometry getLocation() {
>        return location;
> }
>
> public void setLocation(Geometry location) {
>     this.location = location;
> }
>
>
> Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1
> counts of
> IllegalAnnotationExceptions
> com.vividsolutions.jts.geom.Geometry does not have a no-arg default
> constructor.
>
>        this problem is related to the following location:
>                at com.vividsolutions.jts.geom.Geometry
>                at public com.vividsolutions.jts.geom.Geometry
> com.solers.sushi.
> pojo.target.model.ExternalTarget.getLocation()
>                at com.solers.sushi.pojo.target.model.ExternalTarget
>
>        at
> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check
> (IllegalAnnotationsException.java:102)
>        at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContex
> tImpl.java:438)
>        at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.ja
> va:286)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
> 139)
>        at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
> 117)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
>        at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
>        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
>        at
> org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContext(JAXBDataBinding
> .java:457)
>        at
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:2
> 38)
>        ... 163 more
>
>
> Regards
>
> Hila
>
> -----Original Message-----
> From: hibernatespatial-users-bounces at lists.hibernatespatial.org
> [mailto:hibernatespatial-users-bounces at lists.hibernatespatial.org] On
> Behalf Of Karel Maesen
> Sent: Monday, October 05, 2009 4:50 AM
> To: Hibernate Spatial Users Discussion
> Subject: Re: [hibernatespatial-users] Could not determine type
> for:org.hibernateespatial.GeometryUserType
>
> Hi,
>
> In the @Column annotation, try setting columnDefinition =
> "MDSYS.SDO_GEOMETRY".
>
> Regards,
> Karel
> On 01 Oct 2009, at 23:21, Olumee, Milan wrote:
>
>> Hi,
>>
>>
>>
>> I am using oracle hibernate spatial with spring framework, I get an
>> error when I try to deploy my application in the jBoss.  This is
>> how I defined the geometry column in the domain object.
>>
>>
>>
>> // Geometry column
>>
>>    @Column(name="LOCATION", columnDefinition="Geometry", nullable
>> = true)
>>
>>    @Type(type="org.hibernatespatial.GeometryUserType")
>>
>>    private Geometry location;
>>
>>
>>
>>    public Geometry getLocation() {
>>
>>        return location;
>>
>>    }
>>
>>
>>
>>    public void setLocation(Geometry location) {
>>
>>        this.location = location;
>>
>>    }
>>
>>
>>
>> Here is part of my hibernate config file
>>
>>
>>
>> <prop
>> key="hibernate.dialect">org.hibernatespatial.oracle.OracleSpatial10gDi
>
>> alect</prop>
>>
>>                <prop key="hibernate.connection.autocommit">false</
>> prop>
>>
>>                <prop key="hibernate.connection.shutdown">true</prop>
>>
>>                <prop
>> key="hibernate.cache.use_second_level_cache">false</prop>
>>
>>
>>
>>                <!-- update should be used here so table is created
>> on fresh install, but kept around thereafter -->
>>
>>                <prop key="hibernate.hbm2ddl.auto">update</prop>
>>
>>                <prop
>> key="hibernate.current_session_context_class">thread</prop>
>>
>>                <prop key="hibernate.transaction.factory_class
>> ">org.hibernate.transaction.JDBCTransactionFactory</prop>
>>
>>
>>
>>
>>
>> I do not use a mapping file rather I use the annotation in the
>> domain to create the schema, My question is can this be done
>> without a mapping file? If not,  is there a workaround for it
>> because I am converting an existing application to hibernate
>> spatial and the current application does not have a mapping file
>> defined.
>>
>>
>>
>>
>>
>> With these I get the following error:
>>
>>
>>
>> 2009-10-01 16:25:26,699 ERROR
>> [org.springframework.web.context.ContextLoader] Context
>> initialization failed
>>
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionRegistry' defined in ServletContext
>> resource [/WEB-INF/classes/security-beans.xml]: Initialization of
>> bean failed; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'cxf' defined in class path resource [META-
>> INF/cxf/cxf.xml]: Initialization of bean failed; nested exception
>> is org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name
>> 'org.springframework.transaction.interceptor.TransactionAttributeSourc
>
>> eAdvisor': Cannot create inner bean '(inner bean)' of type
>> [org.springframework.transaction.interceptor.TransactionInterceptor] w
>
>> hile setting bean property 'transactionInterceptor'; nested
>> exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name '(inner bean)#10': Cannot resolve reference
>> to bean 'transactionManager' while setting bean property
>> 'transactionManager'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'transactionManager' defined in
>> ServletContext resource [/WEB-INF/classes/application-
>> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
>> while setting bean property 'sessionFactory'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionFactory' defined in ServletContext
>> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
>> of init method failed; nested exception is
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>> Caused by:
>>
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'cxf' defined in class path resource [META-
>> INF/cxf/cxf.xml]: Initialization of bean failed; nested exception
>> is org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name
>> 'org.springframework.transaction.interceptor.TransactionAttributeSourc
>
>> eAdvisor': Cannot create inner bean '(inner bean)' of type
>> [org.springframework.transaction.interceptor.TransactionInterceptor] w
>
>> hile setting bean property 'transactionInterceptor'; nested
>> exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name '(inner bean)#10': Cannot resolve reference
>> to bean 'transactionManager' while setting bean property
>> 'transactionManager'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'transactionManager' defined in
>> ServletContext resource [/WEB-INF/classes/application-
>> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
>> while setting bean property 'sessionFactory'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionFactory' defined in ServletContext
>> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
>> of init method failed; nested exception is
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>> Caused by:
>>
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name
>> 'org.springframework.transaction.interceptor.TransactionAttributeSourc
>
>> eAdvisor': Cannot create inner bean '(inner bean)' of type
>> [org.springframework.transaction.interceptor.TransactionInterceptor] w
>
>> hile setting bean property 'transactionInterceptor'; nested
>> exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name '(inner bean)#10': Cannot resolve reference
>> to bean 'transactionManager' while setting bean property
>> 'transactionManager'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'transactionManager' defined in
>> ServletContext resource [/WEB-INF/classes/application-
>> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
>> while setting bean property 'sessionFactory'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionFactory' defined in ServletContext
>> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
>> of init method failed; nested exception is
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>> Caused by:
>>
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name '(inner bean)#10': Cannot resolve reference
>> to bean 'transactionManager' while setting bean property
>> 'transactionManager'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'transactionManager' defined in
>> ServletContext resource [/WEB-INF/classes/application-
>> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
>> while setting bean property 'sessionFactory'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionFactory' defined in ServletContext
>> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
>> of init method failed; nested exception is
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>> Caused by:
>>
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'transactionManager' defined in
>> ServletContext resource [/WEB-INF/classes/application-
>> hibernate.xml]: Cannot resolve reference to bean 'sessionFactory'
>> while setting bean property 'sessionFactory'; nested exception is
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionFactory' defined in ServletContext
>> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
>> of init method failed; nested exception is
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>> Caused by:
>>
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'sessionFactory' defined in ServletContext
>> resource [/WEB-INF/classes/application-hibernate.xml]: Invocation
>> of init method failed; nested exception is
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>> Caused by:
>>
>> org.hibernate.MappingException: Could not determine type for:
>> org.hibernateespatial.GeometryUserType, for columns:
>> [org.hibernate.mapping.Column(LOCATION)]
>>
>>                at org.hibernate.mapping.SimpleValue.getType
>> (SimpleValue.java:266)
>>
>>                at org.hibernate.mapping.SimpleValue.isValid
>> (SimpleValue.java:253)
>>
>>                at org.hibernate.mapping.Property.isValid
>> (Property.java:185)
>>
>>                at org.hibernate.mapping.PersistentClass.validate
>> (PersistentClass.java:440)
>>
>>                at org.hibernate.mapping.RootClass.validate
>> (RootClass.java:192)
>>
>>                at org.hibernate.cfg.Configuration.validate
>> (Configuration.java:1102)
>>
>>
>>
>> With respect
>>
>>
>>
>> Hila
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

_______________________________________________
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: Could not determine type for: org.hibernateespatial.GeometryUserType

morrowyn
I'm running in the exact same issue. Did you manager to figure out a workaround in order to use the  JTS library over RESTful services?

I'm considering using Jersey or RESTeasy  instead, but i reckon they probably need the same default c'tor. Which strikes me, because the Double, Integer object do have default c'tor and can be seen as Value types , so why not provide a default c'tor to the JTS. It will make life easier and more compatible with other frameworks.
Reply | Threaded
Open this post in threaded view
|

Re: Could not determine type for: org.hibernateespatial.GeometryUserType

Jan Boonen
One thing that you can do is create a Marshaller for JAXB2 that marshals
JTS geometries to GML geometries en vice versa. This way you can apply
JTS in your REST and SOAP projects.

Cheers,

Jan

On 29-4-2011 12:33, morrowyn wrote:

> I'm running in the exact same issue. Did you manager to figure out a
> workaround in order to use the  JTS library over RESTful services?
>
> I'm considering using Jersey or RESTeasy  instead, but i reckon they
> probably need the same default c'tor. Which strikes me, because the Double,
> Integer object do have default c'tor and can be seen as Value types , so why
> not provide a default c'tor to the JTS. It will make life easier and more
> compatible with other frameworks.--
> View this message in context: http://hibernate-spatial.1140993.n2.nabble.com/Re-Could-not-determine-type-for-org-hibernateespatial-GeometryUserType-tp5113741p6316420.html
> Sent from the Hibernate Spatial - Users mailing list archive at Nabble.com.
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

_______________________________________________
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: Could not determine type for: org.hibernateespatial.GeometryUserType

Karel Maesen
Administrator
You could checkout Geolatte Featureserver: http://www.geolatte.org/confluence/display/fserv/Home. I think it covers your needs.

Documentation is sketchy at this point, but it is used in production systems at our clients for over a year now running on top of Postgresql. We find it's quite stable (and fast).  My Qmino colleagues and I developed it so you can ask me if you run into trouble.

Regards,

Karel

On 29 Apr 2011, at 12:47, Jan Boonen wrote:

> One thing that you can do is create a Marshaller for JAXB2 that marshals JTS geometries to GML geometries en vice versa. This way you can apply JTS in your REST and SOAP projects.
>
> Cheers,
>
> Jan
>
> On 29-4-2011 12:33, morrowyn wrote:
>> I'm running in the exact same issue. Did you manager to figure out a
>> workaround in order to use the  JTS library over RESTful services?
>>
>> I'm considering using Jersey or RESTeasy  instead, but i reckon they
>> probably need the same default c'tor. Which strikes me, because the Double,
>> Integer object do have default c'tor and can be seen as Value types , so why
>> not provide a default c'tor to the JTS. It will make life easier and more
>> compatible with other frameworks.--
>> View this message in context: http://hibernate-spatial.1140993.n2.nabble.com/Re-Could-not-determine-type-for-org-hibernateespatial-GeometryUserType-tp5113741p6316420.html
>> Sent from the Hibernate Spatial - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

_______________________________________________
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: Could not determine type for: org.hibernateespatial.GeometryUserType

Simulacrum Is True
In reply to this post by Jan Boonen
Thanks, do you happen to have a small example for this?

On 4/29/11 12:47 PM, Jan Boonen wrote:

> One thing that you can do is create a Marshaller for JAXB2 that
> marshals JTS geometries to GML geometries en vice versa. This way you
> can apply JTS in your REST and SOAP projects.
>
> Cheers,
>
> Jan
>
> On 29-4-2011 12:33, morrowyn wrote:
>> I'm running in the exact same issue. Did you manager to figure out a
>> workaround in order to use the  JTS library over RESTful services?
>>
>> I'm considering using Jersey or RESTeasy  instead, but i reckon they
>> probably need the same default c'tor. Which strikes me, because the
>> Double,
>> Integer object do have default c'tor and can be seen as Value types ,
>> so why
>> not provide a default c'tor to the JTS. It will make life easier and
>> more
>> compatible with other frameworks.--
>> View this message in context:
>> http://hibernate-spatial.1140993.n2.nabble.com/Re-Could-not-determine-type-for-org-hibernateespatial-GeometryUserType-tp5113741p6316420.html
>> Sent from the Hibernate Spatial - Users mailing list archive at
>> Nabble.com.
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
>

_______________________________________________
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: Could not determine type for: org.hibernateespatial.GeometryUserType

Simulacrum Is True
Hi,

Just to let you know, I did the following.

I wrote a couple of xmladapters on my jts getters so they get xml
marshalled the way you want basically.
This library
(http://confluence.highsource.org/display/OGCS/GML+Parser+for+Java)
seems good if you need to use the GML way, however I dediced to stick to
the wkt formatting., since I have no need for GML at the moment. Here is
an article on how to write the xmladapters in.
http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html

Anyways, thanks for all the help.
Regards

On 4/29/11 1:05 PM, Simulacrum Is True wrote:

> Thanks, do you happen to have a small example for this?
>
> On 4/29/11 12:47 PM, Jan Boonen wrote:
>> One thing that you can do is create a Marshaller for JAXB2 that
>> marshals JTS geometries to GML geometries en vice versa. This way you
>> can apply JTS in your REST and SOAP projects.
>>
>> Cheers,
>>
>> Jan
>>
>> On 29-4-2011 12:33, morrowyn wrote:
>>> I'm running in the exact same issue. Did you manager to figure out a
>>> workaround in order to use the  JTS library over RESTful services?
>>>
>>> I'm considering using Jersey or RESTeasy  instead, but i reckon they
>>> probably need the same default c'tor. Which strikes me, because the
>>> Double,
>>> Integer object do have default c'tor and can be seen as Value types ,
>>> so why
>>> not provide a default c'tor to the JTS. It will make life easier and
>>> more
>>> compatible with other frameworks.--
>>> View this message in context:
>>> http://hibernate-spatial.1140993.n2.nabble.com/Re-Could-not-determine-type-for-org-hibernateespatial-GeometryUserType-tp5113741p6316420.html
>>> Sent from the Hibernate Spatial - Users mailing list archive at
>>> Nabble.com.
>>> _______________________________________________
>>> hibernatespatial-users mailing list
>>> [hidden email]
>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>>
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>
>>
>>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>

_______________________________________________
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: Could not determine type for: org.hibernateespatial.GeometryUserType

Jan Boonen
In reply to this post by Simulacrum Is True
At our company (Geodan) we have development such a library under the
ASF2.0 license. However, we have not yet had time to publish the library
in our maven repository. We'll plan to get this done soon.

Cheers,

Jan

On 29-4-2011 13:05, Simulacrum Is True wrote:

> Thanks, do you happen to have a small example for this?
>
> On 4/29/11 12:47 PM, Jan Boonen wrote:
>> One thing that you can do is create a Marshaller for JAXB2 that
>> marshals JTS geometries to GML geometries en vice versa. This way you
>> can apply JTS in your REST and SOAP projects.
>>
>> Cheers,
>>
>> Jan
>>
>> On 29-4-2011 12:33, morrowyn wrote:
>>> I'm running in the exact same issue. Did you manager to figure out a
>>> workaround in order to use the  JTS library over RESTful services?
>>>
>>> I'm considering using Jersey or RESTeasy  instead, but i reckon they
>>> probably need the same default c'tor. Which strikes me, because the
>>> Double,
>>> Integer object do have default c'tor and can be seen as Value types ,
>>> so why
>>> not provide a default c'tor to the JTS. It will make life easier and
>>> more
>>> compatible with other frameworks.--
>>> View this message in context:
>>> http://hibernate-spatial.1140993.n2.nabble.com/Re-Could-not-determine-type-for-org-hibernateespatial-GeometryUserType-tp5113741p6316420.html
>>> Sent from the Hibernate Spatial - Users mailing list archive at
>>> Nabble.com.
>>> _______________________________________________
>>> hibernatespatial-users mailing list
>>> [hidden email]
>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>>
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>
>>
>>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

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