Hello,

I'm pretty sure, I've been successfully running a full OSGi Vaadin > 8.6.0 application in karaf 4.2.x.

The thing is, I had a fix provided by Vaadin that even allowed my to define the main UI class as an OSGi service and thus to even use the @Reference service injection in the main UI.

That allowed me to use my OSGi backend services in the UI and to dynamically compose my UI by getting references to "sub-UI" classes that added pages etc to my main UI. That worked really nice and again I'm sure that was > 8.6.0.

I don't know how I can send you an archive of the patched Vaadin bundle (can't use attachments) and I don't have github.

@JB: can I send you the archive?

Mat frëndleche Gréiss, Mit freundlichen Grüßen, Meilleures salutations, Kind regards,
Alex Weirig
Responsable Technique Ville de Luxembourg Service Enseignement Centre Technolink *Tel* +352 4796 - 6127 <tel:+35247966127> *Fax* +352 42 88 81 *Email* [email protected] www.vdl.lu <http://www.vdl.lu> 2, rue Charles de Tornaco L-2623 LUXEMBOURG

//indoors.this.blesses
<https://map.what3words.com/indoors.this.blesses>
//schaufel.besten.kopie
<https://map.what3words.com/schaufel.besten.kopie>
//supposons.levage.venger
<https://map.what3words.com/supposons.levage.venger>
On 30/04/2021 06:38, Jean-Baptiste Onofre wrote:
Hi,

It looks like a regression in Vaadin 8.6.0.

I will try to take a look next week.

Regards
JB

Le 29 avr. 2021 à 22:03, Васил Зорев <[email protected]> a écrit :

Does not seem that it was intentional, newer Vaadin 8 release notes say there were "improvements in OSGi support".

In my tests on Karaf 4.3.2-SNAPSHOT the last working version is 8.5.2, it broke with 8.6.0. Possibly with https://github.com/vaadin/framework/commit/7e89b5e3348be487110bd8a5c60336ff363cf9d6 , although not sure about it. I would suggest to ask on the Vaadin forums as well, just in case.

На чт, 29.04.2021 г. в 14:30 ч. Richard Hierlmeier <[email protected]> написа:

    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 OsgiVaadinResourceservices 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
                <http://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 <http://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 <http://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



















<<attachment: alex_weirig.vcf>>

Reply via email to