Skip to main content



      Home
Home » Eclipse Projects » Virgo » Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error?
Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1691880] Fri, 10 April 2015 05:38 Go to next message
Eclipse UserFriend
Hey,

in my application I've defined a websocket ServerEndpoint in compliance with JSR 356. On Virgo Tomcat 3.6.3 it seems, that the ServerEndpoint doesn't get started. When I try to connect to the Websocket I receive a 404 error.
The same example works fine on a standalone Tomcat 7.0.59.

So I'm wondering if there are some special properties to enable JSR 356 support on Virgo Tomcat 3.6.3? (Virgo Tomcat is running on Java 7.)
Does anyone have some experiences with Virgo Tomcat and JSR 356?
Maybe there is a way to list all websocket ServerEndpoints on Virgo Tomcat to check if it is started?

Regards,
Patrick
Re: Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1692237 is a reply to message #1691880] Tue, 14 April 2015 09:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi Patrick,

can you share the websocket example so I can give it a try?

Regards,
florian
Re: Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1692261 is a reply to message #1692237] Tue, 14 April 2015 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Please note that Virgo 3.6.3 is based on Tomcat 7.0.53.
Try to change Gemini Web bundles (all bundles - gemini web + tomcat) with version 2.2.6 [1]. This version 2.2.6 is based on Tomcat 7.0.56.
Also there is one bug [2] that is fixed in Tomcat 7.0.61 and will be available with Gemini Web 2.2.7.

Regards,
Violeta

[1] https://www.eclipse.org/gemini/web/download/
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=463163
Re: Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1692917 is a reply to message #1691880] Mon, 20 April 2015 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your help!

Violeta my problem seems to be exactly the bug you mentioned which will be fixed in Gemini Web 2.2.7! Do you have some information when version 2.2.7 will be released?
Or maybe more important, how i can get a prereleased 2.2.7 version to make sure that 2.2.7 would resolve my problem?
Re: Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1692949 is a reply to message #1692917] Mon, 20 April 2015 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I've already requested an approval for Tomcat 7.0.61.

While we are waiting you can try the workaround.
Do you need to specify the web fragment as ordered? If you can remove ordering then you should be able to use websocket without any issues.

Regards,
Violeta
Re: Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1693194 is a reply to message #1691880] Wed, 22 April 2015 06:49 Go to previous messageGo to next message
Eclipse UserFriend
Thanks again!

I'm not that sure anymore, that I'm facing the same problem. I've created a new Websocket example. It's totally basic. I've attached both, the example with the ServerEndpoint and the client example I used.

As long as the manifest.mf looks like this, it works perfectly fine on Virgo 3.6.3 with Gemini Web bundles 2.2.6
Manifest-Version: 1.0




But I need to specify some OSGi specific manifest headers. As soon as I add an OSGi specific manifest header (e.g. "Bundle-ManifestVersion: 2"), Virgo does not log this line anymore:
"Starting web bundle 'RMWEBSOCKET_SERVER' version '0.0.0' with context path '/RMWEBSOCKET_SERVER'."
When I try to connect to the endpoint with my client after that, it throws a 404 Error.

When I try to set a Web-ContextPath manifest header (e.g. "Web-ContextPath: resman"), Virgo logs the context path line again.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Web-ContextPath: resman


"Starting web bundle 'RMWEBSOCKET_SERVER' version '0.0.0' with context path '/resman'."
But when I try to connect to the endpoint via the new URI ("ws://localhost:8080/resman/resmanep") I also get a 404 Error. So it seems, as soon as OSGi comes into play, Websockets does not work anymore.

Could this be a similar issue like your web fragment issue? Or am I facing a completely different issue?
Re: Virgo Tomcat 3.6.3 - Websocket JSR 356 - 404 error? [message #1693315 is a reply to message #1693194] Thu, 23 April 2015 02:58 Go to previous message
Eclipse UserFriend
Hello,

The problem is the following:
When you do not specify any OSGi headers in the web application MANIFEST.MF file we will treat it as a plain web application and we will transform it to a web application bundle.
When you specify OSGi headers we will not transform the web application bundle as we expect that you know what OSGi headers to provide.
In your case you need to add in addition Import-Package and Bundle-Classpath:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Web-ContextPath: /resman
Bundle-Classpath: WEB-INF/classes
Import-Package: javax.websocket,
 javax.websocket.server


Regards,
Violeta
Previous Topic:Requesting to be started bundle list to virgo
Next Topic:Install bundles located in the provisioning repositories programmatically
Goto Forum:
  


Current Time: Sun Jul 13 23:05:19 EDT 2025

Powered by FUDForum. Page generated in 0.31680 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top