MmarcoM
Sep 30th, 2004, 01:48 PM
hello all,
i am a newbie with Spring and i am experiencing problems in running jUnit test cases with Spring.
I am using Maven 1.0 to build my application.
structure of directory in my project is
src/java contains all java source
target/ generated by maven, contains all generated classes
test/java
after classes are compiled (and thus placed in target/classes directory), i place in that directory also the hibernate .hbm. files.
applicationContext.xml is placed in the target/classes directory.
when i run my tests, i got following exception( i includefull stack trace):
2004-09-30 18:50:45,359 DEBUG com.myapp.hibernate.HibernatePersistenceManager [
main] - Creating HibernatePM..
[junit] Running com.myapp.hibernate.HibernatePersistenceManagerTes t
2004-09-30 18:50:46,156 INFO org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Loading XML bean definitions from URL [file:/c:/Sw/applic
ationContext.xml]
2004-09-30 18:50:46,156 DEBUG org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Using JAXP implementation [org.apache.xerces.jaxp.Documen
tBuilderFactoryImpl@14b74a7]
2004-09-30 18:50:46,171 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to resolve XML entity with public ID [-//SPRING//DTD
BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
2004-09-30 18:50:46,171 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to locate [spring-beans.dtd] under [/org/springframew
ork/beans/factory/xml/]
2004-09-30 18:50:46,171 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Found beans DTD [http://www.springframework.org/dtd/spring-b
eans.dtd] in classpath
2004-09-30 18:50:46,187 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Loading bean definitions
2004-09-30 18:50:46,203 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default lazy init 'false'
2004-09-30 18:50:46,203 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default dependency check 'none'
2004-09-30 18:50:46,203 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default autowire 'no'
2004-09-30 18:50:46,234 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'sessionFactor
y'
2004-09-30 18:50:46,312 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'transactionMa
nager'
2004-09-30 18:50:46,312 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'persistenceMa
nager'
2004-09-30 18:50:46,312 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Found 3 <bean> elements defining beans
2004-09-30 18:50:46,312 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Bean factory for application context [org.springfra
mework.context.support.FileSystemXmlApplicationCon text;hashCode=6997525]: org.sp
ringframework.beans.factory.support.DefaultListabl eBeanFactory defining beans [s
essionFactory,transactionManager,persistenceManage r]; Root of BeanFactory hierar
chy
2004-09-30 18:50:46,328 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - 3 beans defined in ApplicationContext [org.springfr
amework.context.support.FileSystemXmlApplicationCo ntext;hashCode=6997525]
2004-09-30 18:50:46,328 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No MessageSource found for context [org.springframe
work.context.support.FileSystemXmlApplicationConte xt;hashCode=6997525]: using em
pty default
2004-09-30 18:50:46,343 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No ApplicationEventMulticaster found for context [o
rg.springframework.context.support.FileSystemXmlAp plicationContext;hashCode=6997
525]: using default
2004-09-30 18:50:46,343 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Refreshing listeners
2004-09-30 18:50:46,343 DEBUG org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Found 0 listeners in bean factory
2004-09-30 18:50:46,343 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Pre-instantiating singletons in factory [org.sprin
gframework.beans.factory.support.DefaultListableBe anFactory defining beans [sess
ionFactory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy
]
2004-09-30 18:50:46,343 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating shared instance of singleton bean 'sessio
nFactory'
2004-09-30 18:50:46,343 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating instance of bean 'sessionFactory' with me
rged definition [Root bean with class [org.springframework.orm.hibernate.LocalSe
ssionFactoryBean] defined in URL [file:/c:/Sw/applicationContext.xml]]
2004-09-30 18:50:46,421 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Getting BeanInfo for class [org.springframework.orm.hibernate.Loca
lSessionFactoryBean]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Caching PropertyDescriptors for class [org.springframework.orm.hib
ernate.LocalSessionFactoryBean]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'class' of type [class java.lang.Class]; editor=[nu
ll]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'configLocation' of type [interface org.springframe
work.core.io.Resource]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'configuration' of type [class net.sf.hibernate.cfg
.Configuration]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'dataSource' of type [interface javax.sql.DataSourc
e]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'entityInterceptor' of type [interface net.sf.hiber
nate.Interceptor]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'hibernateProperties' of type [class java.util.Prop
erties]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'jtaTransactionManager' of type [interface javax.tr
ansaction.TransactionManager]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'lobHandler' of type [interface org.springframework
.jdbc.support.lob.LobHandler]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingDirectoryLocations' of type [class [Lorg.sp
ringframework.core.io.Resource;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingJarLocations' of type [class [Lorg.springfr
amework.core.io.Resource;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingLocations' of type [class [Lorg.springframe
work.core.io.Resource;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingResources' of type [class [Ljava.lang.Strin
g;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'namingStrategy' of type [interface net.sf.hibernat
e.cfg.NamingStrategy]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'object' of type [class java.lang.Object]; editor=[
null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'objectType' of type [class java.lang.Class]; edito
r=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'schemaUpdate' of type [boolean]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'singleton' of type [boolean]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Class [org.springframework.orm.hibernate.LocalSessionFact oryBean]
is cache-safe
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setMappingResources(java.la ng.String[])] on object of cla
ss [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setMappingResources(java.lang.Strin g[])] with value [[Ljava.lang.
String;@75b3ee]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setHibernateProperties(java .util.Properties)] on object o
f class [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,468 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setHibernateProperties(java.util.Pr operties)] with value of type
[java.util.Properties]
2004-09-30 18:50:46,468 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Invoking BeanPostProcessors before initialization
of bean 'sessionFactory'
2004-09-30 18:50:46,468 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Calling afterPropertiesSet() on bean with beanName
'sessionFactory'
2004-09-30 18:50:46,500 INFO net.sf.hibernate.cfg.Environment [main] - Hibern
ate 2.1.6
2004-09-30 18:50:46,500 INFO net.sf.hibernate.cfg.Environment [main] - hibern
ate.properties not found
2004-09-30 18:50:46,515 INFO net.sf.hibernate.cfg.Environment [main] - using
CGLIB reflection optimizer
2004-09-30 18:50:46,515 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Destroying singletons in factory {org.springframew
ork.beans.factory.support.DefaultListableBeanFacto ry defining beans [sessionFact
ory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy}
Exception in HibernateEntryTest.setup()
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
h name 'sessionFactory' defined in URL [file:/c:/Sw/applicationContext.xml]: Ini
tialization of bean failed; nested exception is java.io.FileNotFoundException: C
ould not open class path resource [com/myapp/hibernate/HibernateEntry.hmb.xml]
a today date isThu Sep 30 18:50:46 GMT 2004
2004-09-30 18:50:46,531 ERROR com.myapp.hibernate.HibernatePersistenceManager [
main] - INSERTING ENTRY...:TestExpense
2004-09-30 18:50:46,546 ERROR com.myapp.hibernate.HibernatePersistenceManager [
main] - Exception in creating HibernateEntry
java.lang.NullPointerException
Exception in testCreateEntry!
com.myapp.exceptions.PersistenceException: java.lang.NullPointerException
2004-09-30 18:50:46,609 INFO org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Loading XML bean definitions from URL [file:/c:/Sw/applic
ationContext.xml]
2004-09-30 18:50:46,609 DEBUG org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Using JAXP implementation [org.apache.xerces.jaxp.Documen
tBuilderFactoryImpl@1abf87]
2004-09-30 18:50:46,640 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to resolve XML entity with public ID [-//SPRING//DTD
BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
2004-09-30 18:50:46,640 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to locate [spring-beans.dtd] under [/org/springframew
ork/beans/factory/xml/]
2004-09-30 18:50:46,640 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Found beans DTD [http://www.springframework.org/dtd/spring-b
eans.dtd] in classpath
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Loading bean definitions
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default lazy init 'false'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default dependency check 'none'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default autowire 'no'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'sessionFactor
y'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'transactionMa
nager'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'persistenceMa
nager'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Found 3 <bean> elements defining beans
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Bean factory for application context [org.springfra
mework.context.support.FileSystemXmlApplicationCon text;hashCode=2707298]: org.sp
ringframework.beans.factory.support.DefaultListabl eBeanFactory defining beans [s
essionFactory,transactionManager,persistenceManage r]; Root of BeanFactory hierar
chy
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - 3 beans defined in ApplicationContext [org.springfr
amework.context.support.FileSystemXmlApplicationCo ntext;hashCode=2707298]
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No MessageSource found for context [org.springframe
work.context.support.FileSystemXmlApplicationConte xt;hashCode=2707298]: using em
pty default
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No ApplicationEventMulticaster found for context [o
rg.springframework.context.support.FileSystemXmlAp plicationContext;hashCode=2707
298]: using default
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Refreshing listeners
2004-09-30 18:50:46,656 DEBUG org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Found 0 listeners in bean factory
2004-09-30 18:50:46,656 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Pre-instantiating singletons in factory [org.sprin
gframework.beans.factory.support.DefaultListableBe anFactory defining beans [sess
ionFactory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy
]
2004-09-30 18:50:46,656 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating shared instance of singleton bean 'sessio
nFactory'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating instance of bean 'sessionFactory' with me
rged definition [Root bean with class [org.springframework.orm.hibernate.LocalSe
ssionFactoryBean] defined in URL [file:/c:/Sw/applicationContext.xml]]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Using cached introspection results for class [org.springframework.
orm.hibernate.LocalSessionFactoryBean]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setMappingResources(java.la ng.String[])] on object of cla
ss [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setMappingResources(java.lang.Strin g[])] with value [[Ljava.lang.
String;@25b72a]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setHibernateProperties(java .util.Properties)] on object o
f class [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setHibernateProperties(java.util.Pr operties)] with value of type
[java.util.Properties]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Invoking BeanPostProcessors before initialization
of bean 'sessionFactory'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Calling afterPropertiesSet() on bean with beanName
'sessionFactory'
2004-09-30 18:50:46,671 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Destroying singletons in factory {org.springframew
ork.beans.factory.support.DefaultListableBeanFacto ry defining beans [sessionFact
ory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy}
Exception in HibernateEntryTest.setup()
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
h name 'sessionFactory' defined in URL [file:/c:/Sw/applicationContext.xml]: Ini
tialization of bean failed; nested exception is java.io.FileNotFoundException: C
ould not open class path resource [com/myapp/hibernate/HibernateEntry.hmb.xml]
[junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 1.312 sec
[junit] [ERROR] TEST com.myapp.hibernate.HibernatePersistenceManagerTes t FAI
LED
it seems to me that spring cannot locate the com.myapp.hibernate.HibernateEntry.hmb.xml
but it is in target/classes directory....
anyone can help?
thanks in advance and regards
marco
i am a newbie with Spring and i am experiencing problems in running jUnit test cases with Spring.
I am using Maven 1.0 to build my application.
structure of directory in my project is
src/java contains all java source
target/ generated by maven, contains all generated classes
test/java
after classes are compiled (and thus placed in target/classes directory), i place in that directory also the hibernate .hbm. files.
applicationContext.xml is placed in the target/classes directory.
when i run my tests, i got following exception( i includefull stack trace):
2004-09-30 18:50:45,359 DEBUG com.myapp.hibernate.HibernatePersistenceManager [
main] - Creating HibernatePM..
[junit] Running com.myapp.hibernate.HibernatePersistenceManagerTes t
2004-09-30 18:50:46,156 INFO org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Loading XML bean definitions from URL [file:/c:/Sw/applic
ationContext.xml]
2004-09-30 18:50:46,156 DEBUG org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Using JAXP implementation [org.apache.xerces.jaxp.Documen
tBuilderFactoryImpl@14b74a7]
2004-09-30 18:50:46,171 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to resolve XML entity with public ID [-//SPRING//DTD
BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
2004-09-30 18:50:46,171 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to locate [spring-beans.dtd] under [/org/springframew
ork/beans/factory/xml/]
2004-09-30 18:50:46,171 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Found beans DTD [http://www.springframework.org/dtd/spring-b
eans.dtd] in classpath
2004-09-30 18:50:46,187 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Loading bean definitions
2004-09-30 18:50:46,203 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default lazy init 'false'
2004-09-30 18:50:46,203 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default dependency check 'none'
2004-09-30 18:50:46,203 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default autowire 'no'
2004-09-30 18:50:46,234 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'sessionFactor
y'
2004-09-30 18:50:46,312 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'transactionMa
nager'
2004-09-30 18:50:46,312 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'persistenceMa
nager'
2004-09-30 18:50:46,312 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Found 3 <bean> elements defining beans
2004-09-30 18:50:46,312 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Bean factory for application context [org.springfra
mework.context.support.FileSystemXmlApplicationCon text;hashCode=6997525]: org.sp
ringframework.beans.factory.support.DefaultListabl eBeanFactory defining beans [s
essionFactory,transactionManager,persistenceManage r]; Root of BeanFactory hierar
chy
2004-09-30 18:50:46,328 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - 3 beans defined in ApplicationContext [org.springfr
amework.context.support.FileSystemXmlApplicationCo ntext;hashCode=6997525]
2004-09-30 18:50:46,328 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No MessageSource found for context [org.springframe
work.context.support.FileSystemXmlApplicationConte xt;hashCode=6997525]: using em
pty default
2004-09-30 18:50:46,343 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No ApplicationEventMulticaster found for context [o
rg.springframework.context.support.FileSystemXmlAp plicationContext;hashCode=6997
525]: using default
2004-09-30 18:50:46,343 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Refreshing listeners
2004-09-30 18:50:46,343 DEBUG org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Found 0 listeners in bean factory
2004-09-30 18:50:46,343 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Pre-instantiating singletons in factory [org.sprin
gframework.beans.factory.support.DefaultListableBe anFactory defining beans [sess
ionFactory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy
]
2004-09-30 18:50:46,343 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating shared instance of singleton bean 'sessio
nFactory'
2004-09-30 18:50:46,343 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating instance of bean 'sessionFactory' with me
rged definition [Root bean with class [org.springframework.orm.hibernate.LocalSe
ssionFactoryBean] defined in URL [file:/c:/Sw/applicationContext.xml]]
2004-09-30 18:50:46,421 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Getting BeanInfo for class [org.springframework.orm.hibernate.Loca
lSessionFactoryBean]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Caching PropertyDescriptors for class [org.springframework.orm.hib
ernate.LocalSessionFactoryBean]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'class' of type [class java.lang.Class]; editor=[nu
ll]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'configLocation' of type [interface org.springframe
work.core.io.Resource]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'configuration' of type [class net.sf.hibernate.cfg
.Configuration]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'dataSource' of type [interface javax.sql.DataSourc
e]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'entityInterceptor' of type [interface net.sf.hiber
nate.Interceptor]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'hibernateProperties' of type [class java.util.Prop
erties]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'jtaTransactionManager' of type [interface javax.tr
ansaction.TransactionManager]; editor=[null]
2004-09-30 18:50:46,437 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'lobHandler' of type [interface org.springframework
.jdbc.support.lob.LobHandler]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingDirectoryLocations' of type [class [Lorg.sp
ringframework.core.io.Resource;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingJarLocations' of type [class [Lorg.springfr
amework.core.io.Resource;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingLocations' of type [class [Lorg.springframe
work.core.io.Resource;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'mappingResources' of type [class [Ljava.lang.Strin
g;]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'namingStrategy' of type [interface net.sf.hibernat
e.cfg.NamingStrategy]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'object' of type [class java.lang.Object]; editor=[
null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'objectType' of type [class java.lang.Class]; edito
r=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'schemaUpdate' of type [boolean]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Found property 'singleton' of type [boolean]; editor=[null]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Class [org.springframework.orm.hibernate.LocalSessionFact oryBean]
is cache-safe
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setMappingResources(java.la ng.String[])] on object of cla
ss [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setMappingResources(java.lang.Strin g[])] with value [[Ljava.lang.
String;@75b3ee]
2004-09-30 18:50:46,453 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setHibernateProperties(java .util.Properties)] on object o
f class [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,468 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setHibernateProperties(java.util.Pr operties)] with value of type
[java.util.Properties]
2004-09-30 18:50:46,468 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Invoking BeanPostProcessors before initialization
of bean 'sessionFactory'
2004-09-30 18:50:46,468 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Calling afterPropertiesSet() on bean with beanName
'sessionFactory'
2004-09-30 18:50:46,500 INFO net.sf.hibernate.cfg.Environment [main] - Hibern
ate 2.1.6
2004-09-30 18:50:46,500 INFO net.sf.hibernate.cfg.Environment [main] - hibern
ate.properties not found
2004-09-30 18:50:46,515 INFO net.sf.hibernate.cfg.Environment [main] - using
CGLIB reflection optimizer
2004-09-30 18:50:46,515 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Destroying singletons in factory {org.springframew
ork.beans.factory.support.DefaultListableBeanFacto ry defining beans [sessionFact
ory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy}
Exception in HibernateEntryTest.setup()
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
h name 'sessionFactory' defined in URL [file:/c:/Sw/applicationContext.xml]: Ini
tialization of bean failed; nested exception is java.io.FileNotFoundException: C
ould not open class path resource [com/myapp/hibernate/HibernateEntry.hmb.xml]
a today date isThu Sep 30 18:50:46 GMT 2004
2004-09-30 18:50:46,531 ERROR com.myapp.hibernate.HibernatePersistenceManager [
main] - INSERTING ENTRY...:TestExpense
2004-09-30 18:50:46,546 ERROR com.myapp.hibernate.HibernatePersistenceManager [
main] - Exception in creating HibernateEntry
java.lang.NullPointerException
Exception in testCreateEntry!
com.myapp.exceptions.PersistenceException: java.lang.NullPointerException
2004-09-30 18:50:46,609 INFO org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Loading XML bean definitions from URL [file:/c:/Sw/applic
ationContext.xml]
2004-09-30 18:50:46,609 DEBUG org.springframework.beans.factory.xml.XmlBeanDefi
nitionReader [main] - Using JAXP implementation [org.apache.xerces.jaxp.Documen
tBuilderFactoryImpl@1abf87]
2004-09-30 18:50:46,640 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to resolve XML entity with public ID [-//SPRING//DTD
BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
2004-09-30 18:50:46,640 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Trying to locate [spring-beans.dtd] under [/org/springframew
ork/beans/factory/xml/]
2004-09-30 18:50:46,640 DEBUG org.springframework.context.support.ResourceEntit
yResolver [main] - Found beans DTD [http://www.springframework.org/dtd/spring-b
eans.dtd] in classpath
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Loading bean definitions
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default lazy init 'false'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default dependency check 'none'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Default autowire 'no'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'sessionFactor
y'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'transactionMa
nager'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Registering bean definition with id 'persistenceMa
nager'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.xml.DefaultXmlB
eanDefinitionParser [main] - Found 3 <bean> elements defining beans
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Bean factory for application context [org.springfra
mework.context.support.FileSystemXmlApplicationCon text;hashCode=2707298]: org.sp
ringframework.beans.factory.support.DefaultListabl eBeanFactory defining beans [s
essionFactory,transactionManager,persistenceManage r]; Root of BeanFactory hierar
chy
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - 3 beans defined in ApplicationContext [org.springfr
amework.context.support.FileSystemXmlApplicationCo ntext;hashCode=2707298]
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No MessageSource found for context [org.springframe
work.context.support.FileSystemXmlApplicationConte xt;hashCode=2707298]: using em
pty default
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - No ApplicationEventMulticaster found for context [o
rg.springframework.context.support.FileSystemXmlAp plicationContext;hashCode=2707
298]: using default
2004-09-30 18:50:46,656 INFO org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Refreshing listeners
2004-09-30 18:50:46,656 DEBUG org.springframework.context.support.FileSystemXml
ApplicationContext [main] - Found 0 listeners in bean factory
2004-09-30 18:50:46,656 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Pre-instantiating singletons in factory [org.sprin
gframework.beans.factory.support.DefaultListableBe anFactory defining beans [sess
ionFactory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy
]
2004-09-30 18:50:46,656 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating shared instance of singleton bean 'sessio
nFactory'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Creating instance of bean 'sessionFactory' with me
rged definition [Root bean with class [org.springframework.orm.hibernate.LocalSe
ssionFactoryBean] defined in URL [file:/c:/Sw/applicationContext.xml]]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.CachedIntrospectionResu
lts [main] - Using cached introspection results for class [org.springframework.
orm.hibernate.LocalSessionFactoryBean]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setMappingResources(java.la ng.String[])] on object of cla
ss [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setMappingResources(java.lang.Strin g[])] with value [[Ljava.lang.
String;@25b72a]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- About to invoke write method [public void org.springframework.orm.hibernate.L
ocalSessionFactoryBean.setHibernateProperties(java .util.Properties)] on object o
f class [org.springframework.orm.hibernate.LocalSessionFact oryBean]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.BeanWrapperImpl [main]
- Invoked write method [public void org.springframework.orm.hibernate.LocalSess
ionFactoryBean.setHibernateProperties(java.util.Pr operties)] with value of type
[java.util.Properties]
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Invoking BeanPostProcessors before initialization
of bean 'sessionFactory'
2004-09-30 18:50:46,656 DEBUG org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Calling afterPropertiesSet() on bean with beanName
'sessionFactory'
2004-09-30 18:50:46,671 INFO org.springframework.beans.factory.support.Default
ListableBeanFactory [main] - Destroying singletons in factory {org.springframew
ork.beans.factory.support.DefaultListableBeanFacto ry defining beans [sessionFact
ory,transactionManager,persistenceManager]; Root of BeanFactory hierarchy}
Exception in HibernateEntryTest.setup()
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean wit
h name 'sessionFactory' defined in URL [file:/c:/Sw/applicationContext.xml]: Ini
tialization of bean failed; nested exception is java.io.FileNotFoundException: C
ould not open class path resource [com/myapp/hibernate/HibernateEntry.hmb.xml]
[junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 1.312 sec
[junit] [ERROR] TEST com.myapp.hibernate.HibernatePersistenceManagerTes t FAI
LED
it seems to me that spring cannot locate the com.myapp.hibernate.HibernateEntry.hmb.xml
but it is in target/classes directory....
anyone can help?
thanks in advance and regards
marco