Hi, I'm currently trying to figure out how to deploy my first JSP/Spring/Hibernate project and am completely stumped. The way I've organised it is to create a project with my business logic and data access objects, which is put into a jar file (including config files) in my WEB-INF/lib directory. The JSP file then accesses a bean defined in this jar file, which sets up spring and returns a spring bean that accesses the data.
JSP runs, and loads the bean from the jar file. Spring starts initializing, but fails when it tries to create the hibernate SessionFactory. The stack trace of the root cause exception begins:
sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
Relevant parts of my bean configuration are:
<tx:annotation-driven transaction-manager="txManager" />
<bean id="dataSource" [...]>[...]</bean>
<bean id="txManager" autowire="byName"
class="org.springframework.orm.hibernate3.Hibernat eTransactionManager" />
The configuration works fine when I run it as a unit test from within the 'hibernatetest' project.
The files "meridian/experimental/hibernatetest/*.hbm.xml" are located in the jar file, which is the same jar file the spring configuration file is being loaded from, so is clearly accessible. I've also tried putting them in subdirectories from the web application's directory, from the WEB-INF directory and from the WEB-INF/lib directory, so I can only assume the problem isn't that hibernate is looking for them as files rather than on the classpath.
I'd really appreciate it if someone can tell me what I'm doing wrong here.