• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

MDB(Sorry for the last post .It was by mistake)This i want to ask

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your application server might not support JMS. Check it.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am sure that Orion 2.x does support JMS; but I am not sure with the version 1.3. For me it looks like the Orion application server is not configured to start the JMS server during server startup. Make sure that you have the JMS Server configuration file supplied with hostname, address, JNDI resource name etc.

Also Orion website has an article for configuring SonicMQ. You can use that as the starting point.

Thanks
Shibu
 
mooooooo ..... tiny ad ....
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic