Results 1 to 3 of 3

Thread: spring2.5 Integration hibernate3.2 and struts2 problem

  1. #1
    Join Date
    Mar 2008
    Posts
    5

    Default spring2.5 Integration hibernate3.2 and struts2 problem

    Hello,I have a problem about integrate Hibernate3.2,Spring2.5 and Struts2.0 .
    when i integrate them, my tomcat5.5 can not start my application.
    Can you help me ?Thanks a lot!


    This is my web.xml
    <code>
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatch er</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    </web-app>
    </code>
    and this is my applicationContext.xml .
    My User.hbm.xml is in the directory of web-inf/classes/com/cpic/xj/user/
    <code>
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans default-autowire="byName">
    <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource"
    destroy-method="close">
    <property name="driverClassName">
    <value>com.mysql.jdbc.Driver</value>
    </property>
    <property name="url">
    <value>jdbc:mysql://localhost:3306/dev;SHUTDOWN=true
    </value>
    </property>
    <property name="username" value="root" />
    <property name="password" value="nihao123" />
    </bean>

    <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="myDataSource" />
    <property name="mappingResources">
    <list>
    <value>com/cpic/xj/user/User.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.connection.pool_size">0</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.dialect">org.hibernate.dialect.MySQ LDialect</prop>
    </props>
    </property>
    </bean>
    </beans>
    </code>
    this is my User.hbm.xml
    <code>
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

    <hibernate-mapping package="com.cpic.xj.user" >
    <class name="User" table="oc_user">
    <id name="id" column="id" type="long">
    <generator class="native" />
    </id>
    <property name="userId" column="userid" type="string" unique="true" />
    <property name="passWord" column="pwd" type="string" not-null="true" length="12" />
    <property name="userName" column="username" type="string" not-null="true" />
    <property name="email" column="email" type="string" />
    <property name="address" column="address" type="string" not-null="true" />
    <property name="phone" column="phone" type="string" not-null="true" />
    <property name="cell" column="cell" type="string" />
    <property name="zipcode" column="zipcode" type="string" />
    </class>
    </hibernate-mapping>
    </code>
    this is my lib list
    Last edited by ryman1981; Apr 1st, 2008 at 02:44 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    When posting code please use [ code][/code ] tags.

    Next to that there is no real problem description/stacktrace. Without it is hard to pin point your problem.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    Please note that this forum category is for the "Spring Integration" project. Please ask these question in the web or data-access categories.

    Thanks,
    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •