首页 新闻 赞助 找找看

spring mvc +ibeatis spring的配置文件 大家帮忙看看问题出在哪了 ?

0
悬赏园豆:50 [已关闭问题] 关闭于 2013-09-03 16:00
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:task="http://www.springframework.org/schema/task"
    xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

    <task:annotation-driven />

    <!-- Webservice inteface -->
    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    <jaxws:endpoint id="androidService" implementor="com.ssc.server.webservice.AndroidServiceImpl" address="/androidService" />
    
    <!-- Configuration -->
    <bean class="org.apache.commons.configuration.PropertiesConfiguration" name="propertiesConfiguration" scope="singleton">
        <constructor-arg value="all.properties" />
    </bean>
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="properties">
            <bean class="org.apache.commons.configuration.ConfigurationConverter" factory-method="getProperties">
                <constructor-arg ref="propertiesConfiguration" />
            </bean>
        </property>
    </bean>
    
    <context:component-scan base-package="com.ssc.server.service,com.ssc.server.dao,com.ssc.server.webservice,com.ssc.server.common.BaseSqlMapDao"></context:component-scan>
    
    <bean id="contextApplicationContextProvider" class="com.ssc.server.common.util.spring.ApplicationContextProvider"></bean>
    
    <bean id="dataSourceTarget" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" scope="singleton">
        <property name="driverClass" value="${jdbc.driverClassName}"/>
        <property name="jdbcUrl" value="${jdbc.url}"/>
        <property name="user" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
        <!-- <property name="maxIdleTime" value="${maxIdleTime}"/>
        <property name="maxPoolSize" value="${maxPoolSize}"/>
        <property name="minPoolSize" value="${minPoolSize}"/>
        <property name="initialPoolSize" value="${initialPoolSize}"/>
        <property name="idleConnectionTestPeriod" value="${idleConnectionTestPeriod}"/> -->
    </bean>
    <bean id="dataSourceTargetSqlserverB" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" scope="singleton">
        <property name="driverClass" value="${jdbcSqlserverB.driverClassName}"/>
        <property name="jdbcUrl" value="${jdbcSqlserverB.url}"/>
        <property name="user" value="${jdbcSqlserverB.username}"/>
        <property name="password" value="${jdbcSqlserverB.password}"/>
        <!-- <property name="maxIdleTime" value="${maxIdleTime}"/>
        <property name="maxPoolSize" value="${maxPoolSize}"/>
        <property name="minPoolSize" value="${minPoolSize}"/>
        <property name="initialPoolSize" value="${initialPoolSize}"/>
        <property name="idleConnectionTestPeriod" value="${idleConnectionTestPeriod}"/> -->
    </bean>
    <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy" scope="singleton">
        <constructor-arg>
            <ref bean="dataSourceTarget" />
        </constructor-arg>
        
    </bean>
    <bean id="dataSourceSqlserverB" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy" scope="singleton">
        <constructor-arg>
            <ref bean="dataSourceTargetSqlserverB" />
        </constructor-arg>
        
    </bean>
    <tx:annotation-driven transaction-manager="txManager" />
    <tx:annotation-driven transaction-manager="txManagerSqlserverB" />
    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource" />
    </bean>
    <bean id="txManagerSqlserverB" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSourceSqlserverB" ref="dataSourceSqlserverB" />
    </bean>
      <tx:advice id="txAdvice" transaction-manager="txManager">  
         <tx:attributes>  
             <tx:method name="get*" propagation="SUPPORTS" read-only="true"/> 
             <tx:method name="*" propagation="REQUIRED" />  
         </tx:attributes>  
     </tx:advice>  
        <tx:advice id="txAdviceSqlserverB" transaction-manager="txManagerSqlserverB">  
         <tx:attributes>  
             <tx:method name="get*" propagation="SUPPORTS" read-only="true"/> 
             <tx:method name="*" propagation="REQUIRED" />  
         </tx:attributes>  
     </tx:advice>  
     <aop:config>  
         <aop:pointcut id="interceptorPointCuts"  
             expression="execution(* com.ssc.server.service.*.*(..)) "/>  
                       <!-- or execution(* com.ssc.server.controller.CommentController.add(..))"  -->
         <aop:advisor advice-ref="txAdvice"  
             pointcut-ref="interceptorPointCuts" />    
             <aop:advisor advice-ref="txAdviceSqlserverB"  
             pointcut-ref="interceptorPointCuts" />         
      </aop:config> 
   <!-- MyBatis ORM operation class -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">  
        <property name="dataSource" ref="dataSource" />  
        <property name="configLocation" value="classpath:sql-map-config.xml" />  
    </bean>
      <bean id="sqlServerBSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">  
        <property name="dataSourceSqlserverB" ref="dataSourceSqlserverB" />  
        <property name="configLocation" value="classpath:sql-map-config.xml" />  
    </bean>
    <!-- Spring MyBatis template -->
    <bean id="sqlSessionTemplate " class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg index="0" ref="sqlSessionFactory" />
    </bean>
    <bean id="sqlServerBSessionTemplate " class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg index="0" ref="sqlServerBSessionFactory" />
    </bean>
    <bean id="freemarkerConfiguration" class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean">
        <property name="preferFileSystemAccess" value="false" />
        <property name="freemarkerSettings">
            <props>
                <prop key="template_update_delay">0</prop>
                <prop key="url_escaping_charset">UTF-8</prop>
                <prop key="output_encoding">UTF-8</prop>
                <prop key="defaultEncoding">UTF-8</prop>
                <prop key="number_format">#</prop>
            </props>
        </property>
        <property name="templateLoaderPath" value="/WEB-INF/ftl/" />
        <property name="defaultEncoding" value="UTF-8" />
    </bean>
    
    <bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">        
        <property name="host" value="${mail.host}" />
        <property name="username" value="${mail.username}" />
        <property name="password" value="${mail.password}" />
    </bean>
    
    <!--startup Bean-->  
    <bean id="z"
            class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
            <property name="triggers">
                <list>
                    <ref bean="instantTrigger" />
                    <ref bean="instantJobTrigger" />
                </list>
            </property>
        </bean>   
    <!--work Bean-->  
    <bean id="autoMailService" class="com.ssc.server.service.job.AutoMailServiceImpl"></bean> 
    <bean id="autoJobService" class="com.ssc.server.service.job.AutoJobServiceImpl"></bean>
       
    <!--******** instant mail start********-->
    <!--jobBean -->  
    <bean id="instantEmail"
            class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
            <property name="targetObject">
                <ref bean="autoMailService" />
            </property>
            <property name="targetMethod">
                <value>sendAutoMail</value>
            </property>
        </bean>
    <bean id="instantJob"
            class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
            <property name="targetObject">
                <ref bean="autoJobService" />
            </property>
            <property name="targetMethod">
                <value>performAutoJob</value>
            </property>
        </bean> 
    <!--job interval-->  
    <bean id="instantTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
            <property name="jobDetail">
                <ref bean="instantEmail" />
            </property>
            <property name="cronExpression">
                <value>0 0/1 * * * ?</value>
            </property>
        </bean>
    <bean id="instantJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
            <property name="jobDetail">
                <ref bean="instantJob" />
            </property>
            <property name="cronExpression">
                <value>0 0/5 * * * ?</value>
            </property>
        </bean>
    <!-- ******** instant mail end******** -->

    <!-- ******** 验证码插件******** -->
    <bean id="captchaProducer"
            class="com.google.code.kaptcha.impl.DefaultKaptcha">
            <property name="config">
                    <bean class="com.google.code.kaptcha.util.Config">
                            <constructor-arg type="java.util.Properties">
                                    <props>
                                            <prop key="kaptcha.image.width">100</prop> 
                                            <prop key="kaptcha.image.height">44</prop>
                                            <prop key="kaptcha.textproducer.font.size">28</prop>
                                            <prop key="kaptcha.textproducer.char.length">4</prop>
                                            <prop key="kaptcha.textproducer.char.space">6</prop>
                                            <prop key="kaptcha.textproducer.font.color">red</prop>
                                            <prop key="kaptcha.noise.impl">com.google.code.kaptcha.impl.NoNoise</prop>
                                            <prop key="kaptcha.textproducer.char.string">0123456789</prop>
                                    </props>
                            </constructor-arg>
                    </bean>
            </property>
    </bean>

    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
          <property name="definitions">
        <list>
          <value>/WEB-INF/tiles.xml</value>
        </list>
          </property>
    </bean>    
    
</beans>
问题补充:

主要是上面几个注入 和事物  原本这个文件是没问题的(原本是连接oracle的) 现在我要增加一个连接sqlserver的 所以要在这里配一下 所有带sqlserver的都是我写的  但是总出问题啊 ~~

指间砂的主页 指间砂 | 初学一级 | 园豆:97
提问于:2013-09-03 14:07
< >
分享
所有回答(1)
0

刚刚问过经理 已解决

指间砂 | 园豆:97 (初学一级) | 2013-09-03 16:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册