After upgrade vom pax-web7 to 8 the atmosphere runtime no longer uses websockets

7 views
Skip to first unread message

Richard Hierlmeier

unread,
Jan 15, 2026, 11:00:01 AM (10 days ago) Jan 15
to OPS4J
I have to upgrade a Vaadin 8 application from Karaf 4.3 (pax-web 7) to Karaf 4.4.8 (pax-web 8).

The OSGi bundle with the Vaadin application is a WAB.
It has a WebContext-Path defined in the OSGi header.

The VaadinServlet sets up Atmosphere and tries to detect the WebSocket support of the servlet engine. It detects that the servlet engine has JSR356 support and tries to set up Atmosphere with the class org.atmosphere.container.JSR356AsyncSupport.

This is the constructor of JSR356AsyncSupport:

public JSR356AsyncSupport(AtmosphereConfig config, ServletContext ctx) {
    super(config);
    ServerContainer container = (ServerContainer) ctx.getAttribute(ServerContainer.class.getName());
    if (container == null) {
        if (ctx.getServerInfo().contains("WebLogic")) {
            logger.error("{} must use JDK 1.8+ with WebSocket", ctx.getServerInfo());
        }
        throw new IllegalStateException("Unable to configure jsr356 at that stage. ServerContainer is null");
    }
}
It throws this IllegalStateException.

How can I get the ServerContainer into the ServletContext?

Regards,
Richard

Grzegorz Grzybek

unread,
Jan 15, 2026, 11:29:52 AM (10 days ago) Jan 15
to op...@googlegroups.com
Hello

At first glance, it should be "Web-ContextPath", not "WebContext-Path". See https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.war.html#i3077053


I remember ensuring that WebSockets work with Vaadin. But this was quite long time ago...

kind regards
Grzegorz Grzybek

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
You received this message because you are subscribed to the Google Groups "OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ops4j/552fdab1-ecf2-40cc-b2e3-ec74b76acd70n%40googlegroups.com.

Richard Hierlmeier

unread,
Jan 16, 2026, 3:05:05 AM (9 days ago) Jan 16
to OPS4J

Hi Grzegorz,

I can reproduce the error using this sample project: https://github.com/rh-desoftware/vaadin8_karaf_demo.
I assume you took the code for your itest from this repository.
I believe that WebSocket support is not active in your itest because you have only installed vaadin-push.

WebSockets for Vaadin 8 on Karaf 4.4.8 with Pax Web 8.0.33 is not working.

The repo contains an example for war and one for whiteboard. In both solutions the
"java.lang.IllegalStateException: Unable to configure jsr356 at that stage. ServerContainer is null"
occurs.

Regards
   Richard

Grzegorz Grzybek

unread,
Jan 16, 2026, 3:09:22 AM (9 days ago) Jan 16
to op...@googlegroups.com
Hi

BTW - did you install pax-web-jetty-websockets feature?

regards
Grzegorz Grzybek

Richard Hierlmeier

unread,
Jan 16, 2026, 3:31:27 AM (9 days ago) Jan 16
to OPS4J
Here is the issue: https://github.com/ops4j/org.ops4j.pax.web/issues/2135

I added  pax-web-jetty-websockets feature to the whiteboard sample. 
The exception still occurs.

Richard

Reply all
Reply to author
Forward
0 new messages