Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
nickysandhu
Post subject: JPA Generate Entities and DAO problem  PostPosted: Jun 26, 2008 - 12:31 AM
Registered Member
Registered Member


Joined: Apr 05, 2006
Posts: 9

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)
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject: RE: JPA Generate Entities and DAO problem  PostPosted: Jun 26, 2008 - 02:46 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 8013

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?

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
nickysandhu
Post subject: RE: JPA Generate Entities and DAO problem  PostPosted: Jun 26, 2008 - 08:47 PM
Registered Member
Registered Member


Joined: Apr 05, 2006
Posts: 9

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)
 
 View user's profile Send private message  
Reply with quote Back to top
jnorris
Post subject: Error generating artifacts  PostPosted: Jun 30, 2008 - 07:02 PM
Registered Member
Registered Member


Joined: May 19, 2004
Posts: 16

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)
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
shpa
Post subject: RE: Error generating artifacts  PostPosted: Jun 30, 2008 - 10:12 PM
Registered Member
Registered Member


Joined: Jun 30, 2008
Posts: 1

I also have the exact same issue but with using toplilnk
 
 View user's profile Send private message  
Reply with quote Back to top
arch_clarkdm2
Post subject: RE: Error generating artifacts  PostPosted: Jul 01, 2008 - 12:32 PM
Veteran Member
Veteran Member


Joined: Oct 04, 2003
Posts: 4

I actually encounter this problem with any project that I add JPA, then run the entity and DOA generator. MyEclipse version is 6.5.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
kim.hanken
Post subject: New Enterprise Application  PostPosted: Jul 01, 2008 - 06:59 PM



Joined: Jul 01, 2008
Posts: 1

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).
 
 View user's profile Send private message  
Reply with quote Back to top
Support-Brian
Post subject: RE: New Enterprise Application  PostPosted: Jul 01, 2008 - 07:49 PM
Moderator
Moderator


Joined: Aug 21, 2004
Posts: 2281

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.

_________________
Brian
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
ethutch
Post subject:   PostPosted: Jul 03, 2008 - 04:05 PM
Registered Member
Registered Member


Joined: Jul 03, 2008
Posts: 32

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
 
 View user's profile Send private message  
Reply with quote Back to top
ethutch
Post subject:   PostPosted: Jul 06, 2008 - 09:36 PM
Registered Member
Registered Member


Joined: Jul 03, 2008
Posts: 32

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!!!!
 
 View user's profile Send private message  
Reply with quote Back to top
Support-Brian
Post subject:   PostPosted: Jul 07, 2008 - 12:48 AM
Moderator
Moderator


Joined: Aug 21, 2004
Posts: 2281

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: http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&p=94306#94306

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

_________________
Brian
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
wr1187
Post subject:   PostPosted: Jul 11, 2008 - 03:38 PM



Joined: Jul 11, 2008
Posts: 1

I have the same problem (JPA/Toplink/Oracle DB) and just wanted to see if a solution or workaround is available yet. Thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
Support-Brian
Post subject:   PostPosted: Jul 15, 2008 - 07:55 PM
Moderator
Moderator


Joined: Aug 21, 2004
Posts: 2281

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.

_________________
Brian
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
unmeshdev
Post subject:   PostPosted: Jan 09, 2010 - 09:37 PM
Registered Member
Registered Member


Joined: Mar 16, 2008
Posts: 7

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 -
Quote:
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
 
 View user's profile Send private message  
Reply with quote Back to top
cldavisjr
Post subject:   PostPosted: Mar 04, 2010 - 02:57 PM
Registered Member
Registered Member


Joined: Feb 08, 2010
Posts: 7

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 -
Quote:
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.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits