问题描述
——在Was后台日志,频繁报下述错误,求各位大神分析下,谢谢![14-12-189:52:15:262CST]00000013XARecoveryDatAWTRN0151I:正在准备对XAResource:cells/SHH-HQ-PMS01SCell01/clusters/CmdpmsCluster/resources.xml#J2CResourceAdapter_1331453023382调用XA恢复操作[14-12-189:52:15:286CST]00000037SystemOutO2014-12-1809:52:15,286[ebContainer:7]INFOEntityService----------EntityService-----------load-----------end[14-12-189:52:15:288CST]00000013XARecoveryDatWWTRN0005W:无法重新创建事务参与者的XAResource,并且无法正确完成事务恢复操作。资源是com.ibm.ws.tx.jta.ASWrapper@888c39f。异常堆栈跟踪如下:com.ibm.ws.Transaction.XAResourceNotAvailableException:java.lang.Exception:RA.getXAResources()returnedwrongnumberofXAResources:0atcom.ibm.ws.tx.jta.ASXAResourceFactoryImpl.getXAResource(ASXAResourceFactoryImpl.java:142)atcom.ibm.ws.Transaction.JTA.XARecoveryData.getXARminst(XARecoveryData.java:504)atcom.ibm.ws.Transaction.JTA.XARecoveryData.recover(XARecoveryData.java:652)atcom.ibm.tx.jta.impl.PartnerLogTable.recover(PartnerLogTable.java:431)atcom.ibm.tx.jta.impl.RecoveryManager.resync(RecoveryManager.java:1533)atcom.ibm.tx.jta.impl.RecoveryManager.performResync(RecoveryManager.java:2266)atcom.ibm.ws.tx.jta.RecoveryManager.performResync(RecoveryManager.java:117)atcom.ibm.tx.jta.impl.RecoveryManager.run(RecoveryManager.java:2219)atjava.lang.Thread.run(Thread.java:737)Causedby:java.lang.Exception:RA.getXAResources()returnedwrongnumberofXAResources:0...9more
解决方案
解决方案二:
解决方案三:
WAS经常报一些死锁问题,最近总是出现此类问题,而且每次出现必须重启was才会好点。was后台日志如下:<openjpa-2.1.1-SNAPSHOT-r422266:1141200fatalstoreerror>org.apache.openjpa.persistence.OptimisticLockException:无法获取“null”上的对象锁定。FailedObject:SELECTDISTINCTpdFROMPurchaseDocpd,PurchaseEntranceDocpedWHEREpd.defunctInd=falseANDpd.purchaseLoc.id=736801ANDpd.purchaseEntityId=736901ANDUPPER(pd.purchaseAgreement.purchaseAgreementNo)LIKE'%XY0960000205%'ORDERBYpd.purchaseDocNoDESC[java.lang.String]atorg.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4853)atorg.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4831)atorg.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:593)atorg.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)atorg.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:118)atorg.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:70)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:709)atcom.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.load(WsJpaJDBCStoreManager.java:130)atorg.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:117)atorg.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)atorg.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:3061)atorg.apache.openjpa.kernel.StateManagerImpl.load(StateManagerImpl.java:451)atorg.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:995)atorg.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:907)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1041)atorg.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)atorg.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381)atorg.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.loadEagerJoin(RelationFieldStrategy.java:706)atorg.apache.openjpa.jdbc.meta.FieldMapping.loadEagerJoin(FieldMapping.java:922)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1111)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1067)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:438)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:333)atcom.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.initialize(WsJpaJDBCStoreManager.java:149)atorg.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:112)atorg.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)atorg.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:1027)atorg.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:985)atorg.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:907)atorg.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1041)atorg.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)atorg.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2381)Causedby:org.apache.openjpa.lib.jdbc.ReportingSQLException:因为死锁或超时,所以当前事务已回滚。原因码为"2"。.SQLCODE=-911,SQLSTATE=40001,DRIVER=4.7.85{prepstmnt635040299SELECTt0.ID,t0.CREATED_BY,t0.CREATED_DATETIME,t0.DEFUNCT_IND,t0.UPDATED_BY,t0.UPDATED_DATETIME,t0.ACTUAL_WEIGHT,t0.ADJUSTED_TOTAL_AMOUNT_HAND,t0.ADJUSTED_TOTAL_PRICE_SYS,t0.ADJUSTED_UNIT_PRICE_HAND,t0.ADJUSTED_UNIT_PRICE_SYS,t0.ADJUSTED_WEIGHT_HAND,t0.ADJUSTED_WEIGHT_SYS,t1.ID,t1.CREATED_BY,t1.CREATED_DATETIME,t1.DEFUNCT_IND,t1.UPDATED_BY,t1.UPDATED_DATETIME,t1.BACK_QUANTITY,t1.BACK_EXECUTED_QUANTITY,t1.BILLING_RULE,t1.CURRENCY,t1.ESTIMA_WHO,t1.EXECUTED_QUANTITY,t1.NOTE_TYPE,t1.ORG_ID,t1.OTHER_CLAUSE,t1.PLANNED_BATCH_NO,t1.PLANNED_STORAGE_LOC,t1.PUR_ID,t1.PURCHASE_AGREEMENT_ITEM,t1.QC_RESULT_AFFECTS_BILLING,t1.QUANTITY,t1.RATIO_SAPLING,t1.LAB_COUNT,t1.TAX_CODE,t1.WEIGHT_UNIT,t0.AUDIT_BY,t0.AUDIT_PERSON_NO_ACCEPTING,t0.BASE_PRICE,t0.BILLING_AMOUNT,t0.BILLING_AUDIT_DATE,t0.BILLING_DATE,t0.BILLING_DOC_ITEM_NO,t0.BILLING_DOC_NO,t0.BILLING_RULE,t0.BILLING_UNIT_PRICE,t0.BILLING_WEIGHT,t0.CAR_NO,t0.CHARG_GI,t0.CURRENCY,t0.DOC_CLOSE,t0.DOC_DATE,t0.ESTIMA_WHO,t0.EX_LIB_DATE,t0.EXPORT_STATUS,t0.FEEDBACK_MESS,t0.FIRST_ENTR_IF,t0.ID_ASSOCIA_COUNT,t0.ID_CARD_ASSOCIATED,t0.LAB_COUNT,t0.LAB_RATIO,t0.LGORT_GI,t0.LGORT_GR,t0.MERGED_BILLING_IND,t2.ID,t2.CREATED_BY,t2.CREATED_DATETIME,t2.DEFUNCT_IND,t2.UPDATED_BY,t2.UPDATED_DATETIME,t2.BILLING_RULE,t2.JUMP_GROUP_NO,t2.MATERIAL_DESC,t2.MATERIAL_ID,t2.ORG_ID2,t2.ORG_ID,t2.PURCHASE_FLOW,t2.PUR_ID,t2.PURCHASE_SEASON_START_DATE,t2.RATIO_OF_SAMPLINGS,t2.REQUIRED_LAB_COUNT,t2.UNIT,t0.NOTE_TYPE,t0.NOTICE_DOC_NO,t3.ID,t3.VERSION,t3.CREATED_BY,t3.CREATED_DATETIME,t3.DEFUNCT_IND,t3.UPDATED_BY,t3.UPDATED_DATETIME,t4.ID,t4.CREATED_BY,t4.CREATED_DATETIME,t4.DEFUNCT_IND,t4.UPDATED_BY,t4.UPDATED_DATETIME,t4.BACK_QUANTITY,t4.BACK_EXECUTED_QUANTITY,t4.BILLING_RULE,t4.CURRENCY,t4.ESTIMA_WHO,t4.EXECUTED_QUANTITY,t4.NOTE_TYPE,t4.ORG_ID,t4.OTHER_CLAUSE,t4.PLANNED_BATCH_NO,t4.PLANNED_STORAGE_LOC,t4.PUR_ID,t4.PURCHASE_AGREEMENT_ITEM,t4.QC_RESULT_AFFECTS_BILLING,t4.QUANTITY,t4.RATIO_SAPLING,t4.LAB_COUNT,t4.TAX_CODE,t4.WEIGHT_UNIT,t3.AGREEMENT_TYPE,t3.AUDIT_BY,t3.AUDIT_FAIL_REASON,t3.AUDIT_IND,t3.BASE_PRICE,t3.BASELINE_UNIT,t3.CREATE_TYPE,t3.CURRENCY,t3.DOC_DATE,t3.EFFECTIVE_END_DATE,t3.EFFECTIVE_START_DATE,t3.NOTICE_DOC_DESC,t3.NOTICE_DOC_NO,t3.NOTICE_DOC_TYPE,t3.OPERATOR,t5.ID,t5.CREATED_BY,t5.CREATED_DATETIME,t5.DEFUNCT_IND,t5.UPDATED_BY,t5.UPDATED_DATETIME,t5.BILLING_RULE,t5.JUMP_GROUP_NO,t5.MATERIAL_DESC,t5.MATERIAL_ID,t5.ORG_ID2,t5.ORG_ID,t5.PURCHASE_FLOW,t5.PUR_ID,t5.PURCHASE_SEASON_START_DATE,t5.RATIO_OF_SAMPLINGS,t5.REQUIRED_LAB_COUNT,t5.UNIT,t3.ORIGINAL_NOTICE_DOC_NO,t3.PURCHASE_ENTITY_ID,t3.RE_AUDIT_REASON,t3.REMARKS,t6.ID,t6.CREATED_BY,t6.CREATED_DATETIME,t6.DEFUNCT_IND,t6.UPDATED_BY,t6.UPDATED_DATETIME,t6.BILLING_RULE,t6.JUMP_GROUP_NO,t6.MATERIAL_DESC,t6.MATERIAL_ID,t6.ORG_ID2,t6.ORG_ID,t6.PURCHASE_FLOW,t6.PUR_ID,t6.PURCHASE_SEASON_START_DATE,t6.RATIO_OF_SAMPLINGS,t6.REQUIRED_LAB_COUNT,t6.UNIT,t0.OPERATOR,t7.ID,t7.CREATED_BY,t7.CREATED_DATETIME,t7.DEFUNCT_IND,t7.UPDATED_BY,t7.UPDATED_DATETIME,t7.BILLING_RULE,t7.JUMP_GROUP_NO,t7.MATERIAL_DESC,t7.MATERIAL_ID,t7.ORG_ID2,t7.ORG_ID,t7.PURCHASE_FLOW,t7.PUR_ID,t7.PURCHASE_SEASON_START_DATE,t7.RATIO_OF_SAMPLINGS,t7.REQUIRED_LAB_COUNT,t7.UNIT,t0.ORIGIN,t0.OTHER_CLAUSE,t0.PLANNED_WEIGHT,t0.PRICING_DATE,t0.PURCHASE_AGREE_ITEM_NO,t0.PURCHASE_AGREE_NO,t8.ID,t8.VERSION,t8.CREATED_BY,t8.CREATED_DATETIME,t8.DEFUNCT_IND,t8.UPDATED_BY,t8.UPDATED_DATETIME,t8.AGREEMENT_PURCHASE_IND,t8.AUDIT_STATUS,t8.BILLING_STATUS,t8.CREATE_WAY,t8.DOC_CLOSE,t8.DOC_CREATE_TYPE,t8.DOC_DATE,t8.DOC_TYPE,t8.ENTR_DOC_ID,t8.EXPORT_STATUS,t8.NEED_TO_EXPORT,t8.NOTE_TYPE,t9.ID,t9.CREATED_BY,t9.CREATED_DATETIME,t9.DEFUNCT_IND,t9.UPDATED_BY,t9.UPDATED_DATETIME,t9.AGREEMENT_END_DATE,t9.AGREEMENT_START_DATE,t9.AGREEMENT_TYPE,t9.ARG_CONTRACT_NO,t9.AUDIT_BY,t9.DOC_DATE,t9.EFFECTIVE_IND,t9.MERGED_BILLING_IND,t9.NOTE_TYPE,t9.OPERATOR,t9.PURCHASE_AGREEMENT_NO,t9.PURE_ID,t9.PUR_ID,t9.REFUESD_REASON,t9.STATISTICS_GROUP_ID,t9.STATUS,t9.TOLERANCE,t9.VENDOR_ACCOUNT,t9.VENDOR_ADD_REMARKS,t9.VENDOR_NAME,t8.PURCHASE_DOC_NO,t8.PURCHASE_ENTITY_ID,t10.ID,t10.VERSION,t10.CREATED_BY,t10.CREATED_DATETIME,t10.DEFUNCT_IND,t10.UPDATED_BY,t10.UPDATED_DATETIME,t10.ADDRESS,t10.AGREEMENT_NO_COUNT,t10.BILLING_DOCUMENT_COUNT,t10.COMPANY_NO,t10.CONTACT_PERSON,t10.COORDINATE_PHONE,t10.DEFULT_TAX_CODE,t10.ENTR_ITEM_ENABLED,t10.ENTRANCE_DOCUMENT_COUNT,t10.EXCEPTION_DOCUMENT_COUNT,t10.FACTORY_NO,t10.IC_CARD_ENABLED,t10.NOTICE_DOCUMENT_COUNT,t10.PURCHASE_DOCUMENT_COUNT,t10.PURCHASE_GROUP,t10.PURCHASE_LOCATION_NAME,t10.PURCHASE_LOCATION_NO,t10.PURCHASE_ORG,t10.QC_DOCUMENT_COUNT,t10.RECEIPT_PLAN_ENABLED,t10.TELEPHONE_NO,t10.WEIGHT_BRIDGE_COUNT,t8.STATISTICS_GROUP_ID,t11.ID,t11.CREATED_BY,t11.CREATED_DATETIME,t11.DEFUNCT_IND,t11.UPDATED_BY,t11.UPDATED_DATETIME,t11.EFFECTIVE_IND,t11.ORIGINAL_SYSTEM,t11.ORIGINAL_VENDOR_NO,t11.REG_CITY,t11.REG_COUNTRY,t11.REG_PROVINCE,t11.REG_STREET_ADDRESS,t11.TAXPAYER_NO,t11.VENDOR_ACCOUNT,t11.VENDOR_NAME,t11.VENDOR_TYPE,t0.PURCHASE_DOC_ITEM,t0.PURCHASE_DOC_ITEM_NO,t0.QC_RESULT_AFFECTS_BILLING,t0.REASON_FOR_ACCEPTING,t0.SAP_DOC_NO,t0.SAP_FAILT_REASON,t0.SKIN_WEIGHT,t0.STATUS,t0.TALLY_BOOK_DATE,t0.TAX_CODE,t0.TOLERANCE,t0.TRANS_EXPORT_STATUS,t0.WEIGHT_BRIDGE_WEIGHT,t0.WEIGHT_UNITFROMDB2IPMS.PURCHASE_DOC_ITEMt0LEFTOUTERJOINDB2IPMS.AGREEMENT_ITEMt1ONt0.AGR_ID=t1.IDLEFTOUTERJOINDB2IPMS.ORG_MATERIALt2ONt0.REAL_ORG_ID=t2.IDLEFTOUTERJOINDB2IPMS.NOTICE_DOCt3ONt0.NOT_ID=t3.IDLEFTOUTERJOINDB2IPMS.ORG_MATERIALt6ONt0.OLD_ORG_ID=t6.IDLEFTOUTERJOINDB2IPMS.ORG_MATERIALt7ONt0.ORG_ID=t7.IDLEFTOUTERJOINDB2IPMS.PURCHASE_DOCt8ONt0.PUR_ID=t8.IDLEFTOUTERJOINDB2IPMS.AGREEMENT_ITEMt4ONt3.AGR_ID=t4.IDLEFTOUTERJOINDB2IPMS.ORG_MATERIALt5ONt3.ORG_ID=t5.IDLEFTOUTERJOINDB2IPMS.PURCHASE_AGREEMENTt9ONt8.PUR_ID2=t9.IDLEFTOUTERJOINDB2IPMS.PURCHASE_LOCt10ONt8.PUR_ID=t10.IDLEFTOUTERJOINDB2IPMS.VENDORt11ONt8.VEN_ID=t11.IDWHEREt0.BIL_ID=?[params=?]}[code=-911,state=40001]atorg.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:281)atorg.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:265)atorg.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:72)