Hi, I am working in ejb3.0 and Jboss4.X . I ahve creatde and deployes a stateful session bean in Jboss Server. Below is my client code to access the delpoyed Session Bean:
But I am getting an error :
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(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 org.jboss.tutorial.entity.client.Client.main(Client.java:40)
At my JMX-console I can see the entry like,under Global JNDI Namespace:
First thing is that the jndi.properties file is at my root folder of project. I have put placed that file inside jre/lib ,as its took that properties file from there Could you please suggest me the steps to put the jndi.properties file in the classpath
Move the jndi.properties file to the source folder. For example, if your Java source files are located in "src", move it to "src". If they are located in "src/main/java", move it to "src/main/java". The other option is to place it in a separate resource folder and make that folder a source folder in Eclipse. For example, my properties files are located at "src/main/resources".