我现在用spring hibernate jotm tomcat 开发,在用到分布式事务管理时,我想问下,spring 对于jotm以及tomcat的版本问题??????????我用spring 2.5+jotm2.2+tomcat6.0启动抛异常:
Cannot find a protocol with name 'jrmp ' in the list of available protocols.
这是怎么回事啊?

解决方案 »

  1.   

    以下是我的配置文件:
    <?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:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <bean id="jotm"
    class="org.springframework.transaction.jta.JotmFactoryBean" />
    <bean id="dataSourceA"
    class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"
    destroy-method="shutdown">
    <property name="dataSource">
    <bean class="org.enhydra.jdbc.standard.StandardXADataSource"
    destroy-method="shutdown">
    <property name="transactionManager">
    <ref local="jotm" />
    </property>
    <property name="driverName">
    <value>oracle.jdbc.driver.OracleDriver</value>
    </property>
    <property name="url">
    <value>
    jdbc:oracle:thin:@192.168.0.28:1521:ebuy
    </value>
    </property>
    </bean>
    </property>
    <property name="user">
    <value>test</value>
    </property>
    <property name="password">
    <value>test</value>
    </property>
    </bean> <bean id="dataSourceB"
    class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"
    destroy-method="shutdown">
    <property name="dataSource">
    <bean class="org.enhydra.jdbc.standard.StandardXADataSource"
    destroy-method="shutdown">
    <property name="transactionManager">
    <ref local="jotm" />
    </property>
    <property name="driverName">
    <value>oracle.jdbc.driver.OracleDriver</value>
    </property>
    <property name="url">
    <value>
    jdbc:oracle:thin:@192.168.0.28:1521:ebuy
    </value>
    </property>
    </bean>
    </property>
    <property name="user">
    <value>test1</value>
    </property>
    <property name="password">
    <value>test1</value>
    </property>
    </bean> <bean id="sessionFactoryA"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
    <ref bean="dataSourceA" />
    </property>
    <property name="hibernateProperties">
    <props>
    <!--  org.hibernate.dialect.Oracle9Dialect -->
    <prop key="hibernate.dialect">
    org.hibernate.dialect.Oracle9Dialect
    </prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.max_fetch_depth">1</prop>
    <prop key="hibernate.jdbc.fetch_size">20</prop>
    <prop key="hibernate.connection.autocommit">false</prop>
    <prop key="hibernate.query.factory_class">
    org.hibernate.hql.ast.ASTQueryTranslatorFactory
    </prop>
    </props>
    </property>
    <property name="mappingDirectoryLocations">
    <list>
    <value>classpath*:com/yappam/model/</value>
    </list>
    </property>
    </bean>
    <bean id="sessionFactoryB"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
    <ref bean="dataSourceB" />
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.Oracle9Dialect
    </prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.max_fetch_depth">1</prop>
    <prop key="hibernate.jdbc.fetch_size">20</prop>
    <prop key="hibernate.connection.autocommit">false</prop>
    <prop key="hibernate.query.factory_class">
    org.hibernate.hql.ast.ASTQueryTranslatorFactory
    </prop>
    </props>
    </property>
    <property name="mappingLocations">
    <list>
    <value>
    classpath*:com/yappam/model/ebuy/*.hbm.xml
    </value>
    </list>
    </property>
    </bean> <bean id="txManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="userTransaction" ref="jotm" />
    </bean> <tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
    <tx:method name="save*" propagation="REQUIRED"
    rollback-for="Exception" />
    <tx:method name="delete*" propagation="REQUIRED"
    rollback-for="Exception" />
    <tx:method name="update*" propagation="REQUIRED"
    rollback-for="Exception" />
    <tx:method name="*" propagation="REQUIRED" read-only="false"
    rollback-for="Exception" />
    </tx:attributes>
    </tx:advice> <aop:config proxy-target-class="true">
    <aop:pointcut id="iPointCuts"
    expression="execution(* com.yappam.action..*(..))" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="iPointCuts" />
    </aop:config></beans>大家帮忙看看配置文件有问题吗?