Hi,
I'm starting out with Hibernate 2.0.3 by reverse engineering a 100+ table MsSQL database using Middlegen. When building the SessionFactory I get an ArrayIndexOutOfBoundsException (appended below).
I know that incorrect mapping causes the problem, but I have no clue as to which entity is the culprit. I guess I can find the problem by a process of elimination, but with around 130 *.hbm.xml files it may take a while - plus many of the entities are related and must be deployed together.
The whole point of using Middlegen was to automate the metadata and POJO generation, but now it looks like I will spend as much time debugging the generated meta as I would writing it by hand.
Question:
Is there a quick way of finding out which outer join caused the ArrayIndexOutOfBoundsException?
Could removing the inverse bi-directional association elements fix this?
Is there a way to disable the inverse bi-directional association generation in Middlegen? Going through hundreds of files is not my idea of time well spent.
many thanks,
Greg
THE EXCEPTION:
Error: java.lang.ArrayIndexOutOfBoundsException: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at net.sf.hibernate.util.ArrayHelper.slice(ArrayHelper.java:59)
at net.sf.hibernate.loader.OuterJoinLoader.walkComponentTree(OuterJoinLoader.java:230)
at net.sf.hibernate.loader.OuterJoinLoader.walkClassTree(OuterJoinLoader.java:191)
at net.sf.hibernate.loader.OuterJoinLoader.walkTree(OuterJoinLoader.java:74)
at net.sf.hibernate.loader.OneToManyLoader.<init>(OneToManyLoader.java:57)
at net.sf.hibernate.collection.CollectionPersister.createCollectionQuery(CollectionPersister.java:277)
at net.sf.hibernate.collection.CollectionPersister.<init>(CollectionPersister.java:268)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at com.genesys.confmgr.controller.action.GregDemoAction.testHibernate(GregDemoAction.java:73)
at com.genesys.confmgr.controller.action.GregDemoAction.execute(GregDemoAction.java:134)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
|