Hi folks,
Hope you are doing great !!!
We are using wildfly 21 and we are facing issue while lookup for ejb through remote client.
Our remote client is launched via launcher which is launching independent java process
Process process = Runtime.getRuntime().exec(commandArgs.toArray(new String[commandArgs.size()]));
all the required jar is getting added in command args i.e. class path of the above process.
With same jar if we are doing lookup without launching process then lookup is successful.
But the same is not working while launching it as java independent process we are getting stackOverflow error i.e.
Caused by: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(URLClassLoader.java:606)
at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:631)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:354)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at org.wildfly.naming.client.WildFlyRootContext.lambda$loadServices$0(WildFlyRootContext.java:97)
at java.security.AccessController.doPrivileged(Native Method)
at org.wildfly.naming.client.WildFlyRootContext.loadServices(WildFlyRootContext.java:93)
at org.wildfly.naming.client.WildFlyRootContext.<init>(WildFlyRootContext.java:89)
at org.wildfly.naming.client.WildFlyRootContext.<init>(WildFlyRootContext.java:79)
at org.wildfly.naming.client.WildFlyInitialContextFactory.getInitialContext(WildFlyInitialContextFactory.java:54)
at org.jboss.ejb.client.naming.ejb.ejbURLContextFactory.getObjectInstance(ejbURLContextFactory.java:43)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:612)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:561)
at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:801)
at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:140)
at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:142)
at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:142)
at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:142)
while digging out more we have found that in WildflyRootContext class The above error is coming due to NamingProviderFactories List and NamingContextFactories is empty. But The same list is not empty in case of normal fixture lookup i.e. without launching independent process.
here is the properties we are using for context initialization :- ( env is HashTable instance)
env.put(Context.PROVIDER_URL, "http://" + "localhost" + ":" + "8080" +"/wildfly-services" );
env.put(Context.INITIAL_CONTEXT_FACTORY, WildFlyInitialContextFactory.class.getName());
env.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
env.put("jnp.disableDiscovery", "true");
env.put(Context.SECURITY_PRINCIPAL,"system");
env.put(Context.SECURITY_CREDENTIALS,"openview");
Note : We have tried with http-remoting( in this case we have changed the provider url as http-remoting://localhost:8080). Along with we have tried various combination as well but it didn't worked out. we want it be worked with pure http protocol.
Have anyone faced this issue or any idea/solution of above issue.
Quick response will be appreciated.
Thanks
Dilip