Hi
I am trying to use hibernate and spring to build a sample application. When I run maven test:test with log4j turned on, I get the following output. Also, I have included the junit log at the end. Looks like the process is dying somewhere in the secondPassCompile:Configuration.java
I have been able to generate Java files as well as ddl from the hbm.xml files (Account, Contact and Address). So I hope! that the mapping is all correct. Let me know if you need the mapping files, I would attach them too.
Any help would be greatly appreciated.
Thanks
Ramana
C:\eclipse_3_0M4\workspace\ContactManagementSystem>maven test:test
__ __
| \/ |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0-rc1-SNAPSHOT
<build><unitTest><resources><resource><directory>C:\eclipse_3_0M4\workspace\Cont
actManagementSystem/src/conf</directory><includes><include>*.xml</include><inclu
de>*.properties</include></includes></resource></resources></unitTest></build>ja
va:prepare-filesystem:
java:compile:
[echo] Compiling to C:\eclipse_3_0M4\workspace\ContactManagementSystem/targe
t/classes
java:jar-resources:
test:prepare-filesystem:
test:test-resources:
[echo] Moving conf data for hibernate.
test:compile:
test:test:
[junit] dir attribute ignored if running in the same VM
[junit] Running com.objectorama.CMS.AccountTest
Nov 26, 2003 7:22:13 PM org.springframework.beans.factory.xml.XmlBeanFactory loa
dBeanDefinitions
INFO: Loading XmlBeanFactory from InputStream [java.io.FileInputStream@e2ecc7]
Nov 26, 2003 7:22:14 PM org.springframework.context.support.AbstractXmlApplicati
onContext refreshBeanFactory
INFO: BeanFactory for application context: org.springframework.beans.factory.xml
.XmlBeanFactory with defined beans [transactionManager,dataSource,sessionFactory
]
Nov 26, 2003 7:22:14 PM org.springframework.context.support.AbstractApplicationC
ontext refresh
INFO: 3 beans defined in ApplicationContext [org.springframework.context.support
.ClassPathXmlApplicationContext;hashCode=23361497]
Nov 26, 2003 7:22:14 PM org.springframework.context.support.AbstractApplicationC
ontext loadOptions
INFO: No options bean ("contextOptions") found: using default
Nov 26, 2003 7:22:14 PM org.springframework.context.support.AbstractApplicationC
ontext initMessageSource
INFO: No MessageSource found for [org.springframework.context.support.ClassPathX
mlApplicationContext;hashCode=23361497]: using empty StaticMessageSource
Nov 26, 2003 7:22:14 PM org.springframework.context.support.AbstractApplicationC
ontext refreshListeners
INFO: Refreshing listeners
Nov 26, 2003 7:22:14 PM org.springframework.context.support.AbstractApplicationC
ontext preInstantiateSingletons
INFO: Configuring singleton beans in context
Nov 26, 2003 7:22:14 PM org.springframework.beans.factory.support.AbstractBeanFa
ctory getSharedInstance
INFO: Creating shared instance of singleton bean 'transactionManager'
Nov 26, 2003 7:22:14 PM org.springframework.beans.factory.support.AbstractBeanFa
ctory getSharedInstance
INFO: Creating shared instance of singleton bean 'sessionFactory'
Nov 26, 2003 7:22:14 PM org.springframework.beans.factory.support.AbstractBeanFa
ctory getSharedInstance
INFO: Creating shared instance of singleton bean 'dataSource'
Nov 26, 2003 7:22:14 PM org.springframework.jdbc.datasource.DriverManagerDataSou
rce setDriverClassName
INFO: Loaded JDBC driver: org.hsqldb.jdbcDriver
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.3
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.dbcp.ps.m
axIdle=100, hibernate.dbcp.ps.whenExhaustedAction=1, hibernate.dbcp.whenExhauste
dAction=1, hibernate.dbcp.ps.maxWait=120000, hibernate.connection.driver_class=o
rg.hsqldb.jdbcDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.d
ialect=net.sf.hibernate.dialect.HSQLDialect, hibernate.dbcp.maxIdle=10, hibernat
e.dbcp.maxWait=120000, hibernate.dbcp.maxActive=100, hibernate.connection.userna
me=sa, hibernate.connection.url=jdbc:hsqldb:hsql://localhost, hibernate.show_sql
=true, hibernate.connection.password=, hibernate.dbcp.ps.maxActive=100}
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: JVM proxy support: true
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: com/objectorama/CMS/Account.hbm.xml
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.objectorama.CMS.Account -> ACCOUNT
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: com/objectorama/CMS/Address.hbm.xml
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.objectorama.CMS.Address -> ADDRESS
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: com/objectorama/CMS/Contact.hbm.xml
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.objectorama.CMS.Contact -> CONTACT
Nov 26, 2003 7:22:14 PM org.springframework.orm.hibernate.LocalSessionFactoryBea
n afterPropertiesSet
INFO: Building new Hibernate SessionFactory for LocalSessionFactoryBean [org.spr
ingframework.orm.hibernate.LocalSessionFactoryBean@bf7916]
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: com.objectorama.CMS.Account.contacts -> CONTACT
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: com.objectorama.CMS.Account.addresses -> ADDRESS
Nov 26, 2003 7:22:14 PM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.432 sec
[junit] [ERROR] TEST com.objectorama.CMS.AccountTest FAILED
BUILD FAILED
File...... file:/C:/Documents and Settings/rramachandran.CORP/.maven/plugins/mav
en-test-plugin-1.4/
Element... fail
Line...... 130
Column.... 54
There were test failures.
Total time: 6 seconds
Finished at: Wed Nov 26 19:22:15 CST 2003
C:\eclipse_3_0M4\workspace\ContactManagementSystem>
Junit Output
Testsuite: com.objectorama.CMS.AccountTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.432 sec
Testcase: testInsertAccount took 1.412 sec
Caused an ERROR
null
java.lang.ExceptionInInitializerError
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:240)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:203)
at org.springframework.beans.factory.support.AbstractBeanFactory.callLifecycleMethodsIfNecessary(AbstractBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:310)
at org.springframework.beans.factory.support.AbstractBeanFactory.getSharedInstance(AbstractBeanFactory.java:224)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveReference(AbstractBeanFactory.java:448)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveValueIfNecessary(AbstractBeanFactory.java:404)
at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:368)
at org.springframework.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:309)
at org.springframework.beans.factory.support.AbstractBeanFactory.getSharedInstance(AbstractBeanFactory.java:224)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:460)
at org.springframework.context.support.AbstractApplicationContext.preInstantiateSingletons(AbstractApplicationContext.java:332)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:234)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:28)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:33)
at com.objectorama.CMS.AccountTest.setUp(AccountTest.java:19)
at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:448)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:348)
at org.apache.maven.cli.App.doMain(App.java:543)
at org.apache.maven.cli.App.main(App.java:1109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)
Caused by: java.lang.IllegalStateException: No backend found
at net.sf.cglib.CodeGenerator.<init>(CodeGenerator.java:127)
at net.sf.cglib.KeyFactoryGenerator.<init>(KeyFactoryGenerator.java:93)
at net.sf.cglib.KeyFactory.create(KeyFactory.java:114)
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:297)
... 52 more
Testcase: testInsertAccount
|