Version 2

    I use CXF Local Transport for testing the JAX-RS methods who have code like this:

    javax.naming.Context initialContext = new InitialContext(); 
    TMM tmm
    = (TMM) initialContext.lookup("java:app/cos/TMM");
    result
    = tmm.calculateConnectedPorts(userId, componentInstance, portId);

    Despite the fact that I have a jndi properties file:

    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory 
    java
    .naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    java
    .naming.provider.url=jnp://localhost:1099

    I cannot run my test successfully getting the following error:

     

    javax.naming.CommunicationException: Could not obtain connection to any of these urls: jnp://localhost:1099 and discovery failed with error: javax.naming.CommunicationException

     

    My client test method is via pipe: https://cwiki.apache.org/confluence/display/CXF20DOC/JAXRS+Testing#JAXRSTesting-LocalTransport