No Dialect mapping for JDBC type: 2003

13 messages Options
Embed this post
Permalink
Carsten Höhne-3

No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hello,
we are new to Hibernate Spatial. So we followed the tutorial to setup
a first project.
We are using Seam2.0.0GA and JBoss Tools.
So we are setting up a Seam project deployed as a war archive. This
runs fine as usual.
Next step is adding the 3 required Jar files to the project.
hibernate-spatial
jts
hibernate-spatial-mysql (We are using mysql)

Now the Entity from the tutorial is created in 2 steps.
First the entity Event is created with JBoss Tools (which then deployed fine)
After that the additional attributes from the tutorial are added.
(Which does not deploy.)
Our questions:
What does the error mean? see subject
Is hibernate-spatial useable with JPA?
Is hibernate-spatial useable with annotation?
Ciao,
Carsten

the exception we got

javax.persistence.PersistenceException:
org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
        at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
        at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
        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:585)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hi,

On 13 Feb 2008, at 15:45, Carsten Höhne wrote:

>
> Now the Entity from the tutorial is created in 2 steps.
> First the entity Event is created with JBoss Tools (which then  
> deployed fine)
> After that the additional attributes from the tutorial are added.
> (Which does not deploy.)
> Our questions:
> What does the error mean? see subject

Hibernate sees a column value of type ARRAY and doesn't know what to  
do with it. I guess that the Type annotation on the spatial column is  
incorrect, or not picked up by Hibernate (MySQL stores spatial data  
in a byte array).

> Is hibernate-spatial useable with JPA?
> Is hibernate-spatial useable with annotation?

I know from other messages on the list that Hibernate Spatial is used  
with annotations. So it should work.

Regards,

Karel Maesen





> Ciao,
> Carsten
>
> the exception we got
>
> javax.persistence.PersistenceException:
> org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory
> (Ejb3Configuration.java:720)
> at  
> org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory
> (HibernatePersistence.java:121)
> at javax.persistence.Persistence.createEntityManagerFactory
> (Persistence.java:51)
> at  
> org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFac
> tory(EntityManagerFactory.java:85)
> at org.jboss.seam.persistence.EntityManagerFactory.startup
> (EntityManagerFactory.java:50)
> 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:585)
> at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
> at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:
> 125)
> _______________________________________________
> 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
Carsten Höhne-3

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hallo ,
Karel, Thanks for the fast reply.

On 2/13/08, Karel Maesen <[hidden email]> wrote:

> Hi,
> Hibernate sees a column value of type ARRAY and doesn't know what to
> do with it. I guess that the Type annotation on the spatial column is
> incorrect, or not picked up by Hibernate (MySQL stores spatial data
> in a byte array).
>
> > Is hibernate-spatial useable with JPA?
> > Is hibernate-spatial useable with annotation?
>
> I know from other messages on the list that Hibernate Spatial is used
> with annotations. So it should work.
This is my annotated mthod:
        @Column(name="LOC")
        @Type(type="org.hibernatespatial.GeometryUserType")
        public Point getLocation(){
                return this.location;
        }

And this the corresponding mapping from the tutorial
        <property name="location"
                        type="org.hibernatespatial.GeometryUserType"
                        column="LOC"/>

Is the annotation correct?
Could it be that something is not correct setup?
Ciao,
Carsten
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Carsten Höhne-3

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hello,
To verify this, i installed postgreSQL on my windows box. After that i
changed the datasource according to the tutorial. And, of course,
persistence.xml is also changed.-
The first error was of because i forgot to copy the postgis.jar.
But after that, the same error as with mysql appears:

javax.persistence.PersistenceException:
org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
        at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
        at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
        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:585)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
        at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
        at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
        at org.jboss.seam.Component.newInstance(Component.java:1968)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
        at org.jboss.seam.init.Initialization.init(Initialization.java:555)
        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
        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:585)
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
        at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
        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:585)
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
        at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
        at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
        at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
        at org.jboss.web.WebModule.startModule(WebModule.java:83)
        at org.jboss.web.WebModule.startService(WebModule.java:61)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:417)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy44.start(Unknown Source)
        at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
        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:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
        at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
        at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
        at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
        at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy45.start(Unknown Source)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
        at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy9.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
        at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:417)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
        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:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
        at $Proxy5.deploy(Unknown Source)
        at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
        at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
        at org.jboss.Main.boot(Main.java:200)
        at org.jboss.Main$1.run(Main.java:508)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC
type: 2003
        at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
        at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
        at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:291)
        at org.hibernate.mapping.Column.getSqlType(Column.java:182)
        at org.hibernate.mapping.Table.sqlCreateString(Table.java:394)
        at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:848)
        at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:74)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3C
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Carsten Höhne-3

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hello,
my problem is about using hibernatespatial in an JEE5 Environment
using JPA (with annotations) in a JBoss 4.2.2 Application server. In
this environment i get the above exceptions.
I have tried the tutorial as is and this is working, but only for postgreSQL.
Not for MySql, in this case the mapping error for JDBC Type 2003 occurs.

Was someone be able to run the tutorial on mysql?
What could be wrong with my setup?
Do i need another jar besides the mysql jdbc connector? For postgreSQL
there are two jars and the same holds for Oracle. But i could not
figure out, if mysql also has two jars?

And the most interesting question: Why does this not run in my JBoss AS ?
Ciao
Carsten
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hello Carsten,

On 14 Feb 2008, at 17:36, Carsten Höhne wrote:

> my problem is about using hibernatespatial in an JEE5 Environment
> using JPA (with annotations) in a JBoss 4.2.2 Application server. In
> this environment i get the above exceptions.
> I have tried the tutorial as is and this is working, but only for  
> postgreSQL.
> Not for MySql, in this case the mapping error for JDBC Type 2003  
> occurs.
>

Did you use the JPA annotations or Hibernate XML mapping files for  
these Postgresql tests?

What versions of MySQL and JDBC driver do you use?

> Was someone be able to run the tutorial on mysql?
> What could be wrong with my setup?
> Do i need another jar besides the mysql jdbc connector? For postgreSQL
> there are two jars and the same holds for Oracle. But i could not
> figure out, if mysql also has two jars?
>

No, you don't need another jar. Hibernate Spatial translates  
internally MySQL's binary geometry representation into JTS  
geometries. (In the case of Postgresql, it uses for that the  
postgis.jar JDBC extension library.)

> And the most interesting question: Why does this not run in my  
> JBoss AS ?

Do you get the same error in JBoss AS as when running the tutorial  
(the mapping error)?

I don't have JBoss installed here, but I could try running your code  
in Tomcat under the Eclipse debugger to see if there are any  
application/configuration problems. Would it be possible to create a  
small web app with your start up code, and a couple of business  
classes and your config files?

Regards,

Karel


> Ciao
> Carsten
> _______________________________________________
> 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
Carsten Höhne-3

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hi,
JBoss AS with postgreSQL does work. It was just a deployment problem
which i corrected directly inside JBoss AS. JBoss has used
MySQLSpatialDialect instead of postgis:-(
Now it runs fine, even when deployed from Eclipse.


>
>  What versions of MySQL and JDBC driver do you use?
>
I have MySQL 5.0.51 and tried both of mysql-connector-java-5.1.5 and
mysql-connector-java-5.0.8

>
> Do you get the same error in JBoss AS as when running the tutorial
>  (the mapping error)?

Yes, when using mysql as database. With postgres all runs fine now.

>  I don't have JBoss installed here, but I could try running your code
>  in Tomcat under the Eclipse debugger to see if there are any
>  application/configuration problems. Would it be possible to create a
>  small web app with your start up code, and a couple of business
>  classes and your config files?

My example uses the seam libs. I will see if i can get this small app
(without seam) ready over the weekend.
Ciao,
Carsten
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Carsten Höhne-3

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hello,
after enabling debug logging on the tutorial example with mysql i get this stacktrace:
    [java] 09:52:04,671 DEBUG org.hibernate.cfg.Configuration: processing association property references
     [java] 09:52:04,718 DEBUG org.hibernate.cfg.Configuration: processing foreign key constraints
     [java] 09:52:04,718 DEBUG org.hibernate.cfg.Configuration: processing extends queue
     [java] 09:52:04,718 DEBUG org.hibernate.cfg.Configuration: processing collection mappings
     [java] 09:52:04,718 DEBUG org.hibernate.cfg.Configuration: processing native query and ResultSetMapping mappings
     [java] Initial SessionFactory creation failed.org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003
     [java] 09:52:04,718 DEBUG org.hibernate.cfg.Configuration: processing association property references
     [java] Exception in thread "main" java.lang.ExceptionInInitializerError
     [java] 09:52:04,718 DEBUG org.hibernate.cfg.Configuration: processing foreign key constraints
     [java] at util.HibernateUtil.<clinit>(Unknown Source)
     [java] at events.EventManager.createAndStoreEvent(Unknown Source)
     [java] at events.EventManager.main(Unknown Source)
     [java] Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: 2003
     [java] at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
     [java] at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
     [java] at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:291)
     [java] at org.hibernate.mapping.Column.getSqlType(Column.java:182)
     [java] at org.hibernate.mapping.Table.sqlCreateString(Table.java:394)
     [java] at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:848)
     [java] at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:74)
     [java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
     [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
     [java] ... 3 more
     [java] Java Result: 1

The error is the same. Standalone or JBoss app.
I have MySQL 5.0.51 and tried both of mysql-connector-java-5.1.5 and
mysql-connector-java-5.0.8

And with PostgreSQL it is working in both cases. At first i had a ^M control charackter in my persistence.xml after the definition of the dialect. So the dialect was not recognised and the fall back holds. This was the mysqlspatial dialect:-( After removing the ^M character the app runs.
Ciao,
Carsten

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

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hi Carsten,


On 15 Feb 2008, at 10:02, Carsten Höhne wrote:

>
>
> The error is the same. Standalone or JBoss app.
> I have MySQL 5.0.51 and tried both of mysql-connector-java-5.1.5 and
> mysql-connector-java-5.0.8
>

I use versions very close to this (server v5.0.38 and connector  
v5.0.5). So this is highly unlikely to cause the problem.

I'll run the tutorial on MySQL server on my side to see if I get the  
same type of problem.

Regards,

Karel Maesen

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

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink


Hello,

 

I'll run the tutorial on MySQL server on my side to see if I get the
same type of problem.

Many thanks, Karel

Perhaps it is a configuration problem with the libs (wrong version or so)
Do you have an upload server where i can put my comlete app (the one from the tutorial)?
Ciao,
Carsten

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

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Could just zip it, and mail it to me personally?

Karel
On 16 Feb 2008, at 10:25, Carsten Höhne wrote:

>
>
> Hello,
>
>
>
> I'll run the tutorial on MySQL server on my side to see if I get the
> same type of problem.
>
> Many thanks, Karel
>
> Perhaps it is a configuration problem with the libs (wrong version  
> or so)
> Do you have an upload server where i can put my comlete app (the  
> one from the tutorial)?
> Ciao,
> Carsten
> _______________________________________________
> 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
Karel Maesen

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Hi Carsten,


I identified the problems.

The problem occurs when hibernate tries to generate the DDL script to  
create the EVENTS table. In the case of postgis, everything works as  
expected but for MySQL (and Oracle), hibernate does not locate a  
correct SQL type for the GeometryUserType.

You can get the tutorial working by changing the location property  
definition in;

                <property name="location"
                        type="org.hibernatespatial.GeometryUserType" >
                <column name="LOC"
                        sql-type="GEOMETRY"/>
                </property>

Btw, further down the tutorial there is a problem in the code for the  
find-method. Replace the line:

testCriteria.add(SpatialRestrictions.within("location", filter,  
filter));

with:

testCriteria.add(SpatialRestrictions.within("location", null, filter);


Both problems, have caused problems of other users as well. I will  
try to resolve these for a next release of Hibernate Spatial.

Regards,

Karel Maesen




On 16 Feb 2008, at 11:44, Karel Maesen wrote:

> Could just zip it, and mail it to me personally?
>
> Karel
> On 16 Feb 2008, at 10:25, Carsten Höhne wrote:
>
>>
>>
>> Hello,
>>
>>
>>
>> I'll run the tutorial on MySQL server on my side to see if I get the
>> same type of problem.
>>
>> Many thanks, Karel
>>
>> Perhaps it is a configuration problem with the libs (wrong version
>> or so)
>> Do you have an upload server where i can put my comlete app (the
>> one from the tutorial)?
>> Ciao,
>> Carsten
>> _______________________________________________
>> 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
Carsten Höhne-3

Re: No Dialect mapping for JDBC type: 2003

Reply Threaded More More options
Print post
Permalink
Thanks,
it works now. Here comes the location definition with Anotations:

@Column(name="LOC",columnDefinition="GEOMETRY")
@Type(type="org.hibernatespatial.GeometryUserType")
public Point getLocation(){
return this.location;
}

BTW My app is running on JBoss AS 4.2.2GA with Seam2.0.1GA and Richfaces3.1.4.



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