Hi Richard,

I cannot give an answer yet as I have no idea yet, but we are currently
running a Vaadin 7 app on Karaf 4.3.1 in my work environment so I would be
very interested to have a look into your issue.

A few questions. Are you using "stock" Karaf 4.3.1 or you forked it and
built your own? Can you please provide a sample Vaadin 8 app (the minimal
possible version) that reproduces the error you get that I can deploy
locally? How do you deploy the app to Karaf? Also if needed please provide
a sample web descriptor file (if you don't use annotations).

Regards,
Vassil

На ср, 28.04.2021 г. в 10:50 ч. Richard Hierlmeier <
[email protected]> написа:

>
> I try to get a simple Vaadin 8 application running on Karaf 4.3.1.
> However it is not working. Vaadin can not load it's bootstrap Javascript
> File. At the very beginning the Vaadin application makes an
> http request to  http://localhost:8181/VAADIN/vaadinBootstrap.js
> Karaf answers with an error code 404 (not found).
>
> The Vaadin OSGI integration registers it's static resources with
> http-whiteboard.
> The http:list shows that the patterns are known:
>
> karaf@root()> http:list
> ID  | Servlet             | Servlet-Name
>  | State       | Alias                                               | Url
>
> ----+---------------------+-------------------------------------------------+-------------+-----------------------------------------------------+------------------------------------------------------
> 176 | CXFNonSpringServlet | cxf-osgi-transport-servlet
>  | Deployed    | /cxf                                                |
> [/cxf/*]
> 238 | ResourceServlet     | txt
>   | Deployed    | /VAADIN/test.txt                                    |
> [/VAADIN/test.txt/*]
> 238 | ResourceServlet     |
> /VAADIN/themes/mytheme/*:/VAADIN/themes/mytheme | Deployed    |
> /VAADIN/themes/mytheme/*                            |
> [/VAADIN/themes/mytheme/*]
> 238 | ResourceServlet     | /VAADIN/themes/valo/*:/VAADIN/themes/valo
>   | Deployed    | /VAADIN/themes/valo/*                               |
> [/VAADIN/themes/valo/*]
> 238 | ResourceServlet     | gz
>  | Deployed    | /VAADIN/vaadinBootstrap.js.gz                       |
> [/VAADIN/vaadinBootstrap.js.gz/*]
> 238 | ResourceServlet     | js
>  | Deployed    | /VAADIN/vaadinBootstrap.js                          |
> [/VAADIN/vaadinBootstrap.js/*]
> 238 | ResourceServlet     | gz
>  | Deployed    | /VAADIN/vaadinPush.debug.js.gz                      |
> [/VAADIN/vaadinPush.debug.js.gz/*]
> 238 | ResourceServlet     | js
>  | Deployed    | /VAADIN/vaadinPush.debug.js                         |
> [/VAADIN/vaadinPush.debug.js/*]
> 238 | ResourceServlet     | gz
>  | Deployed    | /VAADIN/vaadinPush.js.gz                            |
> [/VAADIN/vaadinPush.js.gz/*]
> 238 | ResourceServlet     | js
>  | Deployed    | /VAADIN/vaadinPush.js                               |
> [/VAADIN/vaadinPush.js/*]
> 238 | ResourceServlet     | DefaultWidgetSet
>  | Deployed    | /VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/*    |
> [/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/*]
> 238 | ResourceServlet     | Vaadin7WidgetSet
>  | Deployed    | /VAADIN/widgetsets/com.vaadin.v7.Vaadin7WidgetSet/* |
> [/VAADIN/widgetsets/com.vaadin.v7.Vaadin7WidgetSet/*]
>
> I debugged the http request to  /VAADIN/vaadinBootstrap.js in the
> ResourceServlet from pax-web-jetty and found out that the ResourceServlet
> has the wrong HttpContext.
> It is using the one from CXF and not the from the Vaadin bundle.
>
> karaf@root()>  la -u | grep 176
> 176 | Active   |  40 | 3.4.3                      |
> mvn:org.apache.cxf/cxf-rt-transports-http/3.4.3
>
> When the bundle with ID 176 ( cxf-rt-transports-http) is stopped then the
> resource /VAADIN/vaadinBoostrap.js is still not found, but I do no longer
> reach the breakpoint in the pax-web-jetty ResourceServlet
>
> The OSGI service that should bring the /VAADIN/boostrap.js resource has
> the following properties:
>
> [com.vaadin.osgi.resources.OsgiVaadinResource]
> ----------------------------------------------
>  osgi.http.whiteboard.context.select = (osgi.http.whiteboard.context.name
> =com.vaadin)
>  osgi.http.whiteboard.resource.pattern = /VAADIN/vaadinBootstrap.js
>  osgi.http.whiteboard.resource.prefix = /VAADIN/vaadinBootstrap.js
>  service.bundleid = 237
>  service.id = 251
>  service.scope = singleton
> Provided by :
>  Vaadin Server (237)
>
> The ServletContext with name com.vaadin has the following properties:
>
> [javax.servlet.ServletContext]
> ------------------------------
>  osgi.web.contextname = com.vaadin
>  osgi.web.contextpath = /vaadin-8.12.2
>  osgi.web.symbolicname = com.vaadin.shared
>  osgi.web.version = 8.12.2
>  service.bundleid = 238
>  service.id = 242
>  service.scope = singleton
> Provided by :
>  Vaadin Shared (238)
> Used by:
>  OPS4J Pax Web - Runtime (100)
>
> I have the following http-white-board feature installed:
>
> karaf@root()> feature:list | grep -i white
> pax-web-http-whiteboard           | 7.3.13           |          |
> Uninstalled | standard-4.3.1                    | Pax Web OSGi HTTP
> Whiteboard support
> http-whiteboard                   | 7.3.13           |          |
> Uninstalled | standard-4.3.1                    | Transition feature for
> backward compatibility
> pax-http-whiteboard               | 7.3.13           |          | Started
>     | org.ops4j.pax.web-7.3.13          | Provide HTTP Whiteboard pattern
> support
>
> I tried also the following http requests:
>
> http://localhost:8181/vaadin-8.12.2/VAADIN/vaadinBootstrap.js
> http://localhost:8181/vaadin-8.12.2/vaadinBootstrap.js
> http://localhost:8181/VAADIN/vaadinBootstrap.js
>
> All end up with an 404.
>
> What is wrong in my setup?
>
> Regards
>
>   Richard
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

Reply via email to