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

1 view
Skip to first unread message

Richard Hierlmeier

unread,
11:00 AM (8 hours ago) 11:00 AM
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,
11:29 AM (7 hours ago) 11:29 AM
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.
Reply all
Reply to author
Forward
0 new messages