• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem regarding Struts+Spring+hibernate

Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Im trying to acheive the following framwork.
For the presentation layer i'm use Struts; for our business layer i'm using Spring; and for the persistence layer i'm using Hibernate.

I'm presently trying on
# Tomcat 5.0.28.
# DB2
# struts-1.2.7

The problem is when im starting my tomcat server,the struts-sonfig.xml and applicationContext.xml are not been able to read by the server,during server startup.
I've manually introduced errors on in the struts-config.xml,but still the server does not give any parser error during starup.
The only obvious reason is that the server is not able to read the struts-config.xml file

Below are my three xml file 1)web.xml 2)struts-config.xml 3)applicationContext.xml
1) Web.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"


<!-- <servlet>
<servlet- class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
</servlet> -->




<!-- Tag Library Descriptors -->







<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"

<struts-config sdsads>
<form-bean name="LoginForm" type="com.she.demo.form.LoginForm"/>

<forward name="success" path="/success.jsp"/>
<forward name="failure" path="/login.jsp" redirect="true"/>

<!-- M E S S A G E R E S O U R C E S -->

<!-- The "contextConfigLocation" property is the location of the Spring beans configuration file -->
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"


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


<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>COM.ibm.db2.jdbc.app.DB2Driverr</value></property>
<property name="url"><value>jdbc b2:AIS520</value></property>
<property name="username"><value>db2srv</value></property>
<!-- Make sure <value> tags are on same line - if they're not,
authentication will fail -->
<property name="password"><value>db2f0rM@n</value></property>

<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<property name="hibernateProperties">
<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">create</prop>

<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>

<bean id="userDAO" class="com.she.demo.service.ServiceDAO">
<property name="sessionFactory"><ref local="sessionFactory"/></property>

<bean id="userManager" class="com.she.demo.service.impl.ServiceManagerImpl">
<property name="userDAO"><ref local="userDAO"/></property>

<bean id="userManager"
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="target"><ref local="userManagerTarget"/></property>
<property name="transactionAttributes">
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>

<!-- Tell the TrasactionProxyFacyoryBean the object on which to act i.e the target-->
<bean id="userManagerTarget"
<property name="userDAO"><ref local="userDAO"/></property>


Please all the wizard out there...provide me with the reason for this concern.

Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't specified where you're putting these files. Also, are you seeing any indication that the context is being loaded? This is the first step before recognising any of the files.
ved gunjan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David for replying...

I'm putting these 3 files under WEB-INF folder of the project.
The context of the project is been loaded by the server.

Is this problem because of the version of different tools that im using.
Tomcat - 5.0.28
Sturts -1.2
Spring -1.2.4
hibernate 2

please suggest...

David O'Meara
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All problems are likely to be in your web.xml then, since you're not seeing any errors. I'd still lokk at the various log files to make sure though. Comparing to a working set I have, mine looks like this:
You have to be odd to be #1 - Seuss. An odd little ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic