KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > transaction > xa > XAException

javax.transaction.xa
Class XAException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.transaction.xa.XAException
All Implemented Interfaces:
Serializable
See Also:
Top Examples, Source Code

public int errorCode
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_ASYNC
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_DUPID
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_INVAL
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_NOTA
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_OUTSIDE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_PROTO
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1873]XA Trasaction Error
By sujith { dot } thottan { at } gmail { dot } com on 2007/04/19 00:38:45  Rate
I have two server instances..one is running in my local and one is in romote. 
 when i am trying to call remote EJB for storing some information i am getting 
 the folling error ..please help me 
  
  
 - 
 java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAER_PROTO : Routine was invoked i 
 n an inproper context start (  )  failed on resource 'LMConnection Pool': XAER_PROTO : Routine was invoked in an inproper context 
 javax.transaction.xa.XAException:  [ BEA ]  [ SQLServer JDBC Driver ]  [ SQLServer ] xa_start  ( 8040000 )  returns -6 
         at weblogic.jdbcx.sqlserver.SQLServerImplXAResource.executeXaRpc ( Unknown Source )  
         at weblogic.jdbcx.sqlserver.SQLServerImplXAResource.start ( Unknown Source )  
         at weblogic.jdbcx.base.BaseXAResource.start ( Unknown Source )  
         at weblogic.jdbc.jta.DataSource.start ( DataSource.java:629 )  
         at weblogic.transaction.internal.XAServerResourceInfo.start ( XAServerResourceInfo.java:1103 )  
         at weblogic.transaction.internal.XAServerResourceInfo.xaStart ( XAServerResourceInfo.java:1035 )  
         at weblogic.transaction.internal.XAServerResourceInfo.enlist ( XAServerResourceInfo.java:224 )  
         at weblogic.transaction.internal.ServerTransactionImpl.enlistResource ( ServerTransactionImpl.java:461 )  
         at weblogic.jdbc.jta.DataSource.enlist ( DataSource.java:1383 )  
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist ( DataSource.java:1325 )  
         at weblogic.jdbc.jta.DataSource.getConnection ( DataSource.java:396 )  
         at weblogic.jdbc.jta.DataSource.connect ( DataSource.java:354 )  
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection ( RmiDataSource.java:305 )  
         at com.oomc.asu.model.ejb.util.ConnectionManager.getConnection ( ConnectionManager.java:65 )  
         at com.oomc.realm.lm.model.ejb.session.GenericHelper.saveBorrowerMonthlyIncomeInformation ( GenericHelper.java:2052 )  
         at com.oomc.realm.lm.model.ejb.session.GenericHelper.saveFinancialInformation ( GenericHelper.java:2200 )  
         at com.oomc.realm.lm.model.ejb.session.LMCommonBusinessMethodsSessionEJB.saveFinancialInformation ( LMCommonBusinessMethodsSessionEJB. 
 java:457 )  
         at com.oomc.realm.lm.model.ejb.session.LMCommonBusinessMethodsSessionEJB_1si6jk_EOImpl.saveFinancialInformation ( LMCommonBusinessMeth 
 odsSessionEJB_1si6jk_EOImpl.java:3165 )  
         at com.oomc.realm.lm.model.ejb.session.LMCommonBusinessMethodsSessionEJB_1si6jk_EOImpl_WLSkel.invoke ( Unknown Source )  
         at weblogic.rmi.internal.ServerRequest.sendReceive ( ServerRequest.java:166 )  
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke ( ReplicaAwareRemoteRef.java:284 )  
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke ( ReplicaAwareRemoteRef.java:244 )  
         at com.oomc.realm.lm.model.ejb.session.LMCommonBusinessMethodsSessionEJB_1si6jk_EOImpl_813_WLStub.saveFinancialInformation ( Unknown S 
 ource )  
         at sun.reflect.NativeMethodAccessorImpl.invoke0 ( Native Method )  
         at sun.reflect.NativeMethodAccessorImpl.invoke ( NativeMethodAccessorImpl.java:39 )  
         at sun.reflect.DelegatingMethodAccessorImpl.invoke ( DelegatingMethodAccessorImpl.java:25 )  
         at java.lang.reflect.Method.invoke ( Method.java:324 )  
         at com.oomc.waf.util.MethodUtils.invokeMethod ( MethodUtils.java:484 )  
         at com.oomc.waf.delegate.DelegateFactory.processMethodConfig ( DelegateFactory.java:471 )  
         at com.oomc.waf.delegate.DelegateFactory.processServiceConfig ( DelegateFactory.java:358 )  
         at com.oomc.waf.delegate.DelegateFactory.delegate ( DelegateFactory.java:271 )  
         at com.oomc.waf.action.DefaultAction.executeAction ( DefaultAction.java:67 )  
         at com.oomc.realm.lm.view.action.LMDefaultAction.executeAction ( LMDefaultAction.java:176 )  
         at com.oomc.waf.action.GenericAction.execute ( GenericAction.java:153 )  
         at org.apache.struts.action.RequestProcessor.processActionPerform ( RequestProcessor.java:484 )  
         at org.apache.struts.action.RequestProcessor.process ( RequestProcessor.java:274 )  
         at org.apache.struts.action.ActionServlet.process ( ActionServlet.java:1482 )  
         at org.apache.struts.action.ActionServlet.doPost ( ActionServlet.java:525 )  
         at javax.servlet.http.HttpServlet.service ( HttpServlet.java:760 )  
         at javax.servlet.http.HttpServlet.service ( HttpServlet.java:853 )  
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run ( ServletStubImpl.java:996 )  
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs ( AuthenticatedSubject.java:321 )  
         at weblogic.security.service.SecurityManager.runAs ( SecurityManager.java:118 )  
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet ( ServletStubImpl.java:417 )  
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet ( ServletStubImpl.java:315 )  
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run ( WebAppServletContext.java:6452 )  
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs ( AuthenticatedSubject.java:321 )  
         at weblogic.security.service.SecurityManager.runAs ( SecurityManager.java:118 )  
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet ( WebAppServletContext.java:3661 )  
         at weblogic.servlet.internal.ServletRequestImpl.execute ( ServletRequestImpl.java:2630 )  
         at weblogic.kernel.ExecuteThread.execute ( ExecuteThread.java:219 )  
         at weblogic.kernel.ExecuteThread.run ( ExecuteThread.java:178 )  
  
  
         at weblogic.jdbc.jta.DataSource.enlist ( DataSource.java:1388 )  
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist ( DataSource.java:1325 )  
         at weblogic.jdbc.jta.DataSource.getConnection ( DataSource.java:396 )  
         at weblogic.jdbc.jta.DataSource.connect ( DataSource.java:354 )  
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection ( RmiDataSource.java:305 )  
         at com.oomc.asu.model.ejb.util.ConnectionManager.getConnection ( ConnectionManager.java:65 )  
         at com.oomc.realm.lm.model.ejb.session.GenericHelper.saveBorrowerMonthlyIncomeInformation ( GenericHelper.java:2052 )  
         at com.oomc.realm.lm.model.ejb.session.GenericHelper.saveFinancialInformation ( GenericHelper.java:2200 )  
         at com.oomc.realm.lm.model.ejb.session.LMCommonBusinessMethodsSessionEJB.saveFinancialInformation ( LMCommonBusinessMethodsSessionEJB. 
 java:457 )  
         at com.oomc.realm.lm.model.ejb.session.LMCommonBusinessMethodsSessionEJB_1si6jk_EOImpl.saveFinancialInformation ( LMCommonBusinessMeth 
 odsSessionEJB_1si6jk_EOImpl.java:3165 ) 


public static final int XAER_RMERR
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XAER_RMFAIL
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public XAException()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[508]XA Excelon Test
By naomigom { at } datec { dot } co { dot } kr on 2003/11/13 01:16:28  Rate
import com.exln.dxe.Session; 
 import com.exln.dxe.Cache; 
 import com.exln.dxe.XlnProperties; 
 import com.exln.dxe.engine.XlnLocalSessionFactory; 
 import com.exln.dxe.XlnTransaction; 
  
  
 import javax.transaction.xa.XAResource; 
 import javax.transaction.xa.Xid; 
 import javax.transaction.xa.XAException; 
  
  
 import oracle.jdbc.xa.OracleXid; 
 import com.exln.dxe.engine.internal.XlnXid; 
  
  
  
 public class XAExcelonTest  {  
   public static void main ( String args [  ]  )   {  
     Session sess = XlnLocalSessionFactory.getSession (  ) ; 
  
  
     XlnTransaction txn = sess.getTransaction (  ) ; 
       txn.begin ( XlnTransaction.TXN_DISTRIBUTED ) ;       
  
  
     try  {  
       XAResource xaResourceTravel = sess.getXAResource (  ) ; 
       Xid xidTravel = createXid ( 1 ) ; // Oracle Xid 
  
  
       // XlnXid 
       //byte [  ]  l_globalID = new byte [ 64 ] ; 
         //byte [  ]  l_branchID = new byte [ 64 ] ; 
       //Xid xidTravel = new XlnXid ( l_globalID, l_branchID, 1 ) ; 
        
       xaResourceTravel.start ( xidTravel, XAResource.TMNOFLAGS ) ; 
       /**************** Insert/Update Code ******************/ 
  
  
  
       /******************************************************/ 
       xaResourceTravel.end ( xidTravel, XAResource.TMSUCCESS ) ; 
        
       // Prepare the Resource Managers 
       int prepareTravel = xaResourceTravel.prepare ( xidTravel ) ; 
        
       boolean doCommit = true; 
        
       if  ( ! (  ( prepareTravel == XAResource.XA_OK ) || ( prepareTravel==XAResource.XA_RDONLY )  )  )  
         doCommit = false; 
        
       if  ( prepareTravel == XAResource.XA_OK )  
         if  ( doCommit )  
           xaResourceTravel.commit ( xidTravel, false ) ; 
         else 
           xaResourceTravel.rollback ( xidTravel ) ; 
        
       txn.commit (  ) ;           
      }  catch  ( Exception e )   {  
       txn.abort (  ) ; 
       e.printStackTrace (  ) ; 
      }  
    }  
    
    
    
   public static XAResource getXAResource (  )  {  
      
     XlnProperties theProps = new XlnProperties (  ) ;  
       
     theProps.setProperty ( "com.exln.dxe.local.cachesize", "67108864" ) ;  
     theProps.setProperty ( "com.exln.dxe.local.assize", "134217728" ) ;  
     theProps.setProperty ( "com.exln.dxe.local.locking", "locking" ) ;  
       
     Session theSession = XlnLocalSessionFactory.getSession ( theProps ) ;      
     //Session sess = XlnLocalSessionFactory.getSession (  ) ; 
      
     return theSession.getXAResource (  ) ; 
    }  
    
    
   /** 
   * This function returns a Transaction ID for the Transaction. The transaction 
   * ID contains 2 parts, a global Transaction ID which is set to 9 in this 
   * method and a Branch ID that is unique to each branch which is set to the 
   * value passed as parameter. 
   **/
 
   public static Xid createXid ( int p_bID )  throws XAException  {  
     byte [  ]  l_gID = new byte [ 1 ] ; // Global ID 
     l_gID [ 0 ]      =  ( byte )  9; // Set Global Id to 9 
     byte [  ]  l_bID = new byte [ 1 ] ; // Branch ID 
     l_bID [ 0 ]      =  ( byte )  p_bID; // Set branch ID to the parameter passed 
  
  
     byte [  ]  l_globalID = new byte [ 64 ] ; 
     byte [  ]  l_branchID = new byte [ 64 ] ; 
  
  
     // Copy the Global ID and branch ID to a 64 bit string 
     System.arraycopy  ( l_gID, 0, l_globalID, 0, 1 ) ; 
     System.arraycopy  ( l_bID, 0, l_branchID, 0, 1 ) ; 
  
  
     // Call OracleXid (  )  to generate the Xid 
     Xid l_xid = new OracleXid ( 0x1234, l_globalID, l_branchID ) ; 
  
  
     // Return the Transaction ID 
     return l_xid; 
    }    
  } 


public XAException(int errcode)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public XAException(String s)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_HEURCOM
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_HEURHAZ
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_HEURMIX
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_HEURRB
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_NOMIGRATE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBBASE
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBCOMMFAIL
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBDEADLOCK
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBEND
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBINTEGRITY
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBOTHER
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBPROTO
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBROLLBACK
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBTIMEOUT
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RBTRANSIENT
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RDONLY
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int XA_RETRY
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags