Hi, I think you put the class name package wrongly, you should put: com.joeco.app.model.Person on <mapping class="com.joeco.app.Person" />.
Change it to: <mapping class="com.joeco.app.model.Person" />. On Thu, Aug 28, 2008 at 9:27 AM, jned <[EMAIL PROTECTED]> wrote: > > I have been following the following directions and I haven't been able to get > it to work. > > http://appfuse.org/display/APF/Persistence > > Here's my Person.java- > > package com.joeco.app.model; > > import javax.persistence.Entity; > import javax.persistence.GenerationType; > import javax.persistence.Id; > import javax.persistence.GeneratedValue; > import javax.persistence.Column; > > import org.appfuse.model.BaseObject; > > @Entity > public class Person { > private Long id; > private String firstName; > private String lastName; > > @Column(name="first_name", length=50) > public String getFirstName() { > return firstName; > } > public void setFirstName(String firstName) { > this.firstName = firstName; > } > public Long getId() { > return id; > } > public void setId(Long id) { > this.id = id; > } > @Column(name="last_name", length=50) > public String getLastName() { > return lastName; > } > public void setLastName(String lastName) { > this.lastName = lastName; > } > > } > > > Here is what happens when I run the hbm2ddl task- > > C:\dev\Java\projects\storefront>mvn test-compile hibernate3:hbm2ddl > [INFO] Scanning for projects... > [INFO] Searching repository for plugin with prefix: 'hibernate3'. > [INFO] > ------------------------------------------------------------------------ > [INFO] Building AppFuse Spring MVC Application > [INFO] task-segment: [test-compile, hibernate3:hbm2ddl] > [INFO] > ------------------------------------------------------------------------ > [INFO] [warpath:add-classes {execution: default}] > [INFO] [aspectj:compile {execution: default}] > [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}] > [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}] > [INFO] [resources:resources] > [INFO] Using default encoding to copy filtered resources. > [INFO] [compiler:compile] > [INFO] Nothing to compile - all classes are up to date > [INFO] [resources:testResources] > [INFO] Using default encoding to copy filtered resources. > [INFO] Preparing hibernate3:hbm2ddl > [WARNING] Removing: hbm2ddl from forked lifecycle, to prevent recursive > invocati > on. > [INFO] [warpath:add-classes {execution: default}] > [INFO] [aspectj:compile {execution: default}] > [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}] > [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}] > [INFO] [resources:resources] > [INFO] Using default encoding to copy filtered resources. > [WARNING] POM for 'org.hibernate:jtidy:pom:r8-20060801:runtime' is invalid. > It w > ill be ignored for artifact resolution. Reason: Parse error reading POM. > Reason: > TEXT must be immediately followed by END_TAG and not START_TAG (position: > START > _TAG seen ...<licenses>\n\t\t\t<license>... @12:13) for project > org.hibernate:j > tidy at C:\Documents and > Settings\joe.nedumgottil\.m2\repository\org\hibernate\j > tidy\r8-20060801\jtidy-r8-20060801.pom > [INFO] [hibernate3:hbm2ddl {execution: default}] > [INFO] Configuration XML file loaded: > file:/C:/dev/Java/projects/storefront/src/ > main/resources/hibernate.cfg.xml > [INFO] Configuration XML file loaded: > file:/C:/dev/Java/projects/storefront/src/ > main/resources/hibernate.cfg.xml > [INFO] > ------------------------------------------------------------------------ > [ERROR] FATAL ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Unable to load class declared as <mapping > class="com.joeco.app.Person"/> > in the configuration: > [INFO] > ------------------------------------------------------------------------ > [INFO] Trace > org.hibernate.MappingException: Unable to load class declared as <mapping > class= > "com.joeco.app.Person"/> in the configuration: > at > org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(Annotat > ionConfiguration.java:602) > at > org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav > a:1555) > at > org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534) > at > org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508) > at > org.hibernate.cfg.Configuration.configure(Configuration.java:1443) > at > org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura > tion.doConfiguration(AbstractComponentConfiguration.java:77) > at > org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura > tion.getConfiguration(AbstractComponentConfiguration.java:40) > at > org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(H > bm2DDLExporterMojo.java:87) > at > org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE > xporterMojo.java:140) > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi > nManager.java:451) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa > ultLifecycleExecutor.java:558) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi > fecycle(DefaultLifecycleExecutor.java:499) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau > ltLifecycleExecutor.java:478) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan > dleFailures(DefaultLifecycleExecutor.java:330) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen > ts(DefaultLifecycleExecutor.java:291) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi > fecycleExecutor.java:142) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > Caused by: java.lang.ClassNotFoundException: com.joeco.app.Person > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > at > org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassL > oader.java:195) > at > org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassReal > m.java:255) > at > org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassReal > m.java:274) > at > org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader. > java:214) > at java.lang.ClassLoader.loadClass(ClassLoader.java:251) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:164) > at > org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100) > > at > org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(Annotat > ionConfiguration.java:599) > ... 26 more > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 7 seconds > [INFO] Finished at: Wed Aug 27 21:07:06 CDT 2008 > [INFO] Final Memory: 18M/35M > [INFO] > ------------------------------------------------------------------------ > > > Has anyone ever seen this? I have a colleague who has the same problem. > > > -- > View this message in context: > http://www.nabble.com/generate-schema-%28hbm2ddl%29-does-not-work-tp19193255s2369p19193255.html > Sent from the AppFuse - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Wassalamu'alaikum wr. wb. Mohammad Irfan --- www.doktermaya.com www.L-Ads.com (classifieds ads, iklan baris) www.komplain.org (complain about product) www.akarprima.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
