-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: MappingException: No Dialect mapping for JDBC type: -2
PostPosted: Mon Dec 19, 2005 10:09 pm 
Beginner
Beginner

Joined: Tue Nov 15, 2005 6:56 pm
Posts: 39
Using Hibernate3.1, and latest HIbernatetools3.1_beta2.
Using Oracle 10g.

I'm having problems starting a JBOSS service (I think it uses MBeans etc) that uses my pojo classes and mapping files somehow. I'm trying to transition the code from Hibernate3.0 to 3.1 version. It used to work before, but now I'm getting the following error. SO, this error happens when I try to start up my JBOSS server. I believe it's related to a custom id in one of my mapping files:

Code:
Problem starting service mycompany.com:service=LogHibernate
org.hibernate.HibernateException: org.hibernate.MappingException: No Dialect mapping for JDBC type: -2
   at com.mycompany.util.common.jmx.mycompanyHibernateService.start(mycompanyHibernateService.java:135)
   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:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:914)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:418)
   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:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
   at $Proxy4.start(Unknown Source)
   at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
   at sun.reflect.GeneratedMethodAccessor45.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:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
   at $Proxy8.deploy(Unknown Source)
   at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
   at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
   at sun.reflect.GeneratedMethodAccessor4.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:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:418)
   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:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
   at $Proxy4.start(Unknown Source)
   at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
   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:141)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
   at $Proxy5.deploy(Unknown Source)
   at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
   at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
   at org.jboss.Main.boot(Main.java:195)
   at org.jboss.Main$1.run(Main.java:463)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: -2
   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:216)
   at org.hibernate.mapping.Column.getSqlType(Column.java:181)
   at org.hibernate.mapping.Table.sqlTemporaryTableCreateString(Table.java:302)
   at org.hibernate.mapping.PersistentClass.prepareTemporaryTables(PersistentClass.java:636)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1167)
   at com.mycompany.util.common.jmx.mycompanyHibernateService.internalBuildSessionFactory(mycompanyHibernateService.java:102)
   at com.mycompany.util.common.jmx.SessionFactoryStub.getImpl(SessionFactoryStub.java:79)
   at com.mycompany.util.common.jmx.SessionFactoryStub.getStatistics(SessionFactoryStub.java:177)
   at org.hibernate.jmx.StatisticsService.setSessionFactory(StatisticsService.java:108)
   at org.hibernate.jmx.StatisticsService.setSessionFactoryJNDIName(StatisticsService.java:78)
   at com.mycompany.util.common.jmx.mycompanyHibernateService.start(mycompanyHibernateService.java:130)
   ... 91 more


I think it's related to this id in one of my mapping files:

Code:
       <id name="evtLogId" type="com.mycompany.util.common.type.GuidType">
         <generator class="com.mycompany.util.common.id.GuidIdentifierGenerator"/>
      </id>


I know it's the problem since if I change it to just a simple id like Long it seems to get further in the build process.

I did have this info message earlier in the stack trace, but I'm not sure if it's related(but it did get further and past this INFO message):

Code:
Could not build SessionFactory using the MBean classpath - will try again using client classpath: No Dialect mapping for JDBC type: -2


I've been looking at this for quite awhile now and really would appreciate some help. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 10:22 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
JDBC type -2 is BINARY (see java.sql.Types), and Oracle doesn't support that. Go through your mapping files looking for type binary, and change them to blob, or, if feasible, varchar (which is much easier to manage).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 3:15 pm 
Beginner
Beginner

Joined: Tue Nov 15, 2005 6:56 pm
Posts: 39
Thanks for the help. However, I'm still a little skeptical for the following reasons:

1) I used HibernateTools3.1Beta2 to generate my code and it didn't complain about the binary types during that process. It's complaining during my JBOSS startup, when trying to start a service.
2) The binary types worked before I attempted to upgrade to Hibernate3.1.
3) This particular error is apparently occurring when it encounters the custom identifier type I mentioned in my post. As I said, if I change that to a simple Long, it gets further in my startup process.

I'll still look into your suggestion, but I'm a little sceptical. I appreciate your help. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.