Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ejb remote call issue moving wildfly 18 behind proxy

26 views
Skip to first unread message

Jim Miani

unread,
Jan 9, 2025, 12:36:36 PMJan 9
to WildFly
Hi,

I have a wildfly 18 config that has been working well for http and https remote ejb calls. However I am now trying to move this config behind a proxy server.

Putting the same config behind the proxy causes an org.xnio.http.UpgradeFailedException in the xnio library when trying to perform an EJB lookup from the client (full stack trace below).

Here are my config settings in my test case:

props.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
props.put(Context.PROVIDER_URL, providerurl);
props.put("jboss.naming.client.ejb.context", true);
props.put(Context.SECURITY_PRINCIPAL, CLIENT_EJB_USER_NAME);
props.put(Context.SECURITY_CREDENTIALS, CLIENT_EJB_PWD);
props.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");
props.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", true);
props.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_STARTTLS", true);

I am looking for suggestions on either property config changes or an alternate library to invoke. Any help is appreciated.

Thanks,

Jim

Exception in thread "main" javax.naming.CommunicationException: WFNAM00018: Failed to connect to remote host [Root exception is org.xnio.http.UpgradeFailedException: Invalid response code 200]
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getPeerIdentityForNaming(RemoteNamingProvider.java:110)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getPeerIdentityForNaming(RemoteNamingProvider.java:53)
        at org.wildfly.naming.client.NamingProvider.getPeerIdentityForNamingUsingRetry(NamingProvider.java:105)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getPeerIdentityForNamingUsingRetry(RemoteNamingProvider.java:91)
        at org.wildfly.naming.client.remote.RemoteContext.lambda$lookupNative$0(RemoteContext.java:189)
        at org.wildfly.naming.client.NamingProvider.performExceptionAction(NamingProvider.java:222)
        at org.wildfly.naming.client.remote.RemoteContext.performWithRetry(RemoteContext.java:100)
        at org.wildfly.naming.client.remote.RemoteContext.lookupNative(RemoteContext.java:188)
        at org.wildfly.naming.client.AbstractFederatingContext.lookup(AbstractFederatingContext.java:74)
        at org.wildfly.naming.client.AbstractFederatingContext.lookup(AbstractFederatingContext.java:60)
        at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:144)
        at javax.naming.InitialContext.lookup(InitialContext.java:417)
        at Twf.go(Twf.java:47)
        at Twf.main(Twf.java:25)
Caused by: org.xnio.http.UpgradeFailedException: Invalid response code 200
        at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:471)
        at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:400)
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
        at ...asynchronous invocation...(Unknown Source)
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:599)
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:565)
        at org.jboss.remoting3.ConnectionInfo$None.getConnection(ConnectionInfo.java:82)
        at org.jboss.remoting3.ConnectionInfo.getConnection(ConnectionInfo.java:55)
        at org.jboss.remoting3.EndpointImpl.doGetConnection(EndpointImpl.java:499)
        at org.jboss.remoting3.EndpointImpl.getConnectedIdentity(EndpointImpl.java:445)
        at org.jboss.remoting3.UncloseableEndpoint.getConnectedIdentity(UncloseableEndpoint.java:52)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getFuturePeerIdentityPrivileged(RemoteNamingProvider.java:151)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.lambda$getFuturePeerIdentity$0(RemoteNamingProvider.java:138)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getFuturePeerIdentity(RemoteNamingProvider.java:138)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getPeerIdentity(RemoteNamingProvider.java:126)
        at org.wildfly.naming.client.remote.RemoteNamingProvider.getPeerIdentityForNaming(RemoteNamingProvider.java:106)
        ... 13 more

Teixi

unread,
Jan 11, 2025, 2:37:46 AMJan 11
to WildFly
Isn't this unhelpful ? 'Invalid response code 200', together with quite old WildFly version 17, many things differ now, butI would suggest:

1. Start enabling DEBUG logging level for some categories like:

org.xnio.nio
org.jboss.remoting
org.wildfly.security
org.jboss.ejb.client
io.undertow.session

2.1. WildFly to use Proxy settings to manage connections through a Proxy
https://www.mastertheboss.com/jbossas/jboss-security/ho-to-configure-proxy-settings-in-wildfly/
or
2.2 WildFly server fronted by a reverse Proxy

 3. In case of PKIX exception

4. WildFly Elytron Examples:

HTH
Reply all
Reply to author
Forward
0 new messages