• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Spring + Hibernate: applicationContext.xml not working

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

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

<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="hibernate.hbm2ddl.auto">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!!!
Posts: 17347
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
also it'll help if you could post your stack trace.
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic