facebook

[Closed] Problem with Hibernate and MySql

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

    Joel Grignou
    Member

    Hi,

    After updating MyEclipse throught the Eclipse Update feature, I cannot use anymore the ‘Create Hibernate Mapping’ from the DB Explorer view as I get the following error:

    “An internal error ocurred during: ‘Generating Artifacts'”

    Here is my config:

    *** Date: Wed Mar 08 19:05:03 CET 2006
    
    *** System properties:
    OS=Linux
    OS version=2.6.13-custom
    Java version=1.5.0_04
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    
    Version: 4.1.1 GA
    Build id: 20060228-4.1.1-GA
    
    *** Eclipse details:
    Eclipse SDK
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Project SDK
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Platform
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Java Development Tools
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse RCP
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse Plug-in Development Environment
    
    Version: 3.1.0
    Build id: I20050627-1435
    
    Eclipse startup command=-os
    linux
    -ws
    gtk
    -arch
    x86
    -launcher
    /opt/eclipse/eclipse
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    3468015
    -vm
    /usr/bin/java

    and the log reports:

    !ENTRY org.eclipse.core.runtime 4 2 2006-03-08 18:30:09.651
    !MESSAGE An internal error occurred during: "Generating Artifacts".
    !STACK 0
    org.hibernate.exception.SQLGrammarException: Could not get list of tables from database. Probably a JDBC driver problem. 
    Configured schema:null
    Configured catalog:Default Catalog
    Available schemas:
    Available catalogs:
      information_schema
      iscriviti
      test
    
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
        at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:94)
        at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:395)
        at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:65)
        at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:102)
        at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:87)
        at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:129)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$5.execute(GenerateArtifactsJob.java:405)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
        at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:400)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:266)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
    Caused by: java.sql.SQLException: Access denied for user 'iscriviti'@'192.168.0.%' to database 'Default Catalog'
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
        at com.mysql.jdbc.Statement.executeQuery(Statement.java:822)
        at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4304)
        at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
        ... 11 more
    
    !ENTRY org.eclipse.core.runtime 4 2 2006-03-08 19:04:13.764
    !MESSAGE An internal error occurred during: "Generating Artifacts".
    !STACK 0
    org.hibernate.exception.SQLGrammarException: Could not get list of tables from database. Probably a JDBC driver problem. 
    Configured schema:null
    Configured catalog:Default Catalog
    Available schemas:
    Available catalogs:
      information_schema
      iscriviti
      test
    
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
        at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:94)
        at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:395)
        at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:65)
        at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:102)
        at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:87)
        at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:129)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$5.execute(GenerateArtifactsJob.java:405)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
        at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:400)
        at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:266)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
    Caused by: java.sql.SQLException: Access denied for user 'iscriviti'@'192.168.0.%' to database 'Default Catalog'
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2972)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
        at com.mysql.jdbc.Statement.executeQuery(Statement.java:822)
        at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4304)
        at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
        ... 11 more
    

    Thanks for your help,
    Joel

    #248076 Reply

    Haris Peco
    Member

    Joel,

    Can you try redefine connection profile.We change some connection features and your old profile is wrong
    (choose ‘selected all schemas’, too)
    If you have problems after this, please send us connection details (connection profile, driver details)

    Thanks

    #248087 Reply

    Joel Grignou
    Member

    Hi,

    Thanks very much for that quick answer. Recreating the connection profile fixed the issue and I’m now able to create mappings.

    Cheers,
    Joel

    #248245 Reply

    AndreAgosto
    Participant

    @ilbretone wrote:

    Hi,

    Thanks very much for that quick answer. Recreating the connection profile fixed the issue and I’m now able to create mappings.

    Cheers,
    Joel

    i have the same problem, but recreating the connection profile did’nt fix the issue.
    I tryed to reinstall myEclipse too, but it did’nt resolve too.

    thanks

    #248255 Reply

    Haris Peco
    Member

    Andre,

    Please, can you send your details (driver details, connections details, Error log).
    Please, check if you do upgrade realy (restart eclipse with -clean option or better, remove ECLIPSE_HOME/configuration/org.eclipse.* and reisntall MyEclipse)

    Thanks

    #248332 Reply

    AndreAgosto
    Participant

    Ok, thanks.

    driver JDBC ODBC Bridge
    jar: …jdk1.5.0_06\jre\lib\rt.jar
    Driver classname: sun.jdbc.odbc.JdbcOdbcDriver
    data origin from windows Xp: jdbc:odbc:Access

    Where can i find the error log? the button details is disabled in window error message

    Thanks a lot

    #248333 Reply

    Haris Peco
    Member

    Andre,

    Error Log view is Windows-Show View-Other-PDE runtime-Error log

    Best

    #248366 Reply

    AndreAgosto
    Participant

    hi, here is de log output after the hibernate error:

    !ENTRY org.eclipse.core.runtime 4 2 2006-03-11 23:58:08.406
    !MESSAGE An internal error occurred during: “Generating Artifacts”.
    !STACK 0
    org.hibernate.exception.GenericJDBCException: Error while reading primary key meta data for C:\Documents and Settings\Clara\Desktop\Periodici.Elementi
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getPrimaryKeys(JDBCMetaDataDialect.java:257)
    at org.hibernate.cfg.reveng.JDBCReader.processPrimaryKey(JDBCReader.java:281)
    at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:71)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration$1.readDatabaseSchema(MEJDBCMetaDataConfiguration.java:102)
    at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:87)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:129)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$5.execute(GenerateArtifactsJob.java:405)
    at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
    at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:400)
    at com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:266)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
    Caused by: java.sql.SQLException: [Microsoft][Driver Manager ODBC] Il driver non supporta questa funzione
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLPrimaryKeys(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getPrimaryKeys(Unknown Source)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getPrimaryKeys(JDBCMetaDataDialect.java:239)
    … 11 more

    thanks

    #248399 Reply

    Haris Peco
    Member

    Andre,

    I think that jdbc odbc driver doesn’t handle primary key correct or driver/database doesn’t support primary keys at all

    Best

    #248416 Reply

    AndreAgosto
    Participant

    ok, i imported the access database in MySql and hibernate worked fine whit that..

    Thanks a lot for your support and for your bear (patience) with my bad english..
    bye

    #262329 Reply

    Simon Cevc
    Member

    I’m having the exact same problem in the new version (5.1.0), but I can’t find the error log. Did it move somewhere else?

    Thanks for your help,
    Simon

    #262347 Reply

    Simon,

    I suppose that you have installed the ‘all-in-one’ distribution.
    Error Log View doesn’t exist in this distribution.
    Please try to use Help>About Eclipse SDK>Configuration Details>View Error Log.

    Regards

    #262366 Reply

    Simon Cevc
    Member

    Thank you for the answer. Found the error log.

    It seems I have a file access problem. My files are under CVS, so they are read-only in the local sandbox.

    Since this has no relevance to this topic, I opened a new topic.
    https://www.genuitec.com/forums/topic/closed-hibernate-reverse-engineering-when-using-cvs/

    Regards,
    Simon

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: [Closed] Problem with Hibernate and MySql

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