Hi,
I've created a new Spring MVC Basic project.
Changed the DB in the pom.xml to an existing one
mvn compile,executes ok
mvn appfuse:gen-model fails with following error:
10:43:33,984 ERROR freemarker.runtime -
Method public java.lang.String
org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.gen
erateJoinColumnsAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Conf
iguration) threw an exception when invoked on
org.hibernate.tool.hbm2x.pojo.Enti
tyPOJOClass(com.nubitek.vestia.model.HistoricoVarparam)
The problematic instruction:
----------
==> ${pojo.generateJoinColumnsAnnotation(property)} [on line 11, column 15
in ap
pfuse/model/Ejb3PropertyGetAnnotation.ftl]
in include "Ejb3PropertyGetAnnotation.ftl" [on line 1, column 1 in
appfuse/mode
l/GetPropertyAnnotation.ftl]
in include "GetPropertyAnnotation.ftl" [on line 9, column 5 in
appfuse/model/Po
joPropertyAccessors.ftl]
in include "PojoPropertyAccessors.ftl" [on line 9, column 1 in
appfuse/model/Po
jo.ftl]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Method public java.lang.String
org.h
ibernate.tool.hbm2x.pojo.EntityPOJOClass.generateJoinColumnsAnnotation(org.hiber
nate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception
when i
nvoked on
org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.nubitek.vestia.model
.HistoricoVarparam)
at
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:13
6)
at
freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
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.IfBlock.accept(IfBlock.java:82)
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.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
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.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:196)
at
freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
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.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
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.IfBlock.accept(IfBlock.java:82)
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.visit(Environment.java:233)
at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
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:232)
at
org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:251)
at
org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplatePro
ducer.java:67)
at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:28)
at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:97)
at
org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j
ava:146)
at
org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi
cExporter.java:135)
at
org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.ja
va:41)
at
org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java
:126)
at
org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java
:95)
at
org.appfuse.mojo.HibernateExporterMojo.doExecute(HibernateExporterMoj
o.java:228)
at
org.appfuse.mojo.exporter.ModelGeneratorMojo.execute(ModelGeneratorMo
jo.java:183)
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.executeStandalone
Goal(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:482)
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: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: java.lang.IllegalArgumentException: wrong number of arguments
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:597)
at
freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:616)
at
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:11
3)
... 74 more
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error while processing template appfuse/model/Pojo.ftl
wrong number of arguments
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.hibernate.tool.hbm2x.ExporterException: Error while processing template
appf
use/model/Pojo.ftl
at
org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:257)
at
org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplatePro
ducer.java:67)
at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:28)
at
org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:97)
at
org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j
ava:146)
at
org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi
cExporter.java:135)
at
org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.ja
va:41)
at
org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java
:126)
at
org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java
:95)
at
org.appfuse.mojo.HibernateExporterMojo.doExecute(HibernateExporterMoj
o.java:228)
at
org.appfuse.mojo.exporter.ModelGeneratorMojo.execute(ModelGeneratorMo
jo.java:183)
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.executeStandalone
Goal(DefaultLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:482)
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: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.template.TemplateModelException: Method public
java.lang.S
tring
org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateJoinColumnsAnnotatio
n(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an
excep
tion when invoked on
org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.nubitek.v
estia.model.HistoricoVarparam)
at
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:13
6)
at
freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
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.IfBlock.accept(IfBlock.java:82)
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.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
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.ConditionalBlock.accept(ConditionalBlock.java:79)
at freemarker.core.Environment.visit(Environment.java:196)
at
freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
at freemarker.core.Environment.visit(Environment.java:351)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
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.include(Environment.java:1375)
at freemarker.core.Include.accept(Include.java:155)
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.IfBlock.accept(IfBlock.java:82)
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.visit(Environment.java:233)
at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
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:232)
at
org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:251)
... 28 more
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
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:597)
at
freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:616)
at
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:11
3)
... 74 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Wed Jun 18 10:43:34 CEST 2008
[INFO] Final Memory: 19M/34M
[INFO]
------------------------------------------------------------------------
I wonder where does this apply: Caused by:
java.lang.IllegalArgumentException: wrong number of arguments
Now if I create a new Spring MVC basic projec, add to the db appfuse creates
new tables and
then run mvn appfuse:gen-model the POJOs generated fine.
The HistoricoVarparam table should not be the problem since excluding that
does nothing more
but to give the same error in the next table it tries to generate code from.
Appfuse Version: 2.0.2
Maven: 2.0.9
I am using the default hibernate.reveng.xml
any ideas?
I´ve read everything I could find on similar issues and still haven't found
a solution, probably something obvious I'm missing?
Could it be the database it self? Although the tables I add to the appfuse
db are taken from the same script...
thanks
stelios
--
View this message in context:
http://www.nabble.com/appfuse%3Agen-model-anomaly...-tp17979188s2369p17979188.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]