I have mapped all my domain objects and I keep getting errors as I am trying to test that don't tell me much. All i am doing is trying to initialize my session factory with all the mapping resources. I get the errors and it tells me there is a problem initiallizaing the session bean but not which mapping file. My domain model is very relational so it is hard to figure out which mapping resource is to blame. Is there a way to get errors that will actually tell you which mapping file/class/table is of error
I get errors like this:
Code:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [/home/ryan/documents/work/mbs/cvs/MBS/conf/TestApplicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
org.hibernate.MappingException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:408)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:621)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67)
at com.mbs.tests.fullcircle.FullCircleTestTemplate.main(FullCircleTestTemplate.java:65)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:444)
at org.hibernate.mapping.Column.setName(Column.java:59)
at org.hibernate.cfg.HbmBinder.bindColumns(HbmBinder.java:957)
at org.hibernate.cfg.HbmBinder.bindColumnsOrFormula(HbmBinder.java:1313)
at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1001)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1769)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1728)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:318)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:236)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:152)
at org.hibernate.cfg.Configuration.add(Configuration.java:362)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:400)
... 10 more
Or This one