facebook

Problem with generated Hibernate mapping file

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

    azorba
    Member

    The error (A) is when “Create Hibernate Mapping” for selected tables on the DbBrowser. Connection URL is jdbc:jtds:sqlserver://localhost:1433/libraryweb. “Default Catalog” is shown on the browser tree but it physically never exists.

    — Default Catalog
    —– System Table
    —– Table
    ——- Book
    ——- Customer
    —– View

    The schema:

    create table “libraryweb”.”dbo”.”book”(
    “id” int identity(10) PRIMARY KEY,
    “title” nvarchar(30),
    “author” nvarchar(30),
    “customer_fk” int(10),
    “borrowallowed” bit default ‘(1)’)

    create table “libraryweb”.”dbo”.”customer”(
    “id” int identity(10) PRIMARY KEY,
    “firstname” nvarchar(30),
    “lastname” nvarchar(30),
    “age” int(10))

    Also, when opening up hibernate.reveng.xml created by mapping, there is an error (B). The file is empty

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <!DOCTYPE hibernate-reverse-engineering PUBLIC “-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN” “http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd&#8221; >

    <hibernate-reverse-engineering>
    </hibernate-reverse-engineering>

    ————————————————————————————–

    (A)
    Error 2006-03-11 09:18:17.140 An internal error occurred during: “Generating Artifacts”.
    org.hibernate.exception.JDBCConnectionException: Could not get list of tables from database. Probably a JDBC driver problem.
    Configured schema:null
    Configured catalog:Default Catalog
    Available schemas:
    dbo
    guest
    Available catalogs:
    libraryweb
    master
    pubs
    tempdb
    test

    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:72)
    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: Could not locate entry in sysdatabases for database ‘Default Catalog’. No entry found with that name. Make sure that the name is entered correctly.
    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418)
    at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:696)
    at net.sourceforge.jtds.jdbc.JtdsDatabaseMetaData.getTables(JtdsDatabaseMetaData.java:1823)
    at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
    … 11 more

    ——————————————————————————————–
    (B)
    Error 2006-03-11 09:49:57.437 An internal error occurred during: “loading file:/c:/sw/eclipse/plugins/org.hibernate.eclipse.mapper_3.1.0.beta3/dtds/hibernate-reverse-engineering-3.0.dtd”.
    java.lang.NoClassDefFoundError
    at org.eclipse.wst.dtd.core.internal.contentmodel.CMDocumentFactoryDTD.createCMDocument(CMDocumentFactoryDTD.java:37)
    at org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager.createCMDocument(ContentModelManager.java:56)
    at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentManagerImpl.buildCMDocument(CMDocumentManagerImpl.java:259)
    at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentManagerImpl$1.run(CMDocumentManagerImpl.java:229)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

    #248356 Reply

    Brian Fernandes
    Moderator

    azorba,

    Edit the connection profile you use to connect to your database and on page 2 of the profile wizard, choose either “Display all shema” or “Display selected schema” – do not choose option 2 (Display default schema). Reconnect to the database and see if that fixes the issues for you.

    About the reverse engineering editor problem, it looks like a configuration issue – have you installed Hibernate Tools or some other plugin alongside MyEclipse? This is not a workable installation for versions of MyEclipse prior to 4.1.1.

    ME v 4.1.1 has increased compatability with Hibernate Tools and quite a few bug fixes, I would reccommend downloading and installing that for a better experience.

    If you still have issues, please include answers to these questions: Posting Guidelines in your reply.

    Best,
    Brian.

    #248488 Reply

    azorba
    Member

    Actually, option 3 (Display selected schema) is the one thats inserts “Default Catalog” that causes Created Mapping to fails. Mapping works fine with the other two options

    I did install Hibernate 3.0.1 beta3 in the attempt to resolve the mapping error. Now there is no error after I disable it. Thanks.

Viewing 3 posts - 16 through 18 (of 18 total)
Reply To: Problem with generated Hibernate mapping file

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