-->
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.  [ 13 posts ] 
Author Message
 Post subject: HibernateTools: No Dialect mapping for JDBC type: -2
PostPosted: Fri Jan 27, 2006 1:11 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
I am trying to set up the eclipse plugin for the hibernate tools. I already have my POJOs and mapping files. I want to use this to test my HQL's.
Hibernate version:3.1.0



Hibernate.cfg.xml -- Content:


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
    <session-factory name="java:/hibernate/SessionFactory">
    <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
    <property name="hibernate.connection.url">jdbc:postgresql://localhost:5435/cmtestdb</property>
    <property name="hibernate.connection.username">test</property>
    <property name="hibernate.default_schema">cmtestdb</property>
    <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    </session-factory>
    </hibernate-configuration>


The console configuration has all the mapping files, the path to the POJOS and postgres driver jar.

In Eclipse, when I try to right click on the configuration and say Create Session Factory, I get the following:

Code:
Problem while executing Create:
SessionFactory(org.hibernate.MappingException: No dialect mapping for JDBC type:-2)

Reason:
org.hibernate.MappingException: No Dialect mapping for JDBC type: -2



What am I doing wrong?

- Sanjeev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 2:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that you have some jdbc type that is not mapped in the sql dialect.
how does the hbm.xml file that fails look like ? and what is the full exception ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 2:53 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
I have 64 mapping files and I am not able to identify which mapping file is causing this error. Where can I see the logs - the only exception trace I have is what I have posted. That is on a pop-up error mesg in eclipse. The object model that I have has lots of relationship so I cannot add individual hbm and start the elimination process. If I can find the actual mapping file that would be great; an exception log or somewhere else?
- Sanjeev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:03 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
I got it working - I think it had to do with the order of the mapping files that I add - I added one by one - chasing the relations - now it created the SessionFactor - does this explain?
Thanks for your help.
- Sanjeev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
not really ')

for future reference you can see the stacktrace in the error log view.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:21 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
Now when I try to excecute the HQL - I get this:
org.hibernate.exception.GenericJDBCException: could not execute query.

I am not sure what is the cause for this. Also I have three nodes on the Hibernate Configuration:
1. Configuration - lists all my POJOs by name
2. Session factory - lists all the pojo packages
3. Database - which is empty

Let me know why the query is not executing.

- Sanjeev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look in the error log

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:38 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
All I have is the exception - what is the log - how can I view it.
- Sanjeev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
go to Window, Show View, Other.., PDE Runtime, Error Log

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:53 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
This is what I see in the error log:

Code:
java.sql.SQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240)
   at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
   at org.hibernate.loader.Loader.getResultSet(Loader.java:1677)
   at org.hibernate.loader.Loader.doQuery(Loader.java:662)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
   at org.hibernate.loader.Loader.doList(Loader.java:2158)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2037)
   at org.hibernate.loader.Loader.list(Loader.java:2032)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:33)
   at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:80)
   at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:848)
   at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1086)
   at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:790)
   at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:905)
   at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:798)
   at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:748)
   at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:737)
   at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1264)
   at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201)
   at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1262)
   at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1221)
   at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:698)
   at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
   at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1417)
   at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:174)
   at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153)
   at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111)
   at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:88)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:62)
   at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source)
   at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
   at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:60)
   at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:306)
   at org.hibernate.console.ConsoleConfiguration.access$5(ConsoleConfiguration.java:302)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:295)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
   at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287)
   at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282)
   at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133)
   at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77)
   at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720)
   at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
   at org.eclipse.core.runtime.Platform.run(Platform.java:783)
   at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
   at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
   at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718)
   at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950)
   at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057)
   at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219)
   at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216)
   at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
   at org.eclipse.core.launcher.Main.run(Main.java:973)
   at org.eclipse.core.launcher.Main.main(Main.java:948)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 3:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...what is in your cfg.xml and hibernate.properties?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 4:28 pm 
Newbie

Joined: Tue Sep 06, 2005 5:04 pm
Posts: 15
I do not have hibernate.properties and I have the cfg.xml in my first message in this thread. Let me know what I am missing.
Thanks again for helping out.
- Sanjeev


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 4:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...i don't understand why postgress complain about no tx in progress.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 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.