2012-08-22 3 views
0

spring hibernate와 postgresql의 설정에 관한 여러가지 문제가 있습니다. 나는 한 가지 문제를 해결하려고 노력하는데 다른 문제가 생겼다. 나는 봄 3.1.0 릴리스 버전을 사용하고 초기화되지 BeanFactory에 4.1.4.Final 나는 오류가 발생하고 최대 절전 모드 또는 이미 폐쇄하고 - ApplicationContext를Spring Hibernate PostgreSQL 설정과 관련된 문제

를 통해 콩에 액세스하기 전에 '새로 고침'전화 내 web.xml 파일은

입니다
<web-app id="WebApp_ID" 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"> 
<servlet> 
    <servlet-name>dispatcher</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>dispatcher</servlet-name> 
    <url-pattern>*.htm</url-pattern> 
</servlet-mapping> 
<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>/WEB-INF/dispatcher-servlet.xml</param-value> 
</context-param> 
<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 
</web-app> 

그리고 내 디스패처 - 서블릿은 다음과 같습니다

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" 
xmlns:context="http://www.springframework.org/schema/context" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd 
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> 
<mvc:annotation-driven> </mvc:annotation-driven> 
<context:component-scan base-package="com.max.ade.common.model" /> 
<context:component-scan base-package="com.max.ade.daoImpl" /> 
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> 
    <property name="driverClassName" value="org.postgresql.Driver" /> 
    <property name="url" value="jdbc:postgresql://localhost:5432/TestUserDB" /> 
    <property name="username" value="postgres" /> 
    <property name="password" value="root123" /> 
</bean> 
<bean id="viewResolver" 
    class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
    <property name="prefix"> 
     <value>/WEB-INF/pages/</value> 
    </property> 
    <property name="suffix"> 
     <value>.jsp</value> 
    </property> 
</bean> 
<bean id="sessionFactory" 
    class="org.springframework.orm.hibernate4.annotation.AnnotationSessionFactoryBean"> 

    <property name="dataSource" ref="dataSource" /> 
    <property name="configLocation" value="classpath:hibernate.cfg.xml" /> 
    <!-- Scan packages for annotated entities --> 
    <property name="packagesToScan" value="com.max.ade.common.model" /> 
</bean> 
<!-- Transaction support beans --> 
<bean id="transactionManager" 
    class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 
    <property name="sessionFactory" ref="sessionFactory" /> 
</bean> 
<tx:annotation-driven transaction-manager="transactionManager"></tx:annotation- driven> 
</beans> 

그리고 문제가 해결 후

은, 위의 디스패처-servlet.xml 파일 내 파일 구조입니다. (BeanFactory를 초기화 이미 닫혀 있지 - ApplicationContext를 통해 콩에 액세스하기 전에 '새로 고침'전화) 구성의 일이 최대 절전 모드 3.6.4와 다르게 작동하고 언급 한 문제 옆 4.1.4 최대 절전 있습니까

모든 콘크리트 포인터가 큰 도움이 될 것입니다.

감사합니다.

답변

2
당신이 3를 최대 절전 모드 및 4를 최대 절전 모드 혼합하는 것 같다

,

시도는이

class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 

class="org.springframework.orm.hibernate4.HibernateTransactionManager"> 

감사

로 변경
관련 문제