Answer the question
In order to leave comments, you need to log in
Creating a Spring project with HIbernate connection?
I'm trying to do a project on the article . An error occurred while deploying to the server, namely:
13:55:23,225 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-5) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/spring/data.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 ServletContext resource [/WEB-INF/spring/data.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException:
class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist<bean id="sessionFactory"<br>
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><br>
<property name="dataSource" ref="dataSource" /><br>
<property name="configLocation"><br>
<value>classpath:hibernate.cfg.xml</value><br>
</property><br>
<value>classpath:hibernate.cfg.xml</value><br>
Answer the question
In order to leave comments, you need to log in
Check inside the WAR - maybe the file really isn't there? Maybe they made a mistake with the path, or with the name
Yes, indeed, hibernate.cfg.xml, as well as classes, did not get into the WAR file. Maybe I'm not reassembling correctly. Or is there something else that needs to be described?
I launch the JBoss server in Eclipse, then right on the project - Export - WAR file and already choose where to send it (deployments JBoss directory).
Before that, I didn’t use Spring, I wrote everything with my hands, everything was a little different there. Entities and beans were collected in a jar, servlets and the entire web in a war file, and then everything in ear and already on the server.
Thank you, now I'm just figuring out how to do it all. Seems like it should be done
right-click on your project then Maven > Update Project
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question