-->
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.  [ 9 posts ] 
Author Message
 Post subject: Hibernate Tool error while mapping large database
PostPosted: Sat Apr 21, 2007 12:36 am 
Newbie

Joined: Thu Jan 04, 2007 9:28 am
Posts: 3
Hi,


I'm currently trying to map a large database (about 300 tables) using hibernate tools v 3.2 beta9. I've successfully mapped its previous version with custom strategy and template.

I'm now getting the following error:



21/Abr/2007 5:28:29 freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernatetool] SEVERE:
[hibernatetool] Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(nonio.data.pojo.table.Disciplina)
[hibernatetool] The problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> ${pojo.generateCollectionAnnotation(property, cfg)} [on line 18, column 1 in Ejb3PropertyGetAnnotation.ftl]
[hibernatetool] in include "Ejb3PropertyGetAnnotation.ftl" [on line 8, column 5 in PojoPropertyAccessors.ftl]
[hibernatetool] in include "PojoPropertyAccessors.ftl" [on line 24, column 1 in Pojo.ftl]
[hibernatetool] ----------
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(nonio.data.pojo.table.Disciplina)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
[hibernatetool] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
[hibernatetool] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)

The database was validated by Power designer and the script run without any error in a Oracle 10g server.


I would really appreciate any help in this matter..

Thanks in advance,
Ricardo

_________________
Ricardo Bica


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 21, 2007 12:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please post the full stacktrace so we can see what is actually causing it to stop at that line in the template.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Full stack trace
PostPosted: Sat Apr 21, 2007 9:35 pm 
Newbie

Joined: Thu Jan 04, 2007 9:28 am
Posts: 3
Here's the full stack trace. I've also obtained the same error with the default template and strategy.


Buildfile: C:\nonio\code\mapeamentoV03\build.xml
pojos:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: generic exporter
[hibernatetool] 22/Abr/2007 2:31:31 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.2.0.cr5
[hibernatetool] 22/Abr/2007 2:31:31 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 22/Abr/2007 2:31:31 org.hibernate.cfg.Environment buildBytecodeProvider
[hibernatetool] INFO: Bytecode provider name : cglib
[hibernatetool] 22/Abr/2007 2:31:31 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 22/Abr/2007 2:31:31 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.cfg.reveng.OverrideRepository addFile
[hibernatetool] INFO: Override file: C:\nonio\code\mapeamentoV03\hibernate.reveng.xml
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: Hibernate connection pool size: 20
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: autocommit mode: false
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@192.168.1.201:1521:orcl
[hibernatetool] 22/Abr/2007 2:31:32 org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernatetool] INFO: connection properties: {user=nonioacadv11r, password=****}
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
[hibernatetool] With the Partitioning, OLAP and Data Mining options
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC driver: Oracle JDBC driver, version: 10.2.0.2.0
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.dialect.Dialect <init>
[hibernatetool] INFO: Using dialect: org.hibernate.dialect.OracleDialect
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
[hibernatetool] INFO: Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
[hibernatetool] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Automatic flush during beforeCompletion(): disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Automatic session close at end of transaction: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC batch size: 15
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC batch updates for versioned data: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Scrollable result sets: enabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JDBC3 getGeneratedKeys(): disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Connection release mode: auto
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Default batch fetch size: 1
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Generate SQL with comments: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Order SQL updates by primary key: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
[hibernatetool] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
[hibernatetool] INFO: Using ASTQueryTranslatorFactory
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Query language substitutions: {}
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: JPA-QL strict compliance: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Second-level cache: enabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Query cache: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory createCacheProvider
[hibernatetool] INFO: Cache provider: org.hibernate.cache.NoCacheProvider
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Optimize cache for minimal puts: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Structured second-level cache entries: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Statistics: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 22/Abr/2007 2:31:33 org.hibernate.cfg.SettingsFactory buildSettings
[hibernatetool] INFO: Default entity-mode: pojo
[hibernatetool] 22/Abr/2007 2:33:19 org.hibernate.connection.DriverManagerConnectionProvider close
[hibernatetool] INFO: cleaning up connection pool: jdbc:oracle:thin:@192.168.1.201:1521:orcl
[hibernatetool] 22/Abr/2007 2:33:20 org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.0.beta8
[hibernatetool] 22/Abr/2007 2:33:21 freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernatetool] SEVERE:
[hibernatetool] Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(nonio.data.pojo.table.Disciplina)
[hibernatetool] The problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> ${pojo.generateCollectionAnnotation(property, cfg)} [on line 18, column 1 in Ejb3PropertyGetAnnotation.ftl]
[hibernatetool] in include "Ejb3PropertyGetAnnotation.ftl" [on line 8, column 5 in PojoPropertyAccessors.ftl]
[hibernatetool] in include "PojoPropertyAccessors.ftl" [on line 24, column 1 in Pojo.ftl]
[hibernatetool] ----------
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(nonio.data.pojo.table.Disciplina)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
[hibernatetool] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
[hibernatetool] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
[hibernatetool] at freemarker.core.Expression.getStringValue(Expression.java:93)
[hibernatetool] at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IfBlock.accept(IfBlock.java:82)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.include(Environment.java:1375)
[hibernatetool] at freemarker.core.Include.accept(Include.java:155)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:351)
[hibernatetool] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.include(Environment.java:1375)
[hibernatetool] at freemarker.core.Include.accept(Include.java:155)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:233)
[hibernatetool] at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.process(Environment.java:176)
[hibernatetool] at freemarker.template.Template.process(Template.java:231)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:245)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:84)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:73)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:56)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:41)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] Caused by: java.lang.NullPointerException
[hibernatetool] at org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(EntityPOJOClass.java:561)
[hibernatetool] at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
[hibernatetool] ... 58 more
[hibernatetool] An exception occurred while running exporter #2:generic exporter
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template Pojo.ftl
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(nonio.data.pojo.table.Disciplina)
[hibernatetool] java.lang.NullPointerException

BUILD FAILED
C:\nonio\code\mapeamentoV03\build.xml:23: org.hibernate.tool.hbm2x.ExporterException: Error while processing template Pojo.ftl

thanks in advance,
Ricardo Bica

_________________
Ricardo Bica


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 8:51 am 
Newbie

Joined: Wed Feb 21, 2007 3:09 am
Posts: 16
It seems to me that, ur hibernate tools plug-ins may be corrupted. Better u place them again and restart ur processing.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 7:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so something in your db schema results in a nullpointer exception.

Could you show the stacktrace for the nullpointer exception ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Error RevEng DB: generateCollectionAnnotation threw Exceptio
PostPosted: Wed Jun 06, 2007 2:48 pm 
Newbie

Joined: Wed Jun 06, 2007 2:25 pm
Posts: 2
Hi - I'm experiencing a similar error as rjbica posted. What was the solution? Any ideas to try?

FYI: I am using Jboss Seam 1.2.1's seam-gen command which calls the Hibernate tool for reverse engineering.

Here is the output from the build:


Code:
Buildfile: C:\data\workspace\dev10\jboss-seam\seam-gen\build.xml
validate-workspace:
validate-project:
generate-entities:
[hibernate] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernate] 1. task: hbm2java (Generates a set of .java files)
[hibernate] Jun 6, 2007 11:14:04 AM org.hibernate.cfg.Environment <clinit>
[hibernate] INFO: Hibernate 3.2.0.cr5
[hibernate] Jun 6, 2007 11:14:04 AM org.hibernate.cfg.Environment <clinit>
[hibernate] INFO: hibernate.properties not found
[hibernate] Jun 6, 2007 11:14:04 AM org.hibernate.cfg.Environment buildBytecodeProvider
[hibernate] INFO: Bytecode provider name : cglib
[hibernate] Jun 6, 2007 11:14:04 AM org.hibernate.cfg.Environment <clinit>
[hibernate] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: Using Hibernate built-in connection pool (not for production use!)
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: Hibernate connection pool size: 20
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: autocommit mode: false
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: using driver: com.microsoft.sqlserver.jdbc.SQLServerDriver at URL: jdbc:sqlserver://sqld-xxx.COM:<port>
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.connection.DriverManagerConnectionProvider configure
[hibernate] INFO: connection properties: {user=appuser, password=****}
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: RDBMS: Microsoft SQL Server, version: 8.00.2039
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JDBC driver: Microsoft SQL Server 2005 JDBC Driver, version: 1.1.1501.101
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.dialect.Dialect <init>
[hibernate] INFO: Using dialect: org.hibernate.dialect.SQLServerDialect
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
[hibernate] INFO: Using default transaction strategy (direct JDBC transactions)
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
[hibernate] INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Automatic flush during beforeCompletion(): disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Automatic session close at end of transaction: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Scrollable result sets: enabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JDBC3 getGeneratedKeys(): enabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Connection release mode: auto
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default schema: dbo
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default catalog: Treasury
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default batch fetch size: 1
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Generate SQL with comments: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Order SQL updates by primary key: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
[hibernate] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
[hibernate] INFO: Using ASTQueryTranslatorFactory
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Query language substitutions: {}
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: JPA-QL strict compliance: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Second-level cache: enabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Query cache: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory createCacheProvider
[hibernate] INFO: Cache provider: org.hibernate.cache.NoCacheProvider
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Optimize cache for minimal puts: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Structured second-level cache entries: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Statistics: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Deleted entity synthetic identifier rollback: disabled
[hibernate] Jun 6, 2007 11:14:05 AM org.hibernate.cfg.SettingsFactory buildSettings
[hibernate] INFO: Default entity-mode: pojo
[hibernate] Jun 6, 2007 11:14:07 AM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in sysconstraints. Asking rev.eng. strategy
[hibernate] Jun 6, 2007 11:14:07 AM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for sysconstraints
[hibernate] Jun 6, 2007 11:14:07 AM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: The JDBC driver didn't report any primary key columns in syssegments. Asking rev.eng. strategy
[hibernate] Jun 6, 2007 11:14:07 AM org.hibernate.cfg.reveng.JDBCReader processPrimaryKey
[hibernate] WARNING: Rev.eng. strategy did not report any primary key columns for syssegments
[hibernate] Jun 6, 2007 11:14:08 AM org.hibernate.connection.DriverManagerConnectionProvider close
[hibernate] INFO: cleaning up connection pool: jdbc:sqlserver://sqld-xxx.COM:<port>
[hibernate] Jun 6, 2007 11:14:08 AM org.hibernate.tool.Version <clinit>
[hibernate] INFO: Hibernate Tools 3.2.0.b9
Jun 6, 2007 11:14:08 AM org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:sqlserver://sqld-xxx.COM:<port>
[hibernate] Jun 6, 2007 11:14:09 AM freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernate] SEVERE:
[hibernate] Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.company.model.PricingSegment)
[hibernate] The problematic instruction:
[hibernate] ----------
[hibernate] ==> ${pojo.generateCollectionAnnotation(property, cfg)} [on line 15, column 1 in pojo/Ejb3PropertyGetAnnotation.ftl]
[hibernate] in include "Ejb3PropertyGetAnnotation.ftl" [on line 1, column 1 in pojo/GetPropertyAnnotation.ftl]
[hibernate] in include "GetPropertyAnnotation.ftl" [on line 9, column 5 in pojo/PojoPropertyAccessors.ftl]
[hibernate] in include "PojoPropertyAccessors.ftl" [on line 12, column 1 in pojo/Pojo.ftl]
[hibernate] ----------
[hibernate] Java backtrace for programmers:
[hibernate] ----------
[hibernate] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.company.model.PricingSegment)
[hibernate] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
[hibernate] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
[hibernate] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
[hibernate] at freemarker.core.Expression.getStringValue(Expression.java:93)
[hibernate] at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.IfBlock.accept(IfBlock.java:82)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.Environment.include(Environment.java:1375)
[hibernate] at freemarker.core.Include.accept(Include.java:155)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.Environment.include(Environment.java:1375)
[hibernate] at freemarker.core.Include.accept(Include.java:155)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
[hibernate] at freemarker.core.Environment.visit(Environment.java:351)
[hibernate] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.Environment.include(Environment.java:1375)
[hibernate] at freemarker.core.Include.accept(Include.java:155)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.IfBlock.accept(IfBlock.java:82)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.Environment.visit(Environment.java:233)
[hibernate] at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernate] at freemarker.core.Environment.visit(Environment.java:196)
[hibernate] at freemarker.core.Environment.process(Environment.java:176)
[hibernate] at freemarker.template.Template.process(Template.java:231)
[hibernate] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
[hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
[hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
[hibernate] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
[hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
[hibernate] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
[hibernate] at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
[hibernate] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
[hibernate] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
[hibernate] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
[hibernate] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
[hibernate] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernate] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernate] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernate] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernate] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernate] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernate] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernate] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernate] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernate] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernate] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernate] Caused by: java.lang.NullPointerException
[hibernate] at org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.getManyToManyMappedBy(EntityPOJOClass.java:561)
[hibernate] at org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(EntityPOJOClass.java:505)
[hibernate] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[hibernate] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[hibernate] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernate] at java.lang.reflect.Method.invoke(Method.java:585)
[hibernate] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)
[hibernate] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
[hibernate] ... 69 more
[hibernate] An exception occurred while running exporter #2:hbm2java (Generates a set of .java files)
[hibernate] To get the full stack trace run ant with -verbose
[hibernate] org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo/Pojo.ftl
[hibernate] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.EntityPOJOClass.generateCollectionAnnotation(org.hibernate.mapping.Property,org.hibernate.cfg.Configuration) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.company.model.PricingSegment)
[hibernate] java.lang.NullPointerException

BUILD FAILED
C:\data\workspace\dev10\jboss-seam\seam-gen\build.xml:805: org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo/Pojo.ftl

Total time: 5 seconds



Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 06, 2007 3:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it's not the same error, but as I said as before present the minimal db schema that results in this problem.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Minimal Model To Produce Issue
PostPosted: Wed Jun 06, 2007 7:05 pm 
Newbie

Joined: Wed Jun 06, 2007 2:25 pm
Posts: 2
Hey Max - Here is a minimal datamodel which should reproduce the error:

Code:
CREATE TABLE PRICING_SEGMENT (
   PS_ID INTEGER NOT NULL,
   CODE VARCHAR(7) NOT NULL,
   NAME VARCHAR(55) NOT NULL
)

CREATE TABLE ALPHA_DATA_CATEGORY (
   CATEGORY_ID INTEGER NOT NULL
)

CREATE TABLE PS_ALPHA_DATA (
   PS_ID INTEGER NOT NULL,
   CATEGORY_ID INTEGER NOT NULL
)

CREATE UNIQUE INDEX FK2_PS_ALPHA_DATA ON PS_ALPHA_DATA (CATEGORY_ID ASC)
CREATE UNIQUE INDEX FK1_PRICING_SEGMENT ON PRICING_SEGMENT (CODE ASC)
CREATE UNIQUE INDEX FK1_PS_ALPHA_DATA ON PS_ALPHA_DATA (PS_ID ASC)
CREATE INDEX PK_PS_1 ON PS_ALPHA_DATA (PS_ID ASC, CATEGORY_ID ASC)
CREATE INDEX PK_PS_2 ON PRICING_SEGMENT (PS_ID ASC)
ALTER TABLE PS_ALPHA_DATA ADD CONSTRAINT PK_PS_1 PRIMARY KEY (PS_ID, CATEGORY_ID)
ALTER TABLE PRICING_SEGMENT ADD CONSTRAINT PK_PS_2 PRIMARY KEY (PS_ID)
ALTER TABLE PS_ALPHA_DATA ADD CONSTRAINT FK_PRIC_S_CAT_1 FOREIGN KEY (CATEGORY_ID)
   REFERENCES ALPHA_DATA_CATEGORY (CATEGORY_ID)
   ON DELETE RESTRICT
   ON UPDATE RESTRICT
ALTER TABLE PS_ALPHA_DATA ADD CONSTRAINT FK_PRIC_S_CAT_2 FOREIGN KEY (PS_ID)
   REFERENCES PRICING_SEGMENT (PS_ID)
   ON DELETE RESTRICT
   ON UPDATE RESTRICT


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 2:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
thanks, but please put it in jira with ref back to this thread (and dont forget to include what db name/version the sql is for)

_________________
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.  [ 9 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.