JBoss+Spring+Oracle+JTA的设置方法

一、配置数据源
    拷贝%JBOSS_HOW%doc/examples/jca/oracle-xa-ds.xml%JBOSS_HOW%server/default/deploy目录下修改其中的设置:
   

   
   
   
   
   

   

   
   
   

   
     
        XADS/SecurityCenter
       
        false
        oracle.jdbc.xa.client.OracleXADataSource
        jdbc:oracle:thin:@172.60.8.15:1522:dcscdb
        dcsc
        dcsc
       
       
       
        org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
       
       

         
         
             Oracle10g
         

     

                   name="jboss.jca:service=OracleXAExceptionFormatter">
        jboss:service=TransactionManager
     

   
二、配置XidFactory
    修改%JBOSS_HOW%server/default/conf/jboss-server.xml中的XidFactory的设定:
          name="jboss:service=XidFactory">
      true
  

三、拷贝JDBC驱动
    将Oracle的JDBC驱动classes12.jar拷入%JBOSS_HOW%server/default/lib中
四、配置Spring
   
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:util="http://www.springframework.org/schema/util"
        xmlns:lang="http://www.springframework.org/schema/lang"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:jee="http://www.springframework.org/schema/jee"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
        http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.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
        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
       
       
       
       
           
           
               
                    messages
                    common-messages
               

           

       

       
                    factory-method="getInstance">
           
               
           

       

       
                    parent="daoBase" />

       
       
           
               
                    classpath:fw.hql.xml
                    classpath:equip.hql.xml
                    classpath:filter.hql.xml
                    classpath:job.hql.xml
                    classpath:kdm.hql.xml
                    classpath:key.hql.xml
                    classpath:license.hql.xml
                    classpath:log.hql.xml
                    classpath:manage.hql.xml
                    classpath:master.hql.xml
                    classpath:theater.hql.xml
                    classpath:theaterstatus.hql.xml
                    classpath:common.hql.xml
                    classpath:sequence.hql.xml
               

           

       

       
       
           
               
                    classpath:system.properties
               

           

       

       
       

       
       
           
           
               
                    ${hibernate.dialect}
                    true
               

           

           
           
               
                    common.xml
                    securityCenter.xml
               

           

       

       
       
       
           
               
               
           

       

       
       
                            expression="execution(* jp.co.ntt.dc.framework.server.action.IActionBase.execute(..))" />
           
       

       
       
           
       

       
       
           
       

       
       
           
               
                   
                       
                   

                   
                       
                   

               

           

       

       
       

       
       

       
       
           
               
           

       

       
       

       
       
           
       

       
       
       
       
           
       

       
       
           
           
       

       
       
       
                            value="http://${server.ip}:${server.port}/${server.module}/${server.service.remoting}" />
           
       

       
       
           
           
       

       
       
           
       

       
       
           
           
           
               
                   
                   
                   
               

           

       

   
五、疑难杂症
    java.lang.IllegalStateException: Either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManagerName' must be specified
是因为运用的lib中jbossall-cient.jar、jta.jar、servlet.jar删除(搞死我了,一天就耗在这里面)。

你可能感兴趣的:(Java,jboss,oracle,spring,bean,class,attributes)