facebook

JPA Generate Entities and DAO problem

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

    nickysandhu
    Member

    I created a new project and added JPA/Hibernate capabilities. I also added spring capabilities

    MyEclipse version is 6.5

    On right click My Eclipse | Generate Entities & DAOs

    I get this error
    An internal error occured during “Generate Artifacts”
    Hibernate dialect must be explicitly set

    Here are associated error log traces

    eclipse.buildId=M20060921-0945
    org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
    at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
    at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
    at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:72)
    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)

    #286295 Reply

    Loyal Water
    Member

    I was unable to reproduce this error following the steps that you mentioned. Can you switch to a new workspace (File > Switch Workspace > Temp), create a new web project, add jpa/hibernate capabilities to it. Add spring capabilities to it as well and now right click on the project and go to My Eclipse | Generate Entities & DAOs. Do you get the same error?

    #286343 Reply

    nickysandhu
    Member

    I started with a fresh workspace. Added a new Java project and used seperate src folders. Added jpa capabilities using the connection to database from database explorer. Added spring capabilities (version 2.5). Right click and My Eclipse | Generate Enities & DAOs and I get

    Session Data
    eclipse.buildId=M20080221-1800

    An internal error occurred during: “Generating Artifacts”.

    org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
    at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
    at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
    at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:72)
    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)

    #286507 Reply

    James Norris
    Member

    I have the same problem. I started a new project, added maven and spring support. Then added JPA support with Hibernate. Tried to generate artifacts and got the error that states the hibernate dialect needs to be explicitly added. I added the dialect property to persistence.xml and still get the error.

    !ENTRY org.eclipse.core.jobs 4 2 2008-06-30 11:31:31.984
    !MESSAGE An internal error occurred during: “Generating Artifacts”.
    !STACK 0
    org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
    at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
    at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
    at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
    at com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:72)
    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)

    #286534 Reply

    shpa
    Member

    I also have the exact same issue but with using toplilnk

    #286544 Reply

    David Clark
    Member

    I actually encounter this problem with any project that I add JPA, then run the entity and DOA generator. MyEclipse version is 6.5.

    #286582 Reply

    kim.hanken
    Member

    I just created a new Enterprise Applicaiton with new EJB and web modules. I added the jpa capabilities during the creation wizard. Then I try to create entities and facades. It looks like it finds all my tables in the schema. I select “Entity Bean Generation” and “Entity Facade”, “Generate precise findby methods” and “generate local interface” options. Looks like it trys to do something but eventually errors “Hiberanate dialect must be explicitly set. I’m using the new release of myeclipse (released yesterday 30 june 08).

    #286589 Reply

    Brian Fernandes
    Moderator

    Can you please respond with the following data so we can reproduce this internally?
    1) Database being used
    2) Database driver being used
    3) Connection string being used in the MyEclipse Driver URL? (not the connection string in your persistence.xml file, but the connection string in the MyEclipse Driver you use to connect to your database)

    Thanks.

    #286702 Reply

    ethutch
    Member

    I have the same problem JPA only, NO Hibernate configured. (so this is doubly weird)

    1) Database being used – Oracle 10G
    2) Database driver being used – ojdb14.jar
    3) Connection string being used in the MyEclipse Driver URL? – jdbc:oracle:thin:@disrac:1522/IFESMG

    I’m using MyEclipse 6.5 as well.

    Hope this helps

    #286773 Reply

    ethutch
    Member

    BTW, I don’t think the database is significant. I tried using MySQL and have mostly the same problem. I see why you may have trouble finding this, it seems VERY intermittent. Interestingly, I had a hard failure – like 15 times in a row, left the computer for a couple days and tried again and it worked several times in a row. But the piecemeal generation seemed to be causing errors of it’s own (not sure about that could be my data model too).

    Regardless, when I tried to generate all the tables at once I am back to the hard failure no matter what I try now. So this may be some sort of memory leak / garbage collection issue.

    Anyway, the database clearly does not matter as I got the same results with local MySQL and remote Oracle. It is highly intermittent and EXTREMELY annoying.

    PLEASE HELP!!!!

    #286775 Reply

    Brian Fernandes
    Moderator

    Thanks for the detail provided, we did manage to replicate the problem with Oracle-JPA.

    This problem should not occur with any other database. When you have the problem with MySQL, can you please check your error log to see if it is failing with the same stack trace? I would suggest clearing the log first.
    We have another MySQL problem what you may be running into, detailed here: https://www.genuitec.com/forums/topic/cannot-reverse-engineer-to-hibernate-with-mysql/#post-286584

    I apologize for the inconvenience caused, we will provide a workaround asap.

    #287011 Reply

    wr1187
    Member

    I have the same problem (JPA/Toplink/Oracle DB) and just wanted to see if a solution or workaround is available yet. Thanks.

    #287153 Reply

    Brian Fernandes
    Moderator

    MyEclipse 6.5.1 will be released this weekend and will address this issue.
    I apologize for the delayed notice to this thread, inconvenience sincerely regretted.

    #305220 Reply

    Hi,
    This information might help MyEclipse team or someone with a similar problem:

    MyEclipse JPA capability has a bug. It gives the following exception even when the dialect is explicitly set in the persistence.xml –

    javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set

    The error comes if something is incorrect in the persistence.xml file, not necessarily if the dialect is wrong or absent. For example, if your schema username/password is incorrect in persistence.xml, it will error out as incorrect dialect.

    This is just a problem of misleading error message. MyEclipse should fix it. Till then, make sure all your properties are correctly specified in persistence.xml file.

    I am using HIbernate 3.2, MySQL 5 with Eclipse 8.0.

    HTH,
    Unmesh

    #306542 Reply

    Carl Davis
    Member

    @unmeshdev wrote:

    Hi,
    This information might help MyEclipse team or someone with a similar problem:

    MyEclipse JPA capability has a bug. It gives the following exception even when the dialect is explicitly set in the persistence.xml –

    javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set

    The error comes if something is incorrect in the persistence.xml file, not necessarily if the dialect is wrong or absent. For example, if your schema username/password is incorrect in persistence.xml, it will error out as incorrect dialect.

    This is just a problem of misleading error message. MyEclipse should fix it. Till then, make sure all your properties are correctly specified in persistence.xml file.

    I am using HIbernate 3.2, MySQL 5 with Eclipse 8.0.

    HTH,
    Unmesh

    This is a bump as it seems to still be a problem and there has been response. If the response has been placed in another thread, please reply with the thread link so my team may benefit from it.
    I am trying to “forward engineer” my DB from JPA Annotation based code using Hibernate and Spring. This is being aided in MyEclipse from the JP View and JPA Details and the JPA config to autogenerate tables dynamically is set. No luck so far. I will look at the persistence.xml file as this post suggests.

    I’m hoping the moderator or MyEclipse Experts can weigh in on this. I have found only minor notes on forward engineering. I would love to be directed to a tutorial that puts its emphasis on it.
    Using MyEclipse 8.0 with MyEclipse for Spring updates.
    Thanks for your attention.

Viewing 15 posts - 1 through 15 (of 15 total)
Reply To: JPA Generate Entities and DAO problem

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