facebook

HQL SessionFactory errror org.Hibernate.type.StringType

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #286051 Reply

    cpalm72
    Member

    I’ve been trying to setup an HQL editor against a cleanly generated hibernate reverse engineered schema. I have been successful in the past before with other projects, but
    I’ve tried this against several databases across different MyEclipse versions, including the 6.5 M1 release, and got the same results. The error occurs when I open the HQL editor,Unable To create SessionFactory, Reason org.Hibernate.type.StringType

    Any ideas what could be causing this?

    Thanks,
    Chris

    The error I get in the MyEclipse log is below

    MYECLIPSE LOG
    !SUBENTRY 2 com.genuitec.org.hibernate.eclipse.console 4 150 2008-06-20 12:17:21.282
    !MESSAGE java.lang.ClassCastException: org.hibernate.type.StringType
    !STACK 0
    java.lang.ClassCastException: org.hibernate.type.StringType
    at org.hibernate.tuple.PropertyFactory.buildVersionProperty(PropertyFactory.java:84)
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:160)
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
    at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
    at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
    at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:287)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:89)
    at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:282)
    at com.genuitec.eclipse.hibernate.wizards.MEConsoleConfiguration.buildSessionFactory(MEConsoleConfiguration.java:211)
    at com.genuitec.eclipse.hibernate.action.MERefreshCCAction.buildSessionFactory(MERefreshCCAction.java:121)
    at com.genuitec.eclipse.hibernate.action.MEExecuteHQLAction.run(MEExecuteHQLAction.java:65)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
    at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
    at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    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.equinox.launcher.Main.invokeFramework(Main.java:508)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

    MyHibernateData is as follows:
    #
    #Fri Jun 20 12:16:34 CDT 2008
    genBasicCompId=true
    sessionFactoryName=com.viant.HibernateSessionFactory
    profile=
    daoSFId=
    version=3.1
    jndiPath=
    detectM2M=true
    reStrategyClass=
    springDaoFile=
    useJavaTypes=true
    keyGenerator=native
    libInstallFolder=lib
    addLibs2Project=true
    genVersionTag=true
    sessionFactoryId=
    basePersistenceClass=
    reSettingsFile=
    configFile=/mysql-query/src/hibernate.cfg.xml
    createConfigFile=true
    addLibs2Classpath=true
    baseDaoClass=BaseHibernateDAO

    Installationdetails
    *** Date:
    Friday, June 20, 2008 12:47:49 PM CDT

    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_11

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 6.0.1 GA
    Build id: 6.0.1-GA-200710

    Eclipse Platform

    Version: 3.3.1.R33x_r20070911-_19UEkpF-B7Uh2hKy75y
    Build id: M20070921-1145

    Eclipse RCP

    Version: 3.3.1.R33x_r20070802-8y8eE8sEV3Fz0z0GlHJrXvTAUS
    Build id: M20070921-1145

    Eclipse Java Development Tools

    Version: 3.3.1.r331_v20070629-7o7jE72EDlXAbqAcnbmyg1rf8RIL
    Build id: M20070921-1145

    Eclipse Plug-in Development Environment

    Version: 3.3.1.R33x_r20070802-7N7M3D1VIA_52JsDFsEC
    Build id: M20070921-1145

    Eclipse Project SDK

    Version: 3.3.1.R33x_r20070802-7M7J78_mu1mnlRa7A4Ns52XeZ6D0
    Build id: M20070921-1145

    Eclipse Graphical Editing Framework

    Version: 3.3.1.v20070814
    Build id: 20070814-1555

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\MyEclipse 6.0.1\eclipse\eclipse.exe
    -name
    Eclipse
    –launcher.library
    C:\Program Files\MyEclipse 6.0.1\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.1.R33x_v20070828\eclipse_1020.dll
    -startup
    C:\Program Files\MyEclipse 6.0.1\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
    -exitdata
    e30_70
    -vm
    C:\Program Files\MyEclipse 6.0.1\jre\bin\javaw.exe

    #286057 Reply

    Loyal Water
    Member

    Are you trying to run the HQL editor though a batch file?

    #286068 Reply

    cpalm72
    Member

    I’m trying to run the HQL editor by right clicking on the project, selecting Myeclipse, then open HQL Editor. The first time I do this I get that error. Subsequent HQL editors I open, the error doesn’t come up until I type in a statement and attempt to run it.

    @support-nipun wrote:

    Are you trying to run the HQL editor though a batch file?

    #286121 Reply

    Loyal Water
    Member

    Did you setup MyEclipse using the All in One installer? I would like you to switch to a new workspace (File > Switch Workspace > Temp), create a new hibernate project and try opening the HQL editor. Do you get the same error?

    #286191 Reply

    cpalm72
    Member

    @support-nipun wrote:

    Did you setup MyEclipse using the All in One installer? I would like you to switch to a new workspace (File > Switch Workspace > Temp), create a new hibernate project and try opening the HQL editor. Do you get the same error?

    Yes, I had used the all in one installer with the 6.5 release also, and setup a project in a new workspace. The trace information I posted in the original
    email was from one of my earlier attempts on the 6.0.GA release. This seems to consistently happen, at least with these sets ot tables.
    I can however, get this to work on the Apache Derby tables that come with the IDE.

    #286373 Reply

    Brian Fernandes
    Moderator

    cpalm,

    I would expect this sort of error to cause problems in your Hibernate application as well, but I assume that is working without a problem?
    I’m assuming this is a simple Hibernate project with Hibernate mapping files.

    Are you using <version> and / or <timestamp> elements in any of your mapping files, that is where the problem seems to be. Can you try removing them and see if the problem goes away?
    To help narrow down the issue, you could try creating a new test project with the smallest number of tables required to reproduce the issue. If you can send us the DDL for the tables involved or a snippet of mapping file where you are using the version mapping, we will take a look at it.

    Sorry for the inconvenience caused.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: HQL SessionFactory errror org.Hibernate.type.StringType

You must be logged in to post in the forum log in