-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Error while reverseengineering SOLVED
PostPosted: Mon Jun 19, 2006 7:02 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
SOLVED: I ignored warnings about primary keys that were missing. After fixing those warnings it worked.

I am running a fresh install of Eclipse 3.1.2 and Hibernate tools 3.1.0.beta5.

I made the appropriate files for reverse engineering.

Under Hibernate Code Generation -> Exporters I checked: Use Java 5 syntax, Generate EJB3 annotations, Domain code.

When I try to reverse engineer I get the following error message:


Code:
Error 2006-06-19 12:39:10.125 ERROR Worker-14 freemarker.runtime -

Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateAnnTableUniqueConstraint() threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(no.deltasoft.deltatotal.etel.Talign)
The problematic instruction:
----------
==> ${pojo.generateAnnTableUniqueConstraint()} [on line 13, column 29 in pojo/Ejb3TypeDeclaration.ftl]
in include "Ejb3TypeDeclaration.ftl" [on line 4, column 1 in pojo/PojoTypeDeclaration.ftl]
in include "PojoTypeDeclaration.ftl" [on line 5, column 1 in pojo/Pojo.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateAnnTableUniqueConstraint() threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(no.deltasoft.deltatotal.etel.Talign)
   at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
   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.ConditionalBlock.accept(ConditionalBlock.java:79)
   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.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.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.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:231)
   at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:243)
   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:112)
   at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:101)
   at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:84)
   at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:69)
   at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:93)
   at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:59)
   at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate$1.execute(CodeGenerationLaunchDelegate.java:250)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
   at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(CodeGenerationLaunchDelegate.java:221)
   at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(CodeGenerationLaunchDelegate.java:108)
   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:590)
   at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:515)
   at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:733)
   at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:931)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: java.lang.NullPointerException
   at org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateAnnTableUniqueConstraint(EntityPOJOClass.java:177)
   at org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateAnnTableUniqueConstraint(EntityPOJOClass.java:166)
   at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)
   at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
   ... 52 more


If I instead checked: Use Java 5 syntax, Domain code, Hibernate xml mappings it works.

I am not experienced enough in Eclipse or with the Hibernate tools to know what could be causing this error.

Thanks in advance for any help :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 8:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
any chance you can give me the SQL DDL for the schema you are trying to reverse engineer ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 9:38 am 
Regular
Regular

Joined: Wed Sep 28, 2005 6:45 pm
Posts: 56
Its huge, so probably no point...

I got the error while trying to reverse engineer a table without a primary key. When I added the primary key it worked.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 9:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - sounds like a viable cause for the bug ;)

could you submit it to jira ? Thanks!

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.