1

I am trying to set up a sample Chat application using Active MQ and Eclipse.

I have followed the documentation at Apache site and getting the following error upon executing the Chat Application

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.list(Unknown Source)

I assume the jndi.properties files is not loading but not sure if that is the root cause

Following question is similar but I don't see the issue getting resolved. How to place a file on classpath in eclipse?

Community
  • 1
  • 1
vignesh787
  • 199
  • 1
  • 7
  • try putting the .properties file in the same folder where your classes are , and let me know if this solves the problem – Satya Dec 29 '12 at 04:09
  • Hi satya. The properties file has been placed at the same location as that of generated classes. The exception still occours.. – vignesh787 Dec 29 '12 at 12:30
  • Can I see your code for JNDI please – Satya Dec 29 '12 at 16:44
  • since the jndi.properties is defined at the classpath, the only java code i have to create the initial context is Context context = new InitialContext(); – vignesh787 Dec 31 '12 at 03:05
  • You are going to have to break down and tell us exactly where you are putting the file in relation to your classes. It needs to be in the root directory of a JAR for example. – user207421 Dec 31 '12 at 22:18

0 Answers0