javax.naming.NoInitialContextException: Need to specify class name in environment
===

Eclipse Indigo
JBoss as 7
mysql

1. I created an EJB project in the Eclipse- four projects was generated (Client, EJB, ...)
2. I created a Plug-in project in the same workspace
3. In the EJB project there are an entity (EName.java) and an ejb interface (IName.java) and a service-jeb (BName.java)
5. From the client project everything works fine. The following code is OK here:

**context = JNDILookupClass.getInitialContext();
String lookupName = JNDILookupClass.getLookupName(beanClass, beanInterface);**

6. As I wanted to use the entities in the Plug-in project I copied every necessary files and links from the Client project into the Plug-in project
7. In the Plug-in project I run the mentioned code in as **NOT a Plug-in** prgram but a traditional program (public static void main ) just to check if it works. Resolution: It works fine.
8. In the Plug-in project I run the mentioned code inside the Plug-in (for example inside the **Activator.java**

Resolution: I got the following error message:

*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:288)
...*


Can anybody tell me how to fix it?