Announcement Announcement Module
Collapse
No announcement yet.
spring2.5 Integration hibernate3.2 and struts2 problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    http://www.xjcpic.cn/yyyy.jpg
    Last edited by ryman1981; Apr 1st, 2008, 03:44 AM.

  • #2
    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.

    Comment


    • #3
      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

      Comment

      Working...
      X