Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within EJB and other Jakarta /Java EE Technologies
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
EJB and other Jakarta /Java EE Technologies
which jar files need to run normal JMS application
Samanthi perera
Ranch Hand
Posts: 510
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thsi is my class
package coreservlets; import javax.ejb.*; import javax.jms.*; @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="queue/SimpleMessageQ") }) public class SimpleMessageBean implements MessageListener { public void onMessage(Message msg) { TextMessage txtMsg = (TextMessage)msg; try { String message = txtMsg.getText(); System.out.printf("Received message: %s", message); } catch (JMSException e) { e.printStackTrace(); } } }
this is my client
package coreservlets; import javax.jms.*; import javax.naming.*; public class SimpleMessageClient { public static void main(String[] args) throws Exception { InitialContext context = new InitialContext(); ConnectionFactory cf = (ConnectionFactory)context.lookup("/ConnectionFactory"); Queue queue = (Queue)context.lookup("queue/SimpleMessageQ"); Connection connection = cf.createConnection(); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer sender = session.createProducer(queue); for(int i=1; i<=10; i++) { String messageText = String.format("This is message number %s.", i); TextMessage message = session.createTextMessage(messageText); sender.send(message); } } }
which jar files need to run this application?
i have so many errors?
Bhagat Singh Rawat
Ranch Hand
Posts: 93
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Download jar file from this link
Java EE Jar
Brainbench Java 2.0 Fundamentals, J2EE 1.4
http://www.brainbench.com/transcript.jsp?pid=8192792
No thanks. We have all the government we need. This tiny ad would like you to leave now:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
client or consumer register listner?
annotations for JNDI lookup
Jboss Remote Connection JMS
MDB onMessage not invoked
How to receive message after sending from client side ?
Enterprise Java integration with Delphi and Free Pascal applications - new release 2019.02
More...