something about oracle spatial field

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

something about oracle spatial field

likehua
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityDao': Invocation of init method failed; nested exception is java.lang.RuntimeException: Can't determine ElementType from etype:3 and interp.:1
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:147)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
        at org.apache.catalina.core.StandardService.start(StandardService.java:519)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.RuntimeException: Can't determine ElementType from etype:3 and interp.:1
        at org.hibernatespatial.oracle.SDOGeometryType$ElementType.parseType(SDOGeometryType.java:948)
        at org.hibernatespatial.oracle.SDOGeometryType$ELEM_INFO.getElementType(SDOGeometryType.java:1140)
        at org.hibernatespatial.oracle.SDOGeometryType$SDO_GEOMETRY.getNumElements(SDOGeometryType.java:1440)
        at org.hibernatespatial.oracle.SDOGeometryType.convertSDOPolygon(SDOGeometryType.java:520)
        at org.hibernatespatial.oracle.SDOGeometryType.convert2JTS(SDOGeometryType.java:408)
        at org.hibernatespatial.oracle.SDOGeometryType.convert2JTS(SDOGeometryType.java:395)
        at org.hibernatespatial.AbstractDBGeometryType.nullSafeGet(AbstractDBGeometryType.java:127)
        at org.hibernatespatial.GeometryUserType.nullSafeGet(GeometryUserType.java:172)
        at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
        at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
        at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
        at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
        at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
        at org.hibernate.loader.Loader.getRow(Loader.java:1230)
        at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
        at org.hibernate.loader.Loader.doQuery(Loader.java:724)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
        at org.hibernate.loader.Loader.doList(Loader.java:2232)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
        at org.hibernate.loader.Loader.list(Loader.java:2124)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1597)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
        at org.springframework.orm.hibernate3.HibernateTemplate$5.doInHibernate(HibernateTemplate.java:600)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
        at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
        at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:595)
        at com.geostar.city.dao.impl.CityDaoImpl.getCityBeanByNameAndFlag(CityDaoImpl.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:297)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:250)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:144)
        ... 32 more

Anybody can tell me why ?

My  Hibernate configuration file go as follow:
<hibernate-mapping package="com.geostar.city.model">
        <class name="CityBean" table="zjxzqh">
        <id name="oid" column="OID">
                        <generator class="assigned" />
                </id>
        <property name="geometry" type="org.hibernatespatial.GeometryUserType" not-null="true">
                        <column name="Geometry"  />
                </property>
        </class>
</hibernate-mapping>
and  my CityBean pojo  go as follow :
import com.vividsolutions.jts.geom.Polygon;

//@Entity
//@Table(name="zjxzqh_copy")
public class CityBean implements Serializable {
        private static final long serialVersionUID = 1532238873675730565L;
// @Id
// @GeneratedValue(strategy = GenerationType.AUTO)
        private Long oid;
        private Polygon geometry;
        private String name;
        private String fullname;
        public long getOid() {
                return oid;
        }
        public void setOid(long oid) {
                this.oid = oid;
        }
// @Column(name="GEOMETRY")
// @Type(type="org.hibernatespatial.GeometryUserType")
        public Polygon getGeometry() {
                return geometry;
        }
        public void setGeometry(Polygon geometry) {
                this.geometry = geometry;
        }
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        public String getFullname() {
                return fullname;
        }
        public void setFullname(String fullname) {
                this.fullname = fullname;
        }
        public String getAddress() {
                return address;
        }
        public void setAddress(String address) {
                this.address = address;
        }
        public String getCountry() {
                return country;
        }
        public void setCountry(String country) {
                this.country = country;
        }
        public String getProvince() {
                return province;
        }
        public void setProvince(String province) {
                this.province = province;
        }
        public String getCity() {
                return city;
        }
        public void setCity(String city) {
                this.city = city;
        }
        public String getCounty() {
                return county;
        }
        public void setCounty(String county) {
                this.county = county;
        }
        public String getTown() {
                return town;
        }
        public void setTown(String town) {
                this.town = town;
        }
        public String getCode() {
                return code;
        }
        public void setCode(String code) {
                this.code = code;
        }
        public Double getFlag() {
                return flag;
        }
        public void setFlag(Double flag) {
                this.flag = flag;
        }
        private String address;
        private String country;
        private String province;
        private String city;
        private String county;
        private String town;
        private String code;
        private Double flag;
       

}
Any help would be  appreciated,thks !
Reply | Threaded
Open this post in threaded view
|

Re:something about oracle spatial field

aiya
make sure the geometry fielly
make sure the hibernate spatial version is fit for the oracle version



在 2012-02-13 17:07:36,"likehua [via Hibernate Spatial]" <[hidden email]> 写道:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cityDao': Invocation of init method failed; nested exception is java.lang.RuntimeException: Can't determine ElementType from etype:3 and interp.:1
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:147)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
        at org.apache.catalina.core.StandardService.start(StandardService.java:519)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.RuntimeException: Can't determine ElementType from etype:3 and interp.:1
        at org.hibernatespatial.oracle.SDOGeometryType$ElementType.parseType(SDOGeometryType.java:948)
        at org.hibernatespatial.oracle.SDOGeometryType$ELEM_INFO.getElementType(SDOGeometryType.java:1140)
        at org.hibernatespatial.oracle.SDOGeometryType$SDO_GEOMETRY.getNumElements(SDOGeometryType.java:1440)
        at org.hibernatespatial.oracle.SDOGeometryType.convertSDOPolygon(SDOGeometryType.java:520)
        at org.hibernatespatial.oracle.SDOGeometryType.convert2JTS(SDOGeometryType.java:408)
        at org.hibernatespatial.oracle.SDOGeometryType.convert2JTS(SDOGeometryType.java:395)
        at org.hibernatespatial.AbstractDBGeometryType.nullSafeGet(AbstractDBGeometryType.java:127)
        at org.hibernatespatial.GeometryUserType.nullSafeGet(GeometryUserType.java:172)
        at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
        at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
        at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
        at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
        at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
        at org.hibernate.loader.Loader.getRow(Loader.java:1230)
        at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
        at org.hibernate.loader.Loader.doQuery(Loader.java:724)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
        at org.hibernate.loader.Loader.doList(Loader.java:2232)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
        at org.hibernate.loader.Loader.list(Loader.java:2124)
        at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1597)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
        at org.springframework.orm.hibernate3.HibernateTemplate$5.doInHibernate(HibernateTemplate.java:600)
        at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
        at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
        at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:595)
        at com.geostar.city.dao.impl.CityDaoImpl.getCityBeanByNameAndFlag(CityDaoImpl.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:297)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:250)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:144)
        ... 32 more

Anybody can tell me why ?

My  Hibernate configuration file go as follow:
<hibernate-mapping package="com.geostar.city.model">
        <class name="CityBean" table="zjxzqh">
        <id name="oid" column="OID">
                        <generator class="assigned" />
                </id>
        <property name="geometry" type="org.hibernatespatial.GeometryUserType" not-null="true">
                        <column name="Geometry"  />
                </property>
        </class>
</hibernate-mapping>
and  my CityBean pojo  go as follow :
import com.vividsolutions.jts.geom.Polygon;

//@Entity
//@Table(name="zjxzqh_copy")
public class CityBean implements Serializable {
        private static final long serialVersionUID = 1532238873675730565L;
// @Id
// @GeneratedValue(strategy = GenerationType.AUTO)
        private Long oid;
        private Polygon geometry;
        private String name;
        private String fullname;
        public long getOid() {
                return oid;
        }
        public void setOid(long oid) {
                this.oid = oid;
        }
// @Column(name="GEOMETRY")
// @Type(type="org.hibernatespatial.GeometryUserType")
        public Polygon getGeometry() {
                return geometry;
        }
        public void setGeometry(Polygon geometry) {
                this.geometry = geometry;
        }
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        public String getFullname() {
                return fullname;
        }
        public void setFullname(String fullname) {
                this.fullname = fullname;
        }
        public String getAddress() {
                return address;
        }
        public void setAddress(String address) {
                this.address = address;
        }
        public String getCountry() {
                return country;
        }
        public void setCountry(String country) {
                this.country = country;
        }
        public String getProvince() {
                return province;
        }
        public void setProvince(String province) {
                this.province = province;
        }
        public String getCity() {
                return city;
        }
        public void setCity(String city) {
                this.city = city;
        }
        public String getCounty() {
                return county;
        }
        public void setCounty(String county) {
                this.county = county;
        }
        public String getTown() {
                return town;
        }
        public void setTown(String town) {
                this.town = town;
        }
        public String getCode() {
                return code;
        }
        public void setCode(String code) {
                this.code = code;
        }
        public Double getFlag() {
                return flag;
        }
        public void setFlag(Double flag) {
                this.flag = flag;
        }
        private String address;
        private String country;
        private String province;
        private String city;
        private String county;
        private String town;
        private String code;
        private Double flag;
       

}
Any help could be  appreciated,thks !



If you reply to this email, your message will be added to the discussion below:
http://hibernate-spatial.1140993.n2.nabble.com/something-about-oracle-spatial-field-tp7279764p7279764.html
To start a new topic under Hibernate Spatial, email ml-node+[hidden email]
To unsubscribe from Hibernate Spatial, click here.
NAML