1 InitialContext initialContext = new InitialContext();
2 EJBHome ejbHome = (EJBHome) initialContext.lookup(jndiLocation);
3 Class ejbHomeClass = ejbHome.getClass();
4 Method createMethod = ejbHomeClass.getMethod("create", new Class[] { });
The exception is thrown from line 2 when the code executes the initial context lookup and stores it in an EJBHome object.
I have seen this issue several times and tried several solutions such as including the j2ee.jar in the classpath and manifest. However, their solutions might not apply to this issue since it occurs on a thread.