Invocation of init method failed;

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: class test.domain.Customer not found while looking for property: cust_id

让我非常无语的一个错,这句话的意思是:创建transactionManager的时候出错了,因为在setting它的属性sessionFactory的时候出错了。sessionFactory在创建的时候,调用初始化方法出错了,找不到的cust_id在我配置的 class test.domain.Customer.所以去applicationContext.xml中去寻找相应类的配置文件发现如下:

	
		
		

然后在引用路径classpath:test/domain处改为classpath:/test/domain也就是加个“/”就行了。这样错误就没有了,所以以后养成好习惯,加上“/”.

你可能感兴趣的:(ssh)