'How to connect on widfly domain from web client to jndi app in same domain

I'm having a wildfly domain and I need connect from .war deployed client project to ear inner ejb modulo service deployed too.

This domain have two server groups, one is appWeb projects in 8080 port and second servMod in 10080 port, so.

I have connection from local network with remote lookup to jndi setting.

private static final String JNDI = "ejb:ServicesProj/ServicesP/Locator!com.mycompany.services.LocatorRemote";
Hashtable<String,String> jndiProperties = new Hashtable<>();
jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.wildfly.naming.client.WildFlyInitialContextFactory");
jndiProperties.put(Context.SECURITY_PRINCIPAL, "userconjndi");
jndiProperties.put(Context.SECURITY_CREDENTIALS, "userCon.dev1");
jndiProperties.put(Context.PROVIDER_URL,"http-remoting://devwflypilot.devcomp.dom:10080");
Context ctx = new InitialContext(jndiProperties);
            Object remoto = ctx.lookup(JNDI);

Detail's came when I deployed the .war file in webapp server group to comunicate with the same setting.

I don't sure if in this case is correct that I used "http-remoting" in the provider url and if JNDI prefix "ejb:", to connect in same domain server groups to other port



Solution 1:[1]

I'm giving a response, because maybe someone else pass by same situation.

Actually the problem isn't in jndi configuration, I could comment all code envolved in the connection jndi and error continues, well good hints to me.

The project enviroment has dependencies of struts2 and tiles, the problem was in tiles definition, the project has several tiles.xml files one of then used wron version, I'm setting same version in all files and run.

tiles don't write in console in info level of logging on the server, well I had hint of tiles error by log server setting put in debug level.

I hope that you will solved the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Erikson Rodriguez