-
1. Re: Error using Eclipse Hibernate Tools for JPA after greati
maxandersen Nov 11, 2007 3:33 AM (in response to shivdeepk)what error shows up in the error log view ?
which version of seam and hibernate tools are you using ? -
2. Re: Error using Eclipse Hibernate Tools for JPA after greati
shivdeepk Nov 11, 2007 5:48 AM (in response to shivdeepk)This is my environment:
Environment:Seam 2.0.0.GA JBoss Tools 2.0.0.beta4 JBoss 4.2.1.GA Eclipse Platform Version: 3.3.0 Build id: M20070921-1145 Linux (Ubuntu Gutsy) Postgresql 8.2
Exception:org.hibernate.console.HibernateConsoleRuntimeException: Could not load JPA Configuration at org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:499) at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:484) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:203) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106) at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:38) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:89) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:95) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: org.hibernate.console.HibernateConsoleRuntimeException: Could not create JPA based Configuration at org.hibernate.console.ConsoleConfiguration.buildJPAConfiguration(ConsoleConfiguration.java:142) at org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:496) ... 10 more Caused by: org.hibernate.console.HibernateConsoleRuntimeException: Persistence unit not found: 'null'. at org.hibernate.console.ConsoleConfiguration.buildJPAConfiguration(ConsoleConfiguration.java:134) ... 11 more
hibernate-console.properties:#File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml hibernate.connection.password=test123 hibernate.connection.username=testuser hibernate.connection.driver_class=org.postgresql.Driver hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.connection.url=jdbc:postgresql:testdb hibernate.hbm2ddl.auto=update hibernate.connection.provider_class=org.hibernate.connection.DriverManagerConnectionProvider hibernate.datasource= hibernate.transaction.manager_lookup_class=
testapp.launch:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="testapp"/> <stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/> <listAttribute key="org.hibernate.eclipse.launch.FILE_MAPPINGS"/> <stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/testapp/hibernate-console.properties"/> </launchConfiguration>
I observed there is no persistence.xml and orm.xml in resources->META-INF. There are 3 other persistence-*.xml. However the build.xml creates one when building & deploying the application. I could get a normal "JPA Project" working in eclipse. -
3. Re: Error using Eclipse Hibernate Tools for JPA after greati
shivdeepk Nov 12, 2007 7:20 AM (in response to shivdeepk)Is this a bug? I am following the "top-down" approach with hibernate. I have my domain model and would like to forward-engineer the database schema. My understanding is that Hibernate Tools can take over right after the project is created using seam-gen.
-
4. Re: Error using Eclipse Hibernate Tools for JPA after greati
shivdeepk Nov 12, 2007 11:19 AM (in response to shivdeepk)I got this working eventually. I followed the "JPA Project" way and created a persistence.xml in src/META-INF. If I place persistence.xml in resources/META-INF along with the other persistence-*.xml files, it wouldnt work by default. I am disappointed in not being able to work with Hibernate Tools without any such hacks.
-
5. Re: Error using Eclipse Hibernate Tools for JPA after greati
maxandersen Nov 15, 2007 1:40 PM (in response to shivdeepk)you mean having a structure in a JPA compliant structure is a hack ? :)
we can implement that we parse a custom named persistence.xml and pass it as a PersistenceUnit to the entitymanager but we haven't done it yet ....care for supplying a patch ? :) -
6. Re: Error using Eclipse Hibernate Tools for JPA after greati
damianharvey Nov 16, 2007 4:28 AM (in response to shivdeepk)With a new Seam Gen project you have to run the 'buildtest' ant task that will create a persistence.xml in the 'test-build' directory. Hibernate tools will work from that.
Maybe this should be added to the Seam docs?
Cheers,
Damian. -
7. Re: Error using Eclipse Hibernate Tools for JPA after greati
shivdeepk Nov 18, 2007 12:02 PM (in response to shivdeepk)following the JPA structure is not a hack...but doing it to get it working with hibernate tools, after seam-gen finishes its work is :-).
if seam-gen can create persistence-xxx.xml files, its no big deal for it to create a persistence.xml with the project name as the PersistenceUnit name by default.
going about r&d work to solve these issues negates the productivity gain acheived using seam. tools are the core of today's development scenario and such basic issues casts serious doubts.
Regards,
Shivdeep