facebook

DB2: hibernate mapping generation problem

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

    nclemeur
    Member

    Since upgrading MyEclipse (please see version details at the end of this email), I have some problem to generate hibernate mappings. I can connect to the database (DB2) with the database explorer, the wizard to generate the mappings seems to work fine, but as soon as I hit finish, I have this error:

    Error 2006-05-25 12:19:11.380 An internal error occurred during: "Generating Artifacts".
    java.lang.IllegalArgumentException: Path must include project and resource name: /
        at org.eclipse.core.internal.utils.Assert.isLegal(Assert.java:60)
        at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:1562)
        at org.eclipse.core.internal.resources.Container.getFile(Container.java:125)
        at com.genuitec.eclipse.hibernate.util.HibernateUtils.getConfigFile(HibernateUtils.java:311)
        at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfiguration(HTUtils.java:165)
        at com.genuitec.eclipse.hibernate.util.HTUtils.getConsoleConfiguration(HTUtils.java:154)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:198)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

    I am also including the content of .myhibernatedata file at then of this message.

    would anyone know a workaround?

    BTW, I have a seconde workspace where it is working fine altough I am using Oracle in that one.

    Cheers

    Nicolas

    == MyEclipse details

    *** Date: Thu May 25 12:20:48 EST 2006

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

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.1.1 GA
    Build id: 20060228-4.1.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Platform

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse RCP

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Java Development Tools

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Plug-in Development Environment

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse Project SDK

    Version: 3.1.2
    Build id: M20060118-1600

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse-3.1.2\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    dbc_64
    -vm
    C:\Sun\jdk1.5.0\bin\javaw.exe

    .myhibernatdata file

    
    #
    #Thu May 25 12:19:11 EST 2006
    springDaoFile=
    genVersionTag=false
    daoSFId=
    configFile=
    sessionFactoryId=
    profile=
    libInstallFolder=
    addLibs2Classpath=false
    jndiPath=
    genBasicCompId=false
    addLibs2Project=false
    keyGenerator=assigned
    createConfigFile=false
    basePersistenceClass=
    version=3.0
    useJavaTypes=true
    reSettingsFile=/hcpdWeb/hibernate.reveng.xml
    
    #252530 Reply

    Brian Fernandes
    Moderator

    Hi,

    Thanks for all the detail up front.

    It looks like your hibernate config file hasn’t been set. I don’t know how this could have come about, but to fix it, do the following:
    Bring up your project properties (right click on the project and choose Properties) then go to the MyEclipse-Hibernate page. Use the browse button to reselect your hibernate config file and click OK. RE should work fine now.

    If you continue to experience a problem, do let us know.

    Best,
    Brian.

    #252586 Reply

    nclemeur
    Member

    Thanks a lot, this solved my problem. I still had a little problem because in the hibernate-config file I am using my own db2dialect and the RE engine could not find the class (the class is present in that project) for that dialect. But reverting to a defaut Db2 dialect cured the problem.

    Thank you very much for the quick response, it really helped.

    PS: are there any plan to have a way to define a custom strategy class for the RE engine like it is possible in the original tools from the hibernate team?

    #252596 Reply

    Brian Fernandes
    Moderator

    I still had a little problem because in the hibernate-config file I am using my own db2dialect and the RE engine could not find the class (the class is present in that project) for that dialect. But reverting to a defaut Db2 dialect cured the problem.

    We will investigate supporting this case in the furture. So you have the source for your custon dialect in your project’s source folder? If you still need to get this going, a quick and dirty solution is to export your dialect to a JAR file and add that JAR file to the list of driver JARs that you are using to Reverse engineer. Now that we have someone who wants this, we will look at supporting this out of the box later 🙂

    PS: are there any plan to have a way to define a custom strategy class for the RE engine like it is possible in the original tools from the hibernate team?

    Yes, it’s on the cards for sure. It might make the 5.0 GA release, but management has not committed that feature to a time line. Thanks for asking, it helps somewhat while prioritizing 🙂

    Best,
    Brian.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: DB2: hibernate mapping generation problem

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