• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception with sending Synchronous messages

 
Sharmistha Sarkar
Ranch Hand
Posts: 50
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10430
63
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sharmistha Sarkar
Ranch Hand
Posts: 50
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thank you Winston. I will try upload code according instruction.
 
manushree deepak
Greenhorn
Posts: 9
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic