We've made this changes on User model class at com.myproject.app.model. As
you 
can see, the only line added is an annotation to support the inheritance.



@Entity
@Table(name="app_user")
@Inheritance(strategy=InheritanceType.JOINED) // Added for supporting of
                                                                                
          // inheritance on other Classes
public class User extends BaseObject implements Serializable, UserDetails {
...
}



The class we need to inherit from User is this:



@Entity
@Table(name="doctor",schema="public")
@PrimaryKeyJoinColumn(name="iddoctor",referencedColumnName="id")
public class Doctor extends User implements Serializable, UserDetails {
...

}



When we use the "mvn appfuse:gen" for class Doctor to generate the
jsp files, the i18n messages, etc.; the command crash with this error
message:



===================================================================

What is the name of your pojo (i.e. Person)?: 
[INFO] Configuration XML file loaded:
D:\webdr\appfuse2-projects\webdrbstruts\src\main\resources\hibernate.cfg.xml
[INFO] Configuration XML file loaded:
D:\webdr\appfuse2-projects\webdrbstruts\src\main\resources\hibernate.cfg.xml
[INFO] src/main/resources/database.properties not found within the project.
Trying absolute path.
[INFO] No hibernate properties file loaded.
ERROR [main] runtime.error(96) | 
Expression idFieldName is undefined on line 47, column 57 in
appfuse/web/struts/form-view.ftl.
The problematic instruction:
----------
==> ${idFieldName} [on line 47, column 55 in
appfuse/web/struts/form-view.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression idFieldName is
undefined on line 47, column 57 in appfuse/web/struts/form-view.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.Environment.process(Environment.java:176)
        at freemarker.template.Template.process(Template.java:231)
        at
org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
        at
org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
        at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
        at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
        at
org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
        at 
org.appfuse.tool.AppFuseExporter$1.exportPOJO(AppFuseExporter.java:214)
        at
org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
        at
org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
        at
org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
        at
org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
        at 
org.appfuse.tool.AppFuseExporter.generateWeb(AppFuseExporter.java:158)
        at org.appfuse.tool.AppFuseExporter.doStart(AppFuseExporter.java:50)
        at
org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
        at
org.appfuse.mojo.HibernateExporterMojo.doExecute(HibernateExporterMojo.java:228)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.doExecute(AppFuseGeneratorMojo.java:251)
        at
org.appfuse.mojo.HibernateExporterMojo.execute(HibernateExporterMojo.java:138)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.execute(AppFuseGeneratorMojo.java:204)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        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.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)
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error while processing template appfuse/web/struts/form-view.ftl
Expression idFieldName is undefined on line 47, column 57 in
appfuse/web/struts/form-view.ftl.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.hibernate.tool.hbm2x.ExporterException: Error while processing template
appfuse/web/struts/form-view.ftl
        at
org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:253)
        at
org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
        at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
        at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
        at
org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
        at 
org.appfuse.tool.AppFuseExporter$1.exportPOJO(AppFuseExporter.java:214)
        at
org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
        at
org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
        at
org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
        at
org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
        at 
org.appfuse.tool.AppFuseExporter.generateWeb(AppFuseExporter.java:158)
        at org.appfuse.tool.AppFuseExporter.doStart(AppFuseExporter.java:50)
        at
org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
        at
org.appfuse.mojo.HibernateExporterMojo.doExecute(HibernateExporterMojo.java:228)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.doExecute(AppFuseGeneratorMojo.java:251)
        at
org.appfuse.mojo.HibernateExporterMojo.execute(HibernateExporterMojo.java:138)
        at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.execute(AppFuseGeneratorMojo.java:204)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        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.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: freemarker.core.InvalidReferenceException: Expression idFieldName
is undefined on line 47, column 57 in appfuse/web/struts/form-view.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.Environment.process(Environment.java:176)
        at freemarker.template.Template.process(Template.java:231)
        at
org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
        ... 34 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Mon Oct 22 09:54:42 ART 2007
[INFO] Final Memory: 16M/29M
[INFO]
------------------------------------------------------------------------



¿What's the problem here?. How can we pull out this?? 
Do we need to run appfuse:gen for class User every time we modify it??
We used the appfuse:full-sources plugin.

Thanks.



mraible wrote:
> 
> You could use the full-source plugin to get all of AppFuse's source
> and modify at will. You can also just modify the model classes using
> the following instructions:
> 
> http://appfuse.org/display/APF/AppFuse+Core+Classes
> 
> Matt
> 
> On 10/21/07, ghuttemann  wrote:
>>
>> Is there a way we can create our application using our class User or can
>> we
>> modify the class User provided by AppFuse?? Our application have a
>> complicated inheritance model for users so the class User from AppFuse
>> doesn't fit well.
>>
>> Thanks.
>> --
>> View this message in context:
>> http://www.nabble.com/Not-using-model-classes-from-AppFuse-tf4668430s2369.html#a13335994
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> http://raibledesigns.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Not-using-model-classes-from-AppFuse-tf4668430s2369.html#a13342270
Sent from the AppFuse - User mailing list archive at Nabble.com.

Reply via email to