Search code examples
javajakarta-eejbosswildfly-9

Error while runing java EE project with Jboss and Wildfly 9.x


I have error while runing my Project it's correctly deployed but i have this error

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)

here is my main Code :

try {
        Context context = new InitialContext();
        UserServicesRemote userservicesremote = (UserServicesRemote) context.lookup("behealthy-ear/behealthy-ejb/UserServices!services.UserServicesRemote");
    } catch (NamingException e) {
        e.printStackTrace();
    }

My canonical adress is true : enter image description here


Solution

  • Suggestion: Perhaps you should add jboss-client.jar into your client environment. ../bin/client/