Hello,
I am using Hibernate 2.1.4, Oracle9i and the Middlegen plugin bundle from sourceforge. First time using Middlegen, pretty cool tool. It generated the source from what I can tell correctly. However, when I try to load the .hbm.xml files I receive the following error
Code:
13:31:20,752 INFO Binder:229 - Mapping class: sh.hibernate.Document -> DOCUMENT
13:31:20,783 INFO Configuration:185 - Mapping file: c:\projects\hub\target\classes\sh\hibernate\Documentauthor.hbm.xml
13:31:20,799 INFO Binder:229 - Mapping class: sh.hibernate.Documentauthor -> DOCUMENTAUTHOR
13:31:20,893 INFO ReflectHelper:176 - reflection optimizer disabled for: sh.hibernate.DocumentauthorPK, IllegalAccessError: null
java.lang.IllegalAccessError
at net.sf.cglib.core.ClassEmitter.setTarget(ClassEmitter.java:85)
at net.sf.cglib.core.ClassEmitter.<init>(ClassEmitter.java:77)
at net.sf.cglib.reflect.FastClassEmitter.<init>(FastClassEmitter.java:91)
at net.sf.cglib.reflect.FastClass$Generator.generateClass(FastClass.java:100)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:63)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:192)
at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:92)
at net.sf.cglib.reflect.FastClass.create(FastClass.java:74)
at net.sf.hibernate.type.ComponentType.<init>(ComponentType.java:113)
at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:899)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:287)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:187)
at net.sf.hibernate.cfg.Configuration.addDirectory(Configuration.java:421)
at sh.util.HibernateUtil.<init>(HibernateUtil.java:64)
at sh.util.HibernateUtil.<clinit>(HibernateUtil.java:30)
at sh.dao.KeyDao.<init>(KeyDao.java:28)
at sh.cmd.QueryCommand.queryKey(QueryCommand.java:123)
at sh.cmd.QueryCommand.execute(QueryCommand.java:57)
at sh.cmd.CommandManager.invokeCommand(CommandManager.java:36)
at sh.cmd.QueryCommand.<init>(QueryCommand.java:46)
at sh.cmd.CommandFactory.execute(CommandFactory.java:45)
at sh.HubMain.main(HubMain.java:44)
Exception in thread "main"
According to the doc I am suppose to let middlegen create the PK classes
Code:
<!-- Plugins - Only Hibernate Plugin has been included with this special distribution -->
<!--
If you want to generate XDoclet markup for hbm2java to include in the POJOs then
set genXDocletTags to true. Also, composite keys are generated as external classes which is
recommended. If you wish to keep them internal then set genIntergratedCompositeKeys to true.
Since r4 the ability to customise the selection of JavaTypes is now provided. The is a
recommended type mapper provided as shown. It is optional - if not provided then Middlegen
itself will select the Java mapping (as it did previously).
These settings are optional thus if they are not define here values default to false.
-->
<hibernate
destination="${classes.dir}"
package="com.bofa.ciportal.sh.hibernate"
genXDocletTags="true"
genIntergratedCompositeKeys="false"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
/>
I have tried to run it with compositeKeys=true and get the same error.
There is no *.hbm.xml file that is generated for the DocumentauthorPK class. I do not understand why this is happening. Can anyone point me in the right direction?
---Jason