This content has been marked as final.
Show 1 reply
-
1. Re: javax.naming.NameNotFoundException
jaysensharma Nov 5, 2015 1:23 PM (in response to prashamsjain)In WildFly you can bind an object / string in the JNDI tree of server as following:
CLI:
/subsystem=naming/binding=java\:\/a\/b\/c/:add(binding-type=simple,value=http://localhost:8080/proj.abc.app/ABCServiceEndpoint?wsdl)
XML version:
<subsystem xmlns="urn:jboss:domain:naming:2.0"> <bindings> <simple name="java:/a/b/c" value="http://localhost:8080/proj.abc.app/ABCServiceEndpoint?wsdl"/> </bindings> <remote-naming/> </subsystem>
Once the name is bound in the JNDI your application code should be able to look it up from the same JVM as following:
InitialContext context = new InitialContext(); String url = (String)context.lookup("java:/a/b/c");