I am new to MDB
I am using orion1.5 application server
I tried a simple MDB
import javax.ejb.EJBException;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
import javax.jms.JMSException;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import com.sun.corba.se.internal.iiop.Message;
public class MDBExample implements MessageDrivenBean,MessageListener {
private MessageDrivenContext ctx = null;
public MDBExample() { }
public void setMessageDrivenContext(MessageDrivenContext ctx)throws EJBException {
this.ctx = ctx;
}
public void ejbCreate() {}
public void ejbRemove() {ctx=null;}
public void onMessage(javax.jms.Message message) {
try {
if (message instanceof TextMessage)
System.err.println("Text Message arrvied");
}catch (JMSException e) {
System.err.println("Communication Exception: " + e.getMessage());
}
}
}
and did the changes in deployment descriptor as
in <enterprise-bean> tag
<message-driven>
<description>
Test MDB</description>
<ejb-name>MDBExample</ejb-name>
<ejb-class>MDBExample</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
<resource-ref>
<description></description>
<res-ref-name>jms/theTopic</res-ref-name>
<res-type>javax.jms.Topic</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description></description>
<res-ref-name>jms/theTopicConnectionFactory</res-ref-name>
<res-type>javax.jms.TopicConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</message-driven>
and in assembly-descriptor tag
<container-transaction>
<method>
<ejb-name>MDBExample</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
in application.xml
<display-name>Message Driven Bean</display-name>
<module>
<
ejb>MDBPack.jar</ejb>
</module>
I have not written client class yet ,but my server gives me error at start up as
----Unable to link resource MDBExample, no JMS server running ---
Have i done some wrong or yet it is incomplete???When i start Application Server isn't JMS server get started automatically??