[jboss-user] [Beginner's Corner] - JMS MDB (Message Driven Bean)
Tuan Nguyen
do-not-reply at jboss.com
Thu Jun 17 11:22:13 EDT 2010
Tuan Nguyen [http://community.jboss.org/people/tnguyen_75] replied to the discussion
"JMS MDB (Message Driven Bean)"
To view the discussion, visit: http://community.jboss.org/message/548536#548536
--------------------------------------------------------------
Thanks for the link. It's very helpful.
However, I ran into a problem when I deploy the MDB ear file to Jboss. I got the following message:
Failed to create Resource SimpleMessageApp.ear - cause: java.lang.RuntimeException:org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** DEPLOYMENTS IN ERROR: Name -> Error vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/ -> org.jboss.deployers.spi.DeploymentException: Could not deploy vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/app-client-ic.jar/ DEPLOYMENTS IN ERROR: Deployment "vfszip:/C:/jboss-5.1.0.GA/server/default/deploy/SimpleMessageApp.ear/" is in error due to the following reason(s): java.lang.RuntimeException: message-destination has no jndi-name/resolved-jndi-name MessageDestinationReferenceMetaData{name=jms/QueueName,type=javax.jms.Queue,link=ejb-jar-ic.jar#PhysicalQueue,ignore-dependecy=false,jndi-name=null,resolvoed-jndi-
Do you have any idea? (i'm not using EJB 3, just regular EJB)
Here's the code of my SimpleMessageBean:
public class SimpleMessageBean implements MessageDrivenBean, MessageListener {
static final Logger logger = Logger.getLogger("SimpleMessageBean");
private transient MessageDrivenContext mdc = null;
private Context context;
public SimpleMessageBean() {
logger.info("In SimpleMessageBean.SimpleMessageBean()");
}
public void setMessageDrivenContext(MessageDrivenContext mdc) {
logger.info("In SimpleMessageBean.setMessageDrivenContext()");
this.mdc = mdc;
}
public void ejbCreate() {
logger.info("In SimpleMessageBean.ejbCreate()");
}
public void onMessage(Message inMessage) {
TextMessage msg = null;
try {
if (inMessage instanceof TextMessage) {
msg = (TextMessage) inMessage;
logger.info("MESSAGE BEAN: Message received: " + msg.getText());
} else {
logger.warning("Message of wrong type: " +
inMessage.getClass().getName());
}
} catch (JMSException e) {
e.printStackTrace();
mdc.setRollbackOnly();
} catch (Throwable te) {
te.printStackTrace();
}
} // onMessage
public void ejbRemove() {
logger.info("In SimpleMessageBean.remove()");
}
} // class
Thanks a bunch!
Tuan
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/548536#548536]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100617/f9451050/attachment-0001.html
More information about the jboss-user
mailing list