[JBoss-user] [Messaging, JMS & JBossMQ] - Re: JMSExpection: Invalid transaction id.

2005-09-06 Thread jaikiran
Instead of the following, use "Required" as the transaction type

@ejb.transaction 
  | * type="Supports"

Instead, use:

@ejb.transaction 
  | * type="Required"

I think this might work. Try it out

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3893205#3893205

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3893205


---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Messaging, JMS & JBossMQ] - Re: JMSExpection: Invalid transaction id.

2005-09-06 Thread bnadesan
Here is the code snippet

package movie.ejb;

import java.rmi.*;
import javax.ejb.*;
import javax.jms.*;
import javax.naming.*;

/**
 * @ejb.bean
 *  name="MessageController"
 *  extends="javax.ejb.MovieSessionBean"
 *  view-type="remote"
 *  jndi-name="movie.ejb.MessageControllerHome"
 *  description="EJB to handle Message Notification"
 *
 * @ejb.interface
 *  remote-class="movie.ejb.MessageController"
 *  extends="javax.ejb.EJBObject"
 * @ejb.home
 *  remote-class="movie.ejb.MessageControllerHome"
 *  extends="javax.ejb.EJBHome"
 *
 *
 * @ejb.transaction
 *  type="Supports"
 * @ejb.util generate = "physical"
 *
 * @ejb.resource-ref res-ref-name = "jms/QueueConnectionFactory"
 *   res-type = "javax.jms.QueueConnectionFactory"
 *   res-auth = "Container"
 * @jboss.resource-ref res-ref-name = "jms/QueueConnectionFactory"
 * jndi-name = "java:/JmsXA"
 *
 */

public class MessageControllerBean  extends MovieSessionBean{

  private QueueSession qsession;
  private QueueSender qsender;
  private Queue queue;

  /**
   * @ejb.create-method
   */
  public void ejbCreate() throws RemoteException {
try {
  String JMS_FACTORY="java:comp/env/jms/QueueConnectionFactory";
  String QUEUE="queue/testQueue";
  Context namingCtx = new InitialContext();
  QueueConnectionFactory qconFactory =
 (QueueConnectionFactory) namingCtx.lookup(JMS_FACTORY);

  QueueConnection qcon = qconFactory.createQueueConnection();
  qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
  queue = (Queue) namingCtx.lookup(QUEUE);
} catch (Exception e) {
  e.printStackTrace();
  throw new RemoteException(e.getMessage());
}
  }

  /**
   * Send message method.
   *
   * @ejb.interface-method
   */
  public void sendMessage(String message) throws RemoteException {
try {
  TextMessage msg = qsession.createTextMessage();
  msg.setText(message);
  qsender = qsession.createSender(queue);
  qsender.send(msg);
} catch (Exception e) {
  e.printStackTrace();
  throw new RemoteException(e.getMessage());
}
  }
}

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3893195#3893195

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3893195


---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Messaging, JMS & JBossMQ] - Re: JMSExpection: Invalid transaction id.

2005-09-06 Thread jaikiran
Please post the code in which you are sending the message 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3893145#3893145

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3893145


---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user