Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Spring + Hibernate: applicationContext.xml not working  RSS feed

soonphei tin
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am new in Spring as well as Hibernate. I am developing an application base on Spring, Tomcat, Hibernate, and mySQL. I used NetBeans 6.5
Before the configuration is set in applicationContext.xml everything is alright. Once I added the following, Apache Tomcat return "The requested resource () is not available." when I run the project.

The framework I am using: -
1. Spring Web MVC 2.5
2. Hibernate 3.2.5
3. commons-dbcp-1.2.2.jar
4. spring-hibernate3.jar
5. Tomcat 6.0
6. MySQL 5.1


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="WEB-INF/conf/" />

<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
<property name="url"><value>jdbc:mysql://localhost:3306/ifang</value></property>
<property name="username"><value>root</value></property>
<property name="password"><value>adminadmin</value></property>
<property name="initialSize"><value>3</value></property>

<bean id="myHibernateProperties"
<property name="properties">
key="hibernate.query.substitutions">true 'T', false 'F'</prop>
<prop key="">update</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.c3p0.minPoolSize">5</prop>
<prop key="hibernate.c3p0.maxPoolSize">20</prop>
<prop key="hibernate.c3p0.timeout">600</prop>
<prop key="hibernate.c3p0.max_statement">50</prop>
<prop key="hibernate.current_session_context_class">thread</prop>

<bean id="mySessionFactory"
<property name="dataSource">
<ref local="myDataSource" />
<property name="mappingResources">
<property name="hibernateProperties">
<ref bean="myHibernateProperties" />

<bean id="categoryDAO" class="com.ifang.DAO.CategoryDAO">
<property name="sessionFactory" ref="mySessionFactory" />

<!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->


Please, someone help!!!
Mark Spritzler
Posts: 17309
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sp tin"

Please click on the My Profile link above and change your display name to meet the JavaRanch Naming Policy of using your real first and real last names.

Also, when posting code or xml configuration, please use the CODE tags so that the code keeps its formatting and indentation. Right now I can't read your xml. The CODE tags get created when you click the Code button above.

Lastly, I don't understand what you are asking. It says you added something, but you don't tell us what you added. What was working, then what did you change that it is now not working.


Mudit Srivastava
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also it'll help if you could post your stack trace.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!