File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception with sending Synchronous messages

 
Sharmistha Sarkar
Ranch Hand
Posts: 49
1
  • 0
  • 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: 9450
49
Eclipse IDE Hibernate Ubuntu
  • 0
  • 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: 49
1
  • 0
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic