- This topic has 18 replies, 5 voices, and was last updated 18 years, 9 months ago by smoyer.
-
AuthorPosts
-
Riyad KallaMemberWhen you deploy your application and browse to the deployed location and go into the WEB-INF/lib directory, do you see hibernate3.jar there?
smoyerMemberThank you for your help. You were correct, it wasn’t there. I fixed that and then got a series of similar errors where there were missing jars. I fixed all of them.
I am trying to set up a connection to the database with this code in posapp-servlet.xml:
<bean id=”sessionFactory” class=”org.springframework.orm.hibernate3.LocalSessionFactoryBean”>
<property name=”dataSource”>
<ref bean=”dataSource”/>
</property>
<property name=”mappingResources”>
<list>
<value>User.hbm.xml</value>
</list>
</property>
<property name=”hibernateProperties”>
<props>
<prop key=”hibernate.dialect”>org.hibernate.dialect.MySQLDialect</prop>
</props>
</property>
</bean><bean id=”dataSource” class=”org.springframework.jdbc.datasource.DriverManagerDataSource”>
<property name=”driverClassName”>
<value>com.mysql.jdbc.Driver</value>
</property>
<property name=”url”>
<value>jdbc:mysql://localhost/posdprod</value>
</property>
<property name=”username”><value>root</value></property>
<property name=”password”><value>tacoddog</value></property>
</bean><bean id=”userDao” class=”dataAccess.UserDAO”>
<property name=”sessionFactory” >
<ref bean=”sessionFactory”/>
</property>
</bean><bean id=”userMan” class=”bus.UserManager”>
<property name=”userDao”>
<ref bean=”userDao”/>
</property>
</bean>Now I am getting this error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘posAppController’ defined in ServletContext resource [/WEB-INF/posapp-servlet.xml]: Can’t resolve reference to bean ‘userMan’ while setting property ‘userManager’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userMan’ defined in ServletContext resource [/WEB-INF/posapp-servlet.xml]: Can’t resolve reference to bean ‘userDao’ while setting property ‘userDao’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDao’ defined in ServletContext resource [/WEB-INF/posapp-servlet.xml]: Can’t resolve reference to bean ‘sessionFactory’ while setting property ‘sessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in ServletContext resource [/WEB-INF/posapp-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: null
I’m not sure what I need to do now.
Sue Moyer
Haris PecoMemberSue.
Do you have bean ‘posAppController’ ?
Best
smoyerMemberThe problem was that I was still missing jars. I added all of the hibernate jars to the class path and the application is now running. Thank you for your help.
Sue
-
AuthorPosts