RE: Hibernate 3 Plugin
Hello Neil I think the problem is it doesn't find the persistence.xml because it isn't the standard META-INF/persistence.xml as per the hibernatools documentation: https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html jpaconfiguration will simply just try and auto-configure itself based on the available classpath, e.g. look for META-INF/persistence.xml. Try moving your persistence.xml to the META-INF directory and try it again Regards Johann Reyes -Original Message- From: Neil Chaudhuri [mailto:nchaudh...@potomacfusion.com] Sent: Thursday, August 13, 2009 2:26 PM To: users@maven.apache.org Subject: Hibernate 3 Plugin I am using Maven with JPA/Hibernate, and I would like to generate a DDL file to give to my DBAs. I am using the Hibernate 3 Maven plugin to do this. However, I keep getting the error [ERROR] Persistence unit not found: 'myapp'. Here is the relevant portion of the POM: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.2/version configuration components component namehbm2ddl/name implementationjpaconfiguration/implementation /component /components componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile persistenceunitmyapp/persistenceunit outputfilenamemyapp.sql/outputfilename formattrue/format /componentProperties /configuration dependencies dependency groupIdcom.oracle.jdbc/groupId artifactIdojdbc6/artifactId version11.1.0.7.0/version /dependency /dependencies /plugin Here is the persistence.xml founf in src/main/resources as well as target/classes: persistence-unit name=myapp transaction-type=RESOURCE_LOCAL providerorg.hibernate.ejb.HibernatePersistence/provider jta-data-sourceMYAPP_DS/jta-data-source properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect/ property name=hibernate.cache.provider_class value=org.hibernate.cache.HashtableCacheProvider/ /properties /persistence-unit The files are where they are supposed to be, and surely the plugin knows to look in the target folder for everything. I would appreciate any insight into what the issue might be. Thanks. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Hibernate 3 Plugin
Hello Neil I think the problem is it doesn't find the persistence.xml because it isn't the standard META-INF/persistence.xml as per the hibernatools documentation: https://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html jpaconfiguration will simply just try and auto-configure itself based on the available classpath, e.g. look for META-INF/persistence.xml. Try moving your persistence.xml to the META-INF directory and try it again Regards Johann Reyes -Original Message- From: Neil Chaudhuri [mailto:nchaudh...@potomacfusion.com] Sent: Thursday, August 13, 2009 2:26 PM To: users@maven.apache.org Subject: Hibernate 3 Plugin I am using Maven with JPA/Hibernate, and I would like to generate a DDL file to give to my DBAs. I am using the Hibernate 3 Maven plugin to do this. However, I keep getting the error [ERROR] Persistence unit not found: 'myapp'. Here is the relevant portion of the POM: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.2/version configuration components component namehbm2ddl/name implementationjpaconfiguration/implementation /component /components componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile persistenceunitmyapp/persistenceunit outputfilenamemyapp.sql/outputfilename formattrue/format /componentProperties /configuration dependencies dependency groupIdcom.oracle.jdbc/groupId artifactIdojdbc6/artifactId version11.1.0.7.0/version /dependency /dependencies /plugin Here is the persistence.xml founf in src/main/resources as well as target/classes: persistence-unit name=myapp transaction-type=RESOURCE_LOCAL providerorg.hibernate.ejb.HibernatePersistence/provider jta-data-sourceMYAPP_DS/jta-data-source properties property name=hibernate.show_sql value=true/ property name=hibernate.format_sql value=true/ property name=hibernate.dialect value=org.hibernate.dialect.Oracle10gDialect/ property name=hibernate.cache.provider_class value=org.hibernate.cache.HashtableCacheProvider/ /properties /persistence-unit The files are where they are supposed to be, and surely the plugin knows to look in the target folder for everything. I would appreciate any insight into what the issue might be. Thanks. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Hibernate 3 Plugin
Hi, you haven't defined an execution for the PlugIN. executions execution idhbm2ddl/id phaseprocess-classes/phase goals goalhbm2ddl/goal /goals /execution /executions componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile In my opinion this should be changed... to the given persistence.xml file... Here is the persistence.xml founf in src/main/resources as well as target/classes: configurationfile${basedir}/src/main/resources/persistence.xml/configurationfile... Kind regards Karl Heinz Marbaise -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Hibernate 3 Plugin
With Karl's suggestion, I changed my plugin definition as follows: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.2/version executions execution idhbm2ddl/id phaseprocess-classes/phase goals goalhbm2ddl/goal /goals /execution /executions configuration components component namehbm2ddl/name implementationjpaconfiguration/implementation /component /components componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile${basedir}/src/main/resources/persistence.xml/configurationfile persistenceunitmyapp/persistenceunit outputfilenamemyapp.sql/outputfilename formattrue/format /componentProperties /configuration dependencies dependency groupIdcom.oracle.jdbc/groupId artifactIdojdbc6/artifactId version11.1.0.7.0/version /dependency /dependencies /plugin Unfortunately, I am still getting the same error. I am wondering if this has to do with the fact I have a multi-module project. This persistence pom produces a jar packaging and is dependent on no other modules, but it does have a parent pom that simply lists the modules and defines dependencies in common among modules like Spring. Should my plugin definition be at the parent level? Thanks. -Original Message- From: Karl Heinz Marbaise [mailto:khmarba...@gmx.de] Sent: Thu 8/13/2009 4:09 PM To: Maven Users List Subject: Re: Hibernate 3 Plugin Hi, you haven't defined an execution for the PlugIN. executions execution idhbm2ddl/id phaseprocess-classes/phase goals goalhbm2ddl/goal /goals /execution /executions componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile In my opinion this should be changed... to the given persistence.xml file... Here is the persistence.xml founf in src/main/resources as well as target/classes: configurationfile${basedir}/src/main/resources/persistence.xml/configurationfile... Kind regards Karl Heinz Marbaise -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Hibernate 3 Plugin
Also, in case you are trying to run unit tests against this: http://www.baselogic.com/blog/uncategorized/persistenceexception-issue-with-cobertura-and-the-hibernate3-maven-plugin --- Thank You… Mick Knutson, President BASE Logic, Inc. Enterprise Architecture, Design, Mentoring Agile Consulting p. (866) BLiNC-411: (254-6241-1) f. (415) 685-4233 Website: http://baselogic.com Linked IN: http://linkedin.com/in/mickknutson Vacation Rental: http://tahoe.baselogic.com --- On Thu, Aug 13, 2009 at 2:53 PM, Neil Chaudhuri nchaudh...@potomacfusion.com wrote: With Karl's suggestion, I changed my plugin definition as follows: plugin groupIdorg.codehaus.mojo/groupId artifactIdhibernate3-maven-plugin/artifactId version2.2/version executions execution idhbm2ddl/id phaseprocess-classes/phase goals goalhbm2ddl/goal /goals /execution /executions configuration components component namehbm2ddl/name implementationjpaconfiguration/implementation /component /components componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile${basedir}/src/main/resources/persistence.xml/configurationfile persistenceunitmyapp/persistenceunit outputfilenamemyapp.sql/outputfilename formattrue/format /componentProperties /configuration dependencies dependency groupIdcom.oracle.jdbc/groupId artifactIdojdbc6/artifactId version11.1.0.7.0/version /dependency /dependencies /plugin Unfortunately, I am still getting the same error. I am wondering if this has to do with the fact I have a multi-module project. This persistence pom produces a jar packaging and is dependent on no other modules, but it does have a parent pom that simply lists the modules and defines dependencies in common among modules like Spring. Should my plugin definition be at the parent level? Thanks. -Original Message- From: Karl Heinz Marbaise [mailto:khmarba...@gmx.de] Sent: Thu 8/13/2009 4:09 PM To: Maven Users List Subject: Re: Hibernate 3 Plugin Hi, you haven't defined an execution for the PlugIN. executions execution idhbm2ddl/id phaseprocess-classes/phase goals goalhbm2ddl/goal /goals /execution /executions componentProperties createtrue/create dropfalse/drop exportfalse/export configurationfile/target/classes/persistence.xml/configurationfile In my opinion this should be changed... to the given persistence.xml file... Here is the persistence.xml founf in src/main/resources as well as target/classes: configurationfile${basedir}/src/main/resources/persistence.xml/configurationfile... Kind regards Karl Heinz Marbaise -- SoftwareEntwicklung Beratung SchulungTel.: +49 (0) 2405 / 415 893 Dipl.Ing.(FH) Karl Heinz MarbaiseICQ#: 135949029 Hauptstrasse 177 USt.IdNr: DE191347579 52146 Würselen http://www.soebes.de - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org