File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMS HelloWorld

 
Ashwin Sridhar
Ranch Hand
Posts: 272
Flex Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to JMS. i tried to run following program. But it throws Jndi exception. I am sure i am misssiong something on intialising JNDI.



And the Stack Trace is

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at TestMess.main(TestMess.java:20)
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Ashwin,

I think you may have miss to create those ConnectionFactory resource with JNDI name "QueueConnectionFactory" or Queue resource with JNDI name "Queue1" inside the server. Try to create them and try again. this document will help you http://download.oracle.com/docs/cd/E19957-01/816-5904-10/816-5904-10.pdf
 
Ashwin Sridhar
Ranch Hand
Posts: 272
Flex Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi udara,

I have missed that part. could please tell me how to create the connectionFactory resource. Couldn't find that part in the various tutorials
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They can create either with using your servers configuration tools or using your EJB applications configuration files

refer these tutorials :
http://help.sap.com/saphelp_nwmobile71/helpdata/en/46/11ff893ebe14dbe10000000a155369/content.htm
http://download.oracle.com/docs/cd/E13222_01/wls/docs90/jms_admin/deployjms.html

And also if you need to read those messages that sent by your client program you have to create MessageDrivenBean that have connected with that message Queue resource.
 
Ashwin Sridhar
Ranch Hand
Posts: 272
Flex Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I had issues in creating Queue and ConnectionFactories. I solved them and now its working.

How to make Message Driven Bean listen to the queue.

 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:This is a sample MessageDrivenBean and you may be have to make appropriate changes as your configurations. Deploy this into your server after wrap in a enterprise archive file(EAR).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic