1

I am trying to generate a schema (ddl) from my orm.xml file. I'm using hibernate3-maven-plugin. I'm using JPA with hibernate as the implementation, but am open to other implementations or maven plugins. The code in my pom.xml is:

 <build>
    <plugins>
        <plugin>                
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>hibernate3-maven-plugin</artifactId>
            <version>3.0</version>

            <configuration>
                <hibernatetool>
                    <jpaconfiguration persistenceunit="unitname" />

                    <hbm2ddl export="false" create="true"
                 update="true" format="true" outputfilename="schemaDiff.ddl" />

                </hibernatetool>
            </configuration>
        </plugin>            
    </plugins>
</build>

The command I run is:

mvn hibernate3:hbm2ddl -e

The error I received is:

Caused by: java.lang.NoClassDefFoundError: org/hibernate/util/ReflectHelper at org.hibernate.tool.ant.JPAConfigurationTask.createConfiguration(JPAConfigurationTask.java:32) at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:54) at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302) at org.hibernate.tool.ant.Hbm2DDLExporterTask.createExporter(Hbm2DDLExporterTask.java:51) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) ... 28 more

Caused by: java.lang.ClassNotFoundException: org.hibernate.util.ReflectHelper at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) ... 40 more

1

1 Answer 1

1

George Herolyants presents a solution here.

http://doingenterprise.blogspot.com/2012/05/schema-generation-with-hibernate-4-jpa.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.