2011-07-27 24 views
6

WebSphere 6にMDBがあります.MessageListenerはTibco EMSキューにリンクされています。 MDBでは、私はWebSphere MQキューに書き込もうとしています。私は次のエラーを取得する:既存の2フェーズ対応リソースで1フェーズ対応リソースをコミットしようとする不正な試み

WMSG0042I: MDB Listener LoanIQ Payments Inbound started successfully for JMSDestination jms/eid/payments 
WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred. 
WTRN0086I: XAException encountered during prepare phase for transaction 00000131...0001. Local resources follow. 
WTRN0089I: [email protected] 3fbe3fbe XAResource: [email protected] enlisted: true mcWrapper.hashCode()1038237154: Vote: commit. 
WTRN0089I: [email protected]:4e2e4e2e LocalTransaction:com.ibm.ejs.jms.JMSManagedSession$JMS [email protected] enlisted:true registeredForSynctruemcWrapper.hashcode()1032076676: Vote: none. 

のQueueConnectionFactoryのインスタンスがcom.ibm.ejs.jms.JMSQueueConnectionFactoryHandleです。これからXAConnectionを入手できますか?する必要がありますか?可能であれば、バニラJMSにとどまっている方がいいです。

MDBの実装はに似ている:エラーを見て

public void onMessage(Message message) { 
    // ^^ incoming message delivered from EMS queue via WAS MessageListener 
    TextMessage textMessage = (TextMessage) message; 
    QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup(factoryName); 
    Queue queue = (Queue) context.lookup(queueName); 
    QueueConnection connection = factory.createQueueConnection(); 
    connection.start(); 
    QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE); 
    QueueSender sender = session.createSender(queue); 
    TextMessage message = session.createTextMessage("some new payload"); 
    sender.send(message); 
    // ^^ outgoing message sent to WebSphere MQ queue 
} 

答えて

7

、あなたは1つのXAリソースを持っていると

WTRN0089I: [email protected] 3fbe3fbe XAResource: [email protected] enlisted: true mcWrapper.hashCode()1038237154: Vote: commit.

WTRN0089I: [email protected]:4e2e4e2e LocalTransaction:com.ibm.ejs.jms.JMSManagedSession$JMS [email protected] enlisted:true registeredForSynctruemcWrapper.hashcode()1032076676: Vote: none.

1 JCAのLocalTransactionは、あなたのように聞こえますConnectionFactoryをXA対応に設定していないか、参照:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/umj_pjcfm.html

( "XAが有効" までスクロール)またはTibcoのEMS接続が可能XAありません。それが後者で、適切なXAドライバがない場合、WAS情報センターのLast-Participantのサポートが必要です。つまり、WASはWMQ XAトランザクションを準備し、TibcoをローカルにコミットしてコミットしますTibcoコミットが成功した場合(またはそうでない場合はロールバック)WMQ。 Tibco接続がXA対応の場合、WASにはWMQの完全なXAサポートが組み込まれているため、操作全体で2フェーズトランザクションを使用しない理由はありません。あなたがこれを行うべきではありません

The QueueConnectionFactory instance is a com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle. Could I get an XAConnection from this? Do I need to? I'd prefer to stay with vanilla JMS if possible.

について

は、単なるJMSに保ちます。スタイルの一般的なポイントとして、ConnectionFactory(QueueConnectionFactoryではなく)にキャストしてから、クロスドメインオブジェクト(Connection、Session、MessageProducer)を使用する方が良いでしょう。

+2

MQはXA対応です。 EMSのドライバーはそうではなかったようです。 [LPSを有効にする](https://www.ibm.com/developerworks/wikis/display/xdcomputegrid/Enabling+last+participant+support)が機能しました。ありがとうございました。 – Synesso

+0

LPSを有効にするリンクがここにあります。 http://www-01.ibm.com/support/docview.wss?uid=swg21244805 – asgs

1

私は同じ問題がありました。キュー、QCF、ACを設定しましたが、メッセージを受け取った後、トランザクションはロールバックされ、DBアップデートも失敗していました。 onMessageメソッドに@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)を追加しました。

@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) 
public void onMessage(Message message) {//Logic } 

誰かを助けることを願っています。私はメッセージを聞くためにMDBと共にWAS 7です。

関連する問題