facebook

Cannot reverse engineer to hibernate with MySQL

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

    davidsos
    Member

    I cannot reverse engineer to hibernate using MySQL with MyEclipse 6.5 but used to be able to with 6.01. I updated to the latest JDBC driver and get the same results. I rebuilt a new Workspace still no success. Any ideas? Any useful help would be appreciated.

    Using the below
    Hibernate 3.2
    MySQL JDBC 5.1.6

    Here’s what’s in the logfile.

    !ENTRY org.eclipse.core.jobs 4 2 2008-06-24 21:01:58.473
    !MESSAGE An internal error occurred during: “Generating Artifacts”.
    !STACK 0
    org.hibernate.exception.GenericJDBCException: Could not get list of suggested identity strategies from database. Probably a JDBC driver problem.
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
    at org.hibernate.cfg.reveng.dialect.MySQLMetaDataDialect.getSuggestedPrimaryKeyStrategyName(MySQLMetaDataDialect.java:54)
    at org.hibernate.cfg.reveng.JDBCReader.processPrimaryKey(JDBCReader.java:429)
    at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:86)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:104)
    at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:89)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:137)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$7.execute(GenerateArtifactsJob.java:877)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:91)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:858)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:405)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
    Caused by: java.sql.SQLException: No database selected
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
    at org.hibernate.cfg.reveng.dialect.MySQLMetaDataDialect.getSuggestedPrimaryKeyStrategyName(MySQLMetaDataDialect.java:29)
    … 11 more

    #286212 Reply

    Loyal Water
    Member

    Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.

    Could you switch to a new workspace, setup you database again and check if the rev engg works? Let me know if you face the same issue with the new workspace as well.

    #286242 Reply

    davidsos
    Member

    @support-nipun wrote:

    Can you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.

    Could you switch to a new workspace, setup you database again and check if the rev engg works? Let me know if you face the same issue with the new workspace as well.

    I’ve already tried a new workspace, same results.

    Installation Details below
    ====================
    *** Date:
    Wednesday, June 25, 2008 2:46:57 PM EDT

    ** System properties:
    OS=WindowsVista
    OS version=6.0
    Java version=1.5.0_14

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 6.5.0 GA
    Build id: 6.5.0-GA-20080609

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 6.5.0 GA
    Build id: 6.5.0-GA-20080609

    Eclipse Platform

    Version: 3.3.3.r33x_r20080129-_19UEl7Ezk_gXF1kouft
    Build id: M20080221-1800

    Eclipse RCP

    Version: 3.3.3.r33x_r20080129-8y8eE9UEUWI6qujeED0xT7bc
    Build id: M20080221-1800

    Eclipse Java Development Tools

    Version: 3.3.2.r33x_r20080129-7o7jE7_EDhYDiyVEnjb1pFd7ZGD7
    Build id: M20080221-1800

    Eclipse Plug-in Development Environment

    Version: 3.3.3.r33x_r20080129-7N7M5DQVIA_6oJsEFkEL
    Build id: M20080221-1800

    Eclipse Project SDK

    Version: 3.3.3.r33x_r20080129-7M7J7LB-u3aphGW6o3_VmiVfGXWO
    Build id: M20080221-1800

    Eclipse Graphical Editing Framework

    Version: 3.3.2.v20080129
    Build id: 20080221-1602

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\MyEclipse 6.5\eclipse\eclipse.exe
    -name
    Eclipse
    –launcher.library
    C:\Program Files\MyEclipse 6.5\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.3.R33x_v20080118\eclipse_1023.dll
    -startup
    C:\Program Files\MyEclipse 6.5\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
    -exitdata
    1198_9c
    -clean
    -vm
    C:\Program Files\MyEclipse 6.5\jre\bin\javaw.exe

    #286282 Reply

    davidsos
    Member

    In order to get moving, I installed onto Fedora 8 Linux, on another PC and experienced the same problem using MyEclipse 6.5 as I did on Vista. Is there a problem using MyEclipse 6.5 with MySQL? I even have the same problem using JPA/Hibernate Reverse Engineering. I’m starting to worry.

    #286393 Reply

    Riyad Kalla
    Member

    davidsos,
    Can you reverse-engineer any kind of table? Even just a simple, single-varchar table?

    Can you post the DDL for the table that is having problems?

    #286432 Reply

    jeffmc033
    Member

    I am having the exact same problem.
    I have the 6.5.0 Milestone 1 release on my vista and when I use that version it does work; so this looks very much like a MyEclipse 6.5.0 GA issue.

    I posted this same issue a few minutes ago and I’m sorry for the double post. (I didn’t see this thread.)

    #286440 Reply

    davidsos
    Member

    @support-rkalla wrote:

    davidsos,
    Can you reverse-engineer any kind of table? Even just a simple, single-varchar table?

    Can you post the DDL for the table that is having problems?

    I am having this problem with any and all tables. Even a simple table with two columns of type VARCHAR. No table can be reverse engineered with MySQL. It works with Derby. I have the exact same problem with Vista or Fedora 8 Linux. With old or brand new workspaces. If you look at the error log it contains the below message, yet the Data Explorer works perfectly. It would be nice if one support person sees this through rather than new people starting over and not reading the full information that has been provided. I’m kind of feeling frustrated.

    Caused by: java.sql.SQLException: No database selected

    Please read all the information previously provided carefully. HELP please.

    #286451 Reply

    2neig
    Member

    I have the same problem. And found a workaround for it. Do you need to have access to different catalogs? If not just modify your database connection to just one. And normally you will not have any problem anymore.
    If you need access to different catalogs do the same but don’t let him change your hibernate.cfg.xml file.

    I hope this will work for you.

    Greets

    2neig

    #286455 Reply

    davidsos
    Member

    @2neig wrote:

    I have the same problem. And found a workaround for it. Do you need to have access to different catalogs? If not just modify your database connection to just one. And normally you will not have any problem anymore.
    If you need access to different catalogs do the same but don’t let him change your hibernate.cfg.xml file.

    I hope this will work for you.

    Greets

    2neig

    Thanks, it’s a workaround. Unfortunately one needs to have define a connection for each catalog. I hope they fix this properly and soon. I’ll have to see if this holds up for Spring/JPA/Hibernate projects.

    #286584 Reply

    Brian Fernandes
    Moderator

    David, 2neig,

    We were able to reproduce this internally. In 6.5GA (post M1) the hibernate tooling was changed to allow autodetection of the identifier strategy and that code has obviously not been as robust as it should have.

    The work around is to modify the connection string used by the MyEclipse Driver to include the catalog. Use “jdbc:mysql://localhost:3306/test” instead of “jdbc:mysql://localhost:3306” where “test” is the catalog name. You do not need to change the connection string in your hibernate.cfg.xml file (or persistence.xml file for JPA) and this value will not be overwritten during reverse engineering.

    Note that even though you explicitly specify the catalog in the connection, you will still see other catalog in your database in the DB Browser and can reverse engineer tables from them as well, without the need to create a separate MyEclipse Driver per catalog. As the same engine is used for JPA / EJB3 reverse engineering as well, this will address similar JPA reverse engineering problems as well.

    Sorry for the inconvenience caused, this issue has been sent to the persistence team for resolution.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Cannot reverse engineer to hibernate with MySQL

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