Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS HelloWorld

 
Ranch Hand
Posts: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 109
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic