I have to port a Vaadin 7 applikation to Vaadin 8, so I planned to used the
newest one (8.12.2 or 8.13.0).

I found a workaround for the problem.
When the Vaadin Servlet that hosts the UI has "/VAADIN/*" in the
URL-Patterns, then the Servlet is called when static resource files from
/VAADIN are requested.
You can overwride then in the VaadinServlet the findResourceURL method and
you can search for all OsgiVaadinResource services an ask them for the
resources.

Can it be that Vaadin dropped the OSGI support for Vaadin 8.

Regards

  Richard








Am Mi., 28. Apr. 2021 um 23:39 Uhr schrieb Васил Зорев <
[email protected]>:

> What Vaadin version do you depend on ? I deployed locally the app by Peter
> Lehto - https://github.com/peterl1084/vaadin-karaf and observed
> something kind of strange.
>
> Karaf version is 4.3.2-SNAPSHOT (from 2-3 weeks ago).
>
> On Vaadin version 8.3.0, going to http://localhost:8181/myapp showed the
> expected view. (however vaadin-osgi-integration was 8.13.0 in the pom at
> that time, by mistake..)
>
> I then changed to Vaadin 8.13.0 and got the same error as you did:
> Failed to load resource: the server responded with a status of 404 (Not
> Found)
> http://localhost:8181/vaadin-8.13.0/VAADIN/vaadinBootstrap.js?v=8.13.0
> myapp:21 Uncaught ReferenceError: vaadin is not defined
>     at myapp:21
> vaadin-8.13.0/VAADIN/themes/valo/favicon.ico:1 Failed to load resource:
> the server responded with a status of 404 (Not Found)
> http://localhost:8181/vaadin-8.13.0/VAADIN/themes/valo/favicon.ico
>
> Funny enough, changing back to 8.3.0 got it running again... I leave it
> for now, but will try to figure something out these days.
>
> Regards,
> Vassil
>
> На ср, 28.04.2021 г. в 20:03 ч. Васил Зорев <[email protected]>
> написа:
>
>> 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