Correctly shutting down a websocket handler
by Robin Anil
When a client disconnects, I see that onClose is not being fired. The only
way this seems to be firing if client sents a close frame.
Is there any way to detect disconnection and immediately close all the
opened resources.
Robin
Robin Anil | Software Engineer
1 year, 2 months
WildFly 8.2.1 EJB Security and Custom Auth Mechanism.
by Nick Stuart
Hello all, having an issue with a
custom io.undertow.security.api.AuthenticationMechanism implementation and
EJB security on WildFly 8.2 and hoping someone can think of a work around.
Basic problem, user is authenticated via the AuthenticationMechanism, and
the web context sees the user just fine and their roles, but when we get to
the EJB calls the user is seen as 'anonymous'. The mechanism calls:
sc.authenticationComplete(ac, mechanismName, true);
and returns:
AuthenticationMechanismOutcome.AUTHENTICATED;
The resources I'm calling are configured as being protected through the
web.xml and all of that is working as expected.
Another note, I am able to get this to work in WildFly 10.1, but only with
(what I think is) a bit of hack. The following code is required for EJB
Security to work:
sc.authenticationComplete(ac, mechanismName, true);
sc.login(ac.getUsername(), "");
sc.authenticate();
This same code in 8.2 causes an infinite recursion issue. Even working
around that (with another hack) this still doesn't work.
Any ideas would be greatly appreciated. Upgrading is going to be considered
a worst case scenario right now, and would like avoid it right now if at
all possible.
Thanks for the help!
-Nick
7 years
Reverse proxy with https connections
by Steve Hu
I am extending the ReverseProxyServer example to connect down stream
servers that listen to https and got the following error on the proxy
server. After debugging into it, I realized that the ssl is null when
UndertowClient tries to create connection to the downstream server.
I am wondering who is responsible for creating this ssl object. Where the
certificates should be loaded?
Thanks,
Steve
proxy_1 | 17:37:12.430 [XNIO-1 I/O-4] DEBUG io.undertow.request failed -
Failed to connect
proxy_1 | java.io.IOException: UT000065: SSL must be specified to connect
to a https URL
proxy_1 | at
io.undertow.client.http.HttpClientProvider.connect(HttpClientProvider.java:94)
proxy_1 | at
io.undertow.client.UndertowClient.connect(UndertowClient.java:157)
proxy_1 | at
io.undertow.server.handlers.proxy.ProxyConnectionPool.openConnection(ProxyConnectionPool.java:273)
proxy_1 | at
io.undertow.server.handlers.proxy.ProxyConnectionPool.connect(ProxyConnectionPool.java:527)
proxy_1 | at
io.undertow.server.handlers.proxy.LoadBalancingProxyClient.getConnection(LoadBalancingProxyClient.java:301)
proxy_1 | at
io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.run(ProxyHandler.java:292)
proxy_1 | at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:582)
proxy_1 | at org.xnio.nio.WorkerThread.run(WorkerThread.java:466)
7 years, 1 month
Java 9: sun.misc.Cleaner not found
by Hicks, Matt
I just updated to Java 9 and have started getting the following exception:
exampleJVM[ERROR] Oct 09, 2017 11:45:35 AM
io.undertow.server.DirectByteBufferDeallocator <clinit>
exampleJVM[ERROR] ERROR: UT005091: Failed to initialize
DirectByteBufferDeallocator
exampleJVM[ERROR] java.lang.ClassNotFoundException: sun.misc.Cleaner
exampleJVM[ERROR] at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
exampleJVM[ERROR] at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
exampleJVM[ERROR] at
java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
exampleJVM[ERROR] at java.base/java.lang.Class.forName0(Native Method)
exampleJVM[ERROR] at java.base/java.lang.Class.forName(Class.java:292)
exampleJVM[ERROR] at
io.undertow.server.DirectByteBufferDeallocator.<clinit>(DirectByteBufferDeallocator.java:23)
exampleJVM[ERROR] at
io.undertow.server.DefaultByteBufferPool.queueIfUnderMax(DefaultByteBufferPool.java:207)
exampleJVM[ERROR] at
io.undertow.server.DefaultByteBufferPool.freeInternal(DefaultByteBufferPool.java:199)
exampleJVM[ERROR] at
io.undertow.server.DefaultByteBufferPool.access$200(DefaultByteBufferPool.java:41)
exampleJVM[ERROR] at
io.undertow.server.DefaultByteBufferPool$DefaultPooledBuffer.close(DefaultByteBufferPool.java:269)
exampleJVM[ERROR] at
io.undertow.conduits.DeflatingStreamSinkConduit.deflateData(DeflatingStreamSinkConduit.java:495)
exampleJVM[ERROR] at
io.undertow.conduits.DeflatingStreamSinkConduit.write(DeflatingStreamSinkConduit.java:117)
exampleJVM[ERROR] at
io.undertow.conduits.DeflatingStreamSinkConduit.write(DeflatingStreamSinkConduit.java:138)
exampleJVM[ERROR] at
org.xnio.conduits.ConduitStreamSinkChannel.write(ConduitStreamSinkChannel.java:154)
exampleJVM[ERROR] at
io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:187)
exampleJVM[ERROR] at
io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2046)
exampleJVM[ERROR] at
io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:219)
exampleJVM[ERROR] at
io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:310)
exampleJVM[ERROR] at
io.undertow.io.AsyncSenderImpl.send(AsyncSenderImpl.java:282)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation$.handleStandard(UndertowServerImplementation.scala:250)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation$.response(UndertowServerImplementation.scala:169)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation.$anonfun$requestHandler$1(UndertowServerImplementation.scala:100)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation.$anonfun$requestHandler$1$adapted(UndertowServerImplementation.scala:97)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation$.handle$1(UndertowServerImplementation.scala:126)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation$.processRequest(UndertowServerImplementation.scala:162)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation.requestHandler(UndertowServerImplementation.scala:97)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation.$anonfun$handleRequest$1(UndertowServerImplementation.scala:90)
exampleJVM[ERROR] at
io.youi.ErrorSupport.errorSupport(ErrorSupport.scala:11)
exampleJVM[ERROR] at
io.youi.ErrorSupport.errorSupport$(ErrorSupport.scala:10)
exampleJVM[ERROR] at
io.youi.example.ServerExampleApplication$.errorSupport(ServerExampleApplication.scala:8)
exampleJVM[ERROR] at
io.youi.server.UndertowServerImplementation.handleRequest(UndertowServerImplementation.scala:74)
exampleJVM[ERROR] at
io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
exampleJVM[ERROR] at
io.undertow.server.Connectors.executeRootHandler(Connectors.java:332)
exampleJVM[ERROR] at
io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:254)
exampleJVM[ERROR] at
io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
exampleJVM[ERROR] at
io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:151)
exampleJVM[ERROR] at
io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:92)
exampleJVM[ERROR] at
io.undertow.server.protocol.http.HttpOpenListener.handleEvent(HttpOpenListener.java:51)
exampleJVM[ERROR] at
org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
exampleJVM[ERROR] at
org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:291)
exampleJVM[ERROR] at
org.xnio.ChannelListeners$10.handleEvent(ChannelListeners.java:286)
exampleJVM[ERROR] at
org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
exampleJVM[ERROR] at
org.xnio.nio.QueuedNioTcpServer$1.run(QueuedNioTcpServer.java:129)
exampleJVM[ERROR] at
org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:582)
exampleJVM[ERROR] at org.xnio.nio.WorkerThread.run(WorkerThread.java:466)
7 years, 1 month
Expose metrics in Spring Boot environment
by Richard Fuller
Hello,
We have recently moved from Weblogic to Spring Boot and decided to use
Undertow instead of Tomcat. Everything seems to be working great but would
like to be able to see metrics such as threads used in pool, max threads in
pool, current requests, etc. It does not appear these are exposed through
JMX. Is there a way to get metrics such as these?
Thanks in advance,
Wayne
7 years, 1 month