aspose file tools*
The moose likes Java in General and the fly likes Exception with sending Synchronous messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Exception with sending Synchronous messages " Watch "Exception with sending Synchronous messages " New topic
Author

Exception with sending Synchronous messages

Sharmistha Sarkar
Ranch Hand

Joined: Dec 18, 2012
Posts: 44
Hi,

I am trying to send a "Hello " message with Synchronous technique. But getting an exception below,

Exception in thread "main" 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(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at HeadFirstJava.main(HeadFirstJava.java:26)

I downloaded this code from net, here it is,

Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7076
    
  16

Sharmistha Sarkar wrote:I downloaded this code from net, here it is...

Sharmistha,

Please UseCodeTags (←click) and also DontWriteLongLines. I've added them for you this and also broke up that enormous line 30.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
Sharmistha Sarkar
Ranch Hand

Joined: Dec 18, 2012
Posts: 44
Ok thank you Winston. I will try upload code according instruction.
manushree deepak
Greenhorn

Joined: Feb 12, 2009
Posts: 9
Hope this link may help you.
http://www.javablogging.com/simple-guide-to-java-message-service-jms-using-activemq/
 
 
subject: Exception with sending Synchronous messages
 
Similar Threads
JMS Queue taking long time to run
JMS::Websphere6.1::Problem with context lookup the Queue
JNDI setup for MyEclipse and TomCat
Help required for JMS on Jboss server
javax.naming.NoInitialContextException