Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSGi] - Cleanup BudleActivator and Service registration, Update bnd and osgi deps #9361

Merged
merged 9 commits into from
Nov 11, 2020

Conversation

stbischof
Copy link
Contributor

@stbischof stbischof commented Nov 10, 2020

  • cleanup BudleActivator
  • cleanup Service registration
  • use declarative services
  • update bnd
  • update osgi deps
  • base it-test

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@stbischof stbischof changed the title OSGI - Just testing to find Errors test OSGI - Just testing to find Errors Nov 10, 2020
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@stbischof
Copy link
Contributor Author

stbischof commented Nov 10, 2020

changes breaks everything without a clear reason.

@denis-anisimov this commit 06ed6c7 fixes the errors.

iIadded some more OSGi-related atomic commits. Most removes BudleActivator and/or bundleContect::registerService. I not uses declarative Services via @component

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@stbischof stbischof changed the title test OSGI - Just testing to find Errors [OSGi] - Cleanup BudleActivator and Service registration, Update bnd and osgi deps Nov 10, 2020
public VaadinBundleTracker(BundleContext context) {
super(context, Bundle.ACTIVE | Bundle.RESOLVED, null);
flowServerBundle = context.getBundle();
open();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this call from a constructor to the overridable "open" method. rule

@@ -145,7 +162,7 @@ public Bundle addingBundle(Bundle bundle, BundleEvent event) {

private void registerPushResources(Bundle pushBundle) {
Hashtable<String, Object> properties = new Hashtable<>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Replace the synchronized class "Hashtable" by an unsynchronized one such as "HashMap". rule

* @since
*/
@org.osgi.service.component.annotations.Component(immediate = true)
public class PolymerPublishedEventRpcHandler
implements DeprecatedPolymerPublishedEventHandler {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Remove this use of "DeprecatedPolymerPublishedEventHandler"; it is deprecated. rule

@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 14 issues

  • MAJOR 6 major
  • MINOR 8 minor

Watch the comments in this conversation to review them.

Top 10 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MAJOR VaadinBundleTracker.java#L100: A "NullPointerException" could be thrown; "resource" is nullable here. rule
  2. MAJOR VaadinBundleTracker.java#L100: Possible null pointer dereference of resource in com.vaadin.flow.server.osgi.VaadinBundleTracker$ResourceServlet.doGet(HttpServletRequest, HttpServletResponse) rule
  3. MAJOR VaadinBundleTracker.java#L185: Replace the synchronized class "Hashtable" by an unsynchronized one such as "HashMap". rule
  4. MAJOR VaadinBundleTracker.java#L282: Reduce the total number of break and continue statements in this loop to use at most one. rule
  5. MINOR PolymerPublishedEventRpcHandler.java#L58: Remove this use of "PolymerTemplate"; it is deprecated. rule
  6. MINOR PolymerPublishedEventRpcHandler.java#L60: Remove this use of "PolymerTemplate"; it is deprecated. rule
  7. MINOR PolymerPublishedEventRpcHandler.java#L86: Remove this use of "ModelType"; it is deprecated. rule
  8. MINOR PolymerPublishedEventRpcHandler.java#L86: Remove this use of "PolymerTemplate"; it is deprecated. rule
  9. MINOR VaadinBundleTracker.java#L100: Add a "try/catch" block for "openStream". rule
  10. MINOR VaadinBundleTracker.java#L101: Add a "try/catch" block for "copy". rule

@denis-anisimov
Copy link
Contributor

denis-anisimov commented Nov 11, 2020

changes breaks everything without a clear reason.

@denis-anisimov this commit 06ed6c7 fixes the errors.

This is not the problem which I referred to.
It allows to run OSGi related unit tests in Eclipse.
And this is no-op if you run them via maven: maven config is done in the way which excludes OSGi dependencies from test dependencies.
Eclipse is not able to apply maven config correctly and the tests fail.
Anyway thanks for this fix, that's good that it's not possible to run the unit test in Eclipse.

But something is broken when I applied changes (some changes) from you PR for the feature branch to the master : when I run our OSGi ITs the HTTP functionality doesn't work.

The current state of my PR makes everything work. I would like to finish this endless journey and may be keep it as is in the working sate.
I will apply your PR locally and check whether HTTP still works in our ITs or not if I will have time.

But I would may be consider this as a separate extra PR : I really don't see any end of the changes. There are many many things which can be done to improve OSGi integration and cherry pick PR is not about every improvement: it should just enable initial OSGi support.

@stbischof
Copy link
Contributor Author

stbischof commented Nov 11, 2020

i think updating bnd and osgi-deps you be a great improvement.

but i am a still not sure what OSGi related unit tests in Eclipse does not run. what does i have to do to force this tests

@denis-anisimov
Copy link
Contributor

denis-anisimov commented Nov 11, 2020

i think updating bnd and osgi-deps you be a great improvement.

but i am a still not sure what OSGi related unit tests in Eclipse does not run. what does i have to do to force this tests

every test which has @RunWith(EnableOSGiRunner.class).

In the referenced commit there are only changes in EnableOSGiRunner.java.
Or is the commit just wrong ?

@stbischof
Copy link
Contributor Author

stbischof commented Nov 11, 2020

and how to start? I cant not produce the error.
They run on my side after the fix
.make().load(this, ClassLoadingStrategy.Default.CHILD_FIRST.allowExistingTypes())

@denis-anisimov
Copy link
Contributor

and how to start? I cant not produce the error.
They run on my side after the fix
.make().load(this, ClassLoadingStrategy.Default.CHILD_FIRST.allowExistingTypes())

I think there is a misunderstanding.........

There are no any problems with these tests.
They didn't work in Eclipse for me without this PR. I have not checked actually this PR but I guess that should fix it.
But it doesn't matter whether they work in Eclipse or not: it's rather an Eclipse issue.

The tests work even without these changes if they are executed via Maven.

And this wasn't a problem for me.

I was not able to run OSGi ITs with your latest changes for bnd version and VaadinBundleTracker : that's the problem.
I haven't checked whether it's still the problem or not with this PR. I've been busy with other things.

I will check and let you know.

@stbischof
Copy link
Contributor Author

hope this PR helps as i mentioned, osgi R7 deps and bnd are most importent

* @since
*/
@org.osgi.service.component.annotations.Component(immediate = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use FQN. Just add an import.

@denis-anisimov
Copy link
Contributor

I confirm that nothing is broken with this PR.
Let's merge it.

Thanks!

@denis-anisimov denis-anisimov merged commit 1df5b02 into vaadin:osgi-master Nov 11, 2020
@denis-anisimov
Copy link
Contributor

@stbischof , I've reverted bnd 5.2.0 version change.

Bnd maven plugin is quite seriously broken

I'm packing flow-tests/test-root-context module with ui classifier as a JAR
(this module contains classes for our ITs and it's packaged as a WAR by default, but there are two classifiers: ui and test-jar).

Here are the snippets of MANIFEST with this version :

Import-Package: afu.org.checkerframework.checker.formatter.qual,afu.or
 g.checkerframework.checker.nullness.qual,afu.org.checkerframework.che
 cker.regex.qual,afu.org.checkerframework.checker.units.qual,afu.org.c
 heckerframework.dataflow.qual,afu.org.checkerframework.framework.qual
 ,android.net,android.net.http,android.os,android.security,android.uti
 l,ch.qos.cal10n,com.android.org.conscrypt,com.github.luben.zstd,com.g
 oogle.appengine.api,com.google.apphosting.api,com.google.gson,com.goo
 gle.gwt.core.client,com.google.gwt.xhr.client,com.sun.enterprise.web.
 connector.grizzly.comet,com.sun.grizzly.comet,com.sun.grizzly.tcp,com
 .sun.grizzly.util.buf,com.sun.grizzly.websockets,com.sun.jdi,com.sun.
 jdi.connect,com.sun.jdi.event,com.sun.jdi.request,dalvik.system,java.
 applet,java.awt,java.awt.datatransfer,java.awt.event,java.awt.image,j
 ava.beans,java.io,java.lang,java.lang.annotation,java.lang.instrument
 ,java.lang.invoke,java.lang.management,java.lang.ref,java.lang.reflec
 t,java.math,java.net,java.nio,java.nio.channels,java.nio.charset,java
 .nio.file,java.nio.file.attribute,java.nio.file.spi,java.security,jav
 a.security.cert,java.security.spec,java.sql,java.text,java.time,java.
 time.chrono,java.time.format,java.time.temporal,java.time.zone,java.u
 til,java.util.concurrent,java.util.concurrent.atomic,java.util.concur
 rent.locks,java.util.function,java.util.jar,java.util.logging,java.ut
 il.prefs,java.util.regex,java.util.stream,java.util.zip,javax.crypto,
 javax.crypto.spec,javax.enterprise.context,javax.enterprise.inject,ja
 vax.imageio,javax.inject,javax.jnlp,javax.lang.model.element,javax.na
 ming,javax.naming.directory,javax.naming.ldap,javax.net,javax.net.ssl
 ,javax.portlet,javax.script,javax.security.auth.x500,javax.servlet;ve
 rsion="[3.1,4)",javax.servlet.annotation;version="[3.1,4)",javax.serv
 let.http;version="[3.1,4)",javax.swing,javax.swing.border,javax.swing
 .event,javax.swing.filechooser,javax.swing.table,javax.swing.text,jav
 ax.swing.tree,javax.websocket,javax.websocket.server,javax.xml.dataty
 pe,javax.xml.namespace,javax.xml.parsers,javax.xml.stream,javax.xml.t
 ransform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.tr
 ansform.stream,javax.xml.validation,javax.xml.xpath,jdk.internal.misc
 ,org.antlr.v4.gui,org.apache.avalon.framework.logger,org.apache.catal
 ina,org.apache.catalina.comet,org.apache.catalina.connector,org.apach
 e.catalina.util,org.apache.catalina.websocket,org.apache.commons.lang
 .text,org.apache.commons.pool2,org.apache.commons.pool2.impl,org.apac
 he.coyote.http11.upgrade,org.apache.harmony.xnet.provider.jsse,org.ap
 ache.log,org.apache.log4j,org.apache.shiro,org.apache.shiro.mgt,org.a
 pache.shiro.subject,org.apache.shiro.web.env,org.apache.shiro.web.sub
 ject,org.apache.shiro.web.util,org.apache.xmlbeans,org.atmosphere.jbo
 ss.as.websockets,org.atmosphere.jboss.as.websockets.servlet,org.atmos
 phere.jboss.websockets,org.atmosphere.jboss.websockets.frame,org.atmo
 sphere.jersey.util,org.brotli.dec,org.checkerframework.checker.format
 ter.qual,org.checkerframework.checker.nullness.qual,org.checkerframew
 ork.checker.regex.qual,org.checkerframework.checker.units.qual,org.ch
 eckerframework.dataflow.qual,org.checkerframework.framework.qual,org.
 conscrypt,org.eclipse.jetty.continuation,org.eclipse.jetty.websocket,
 org.eclipse.jetty.websocket.api,org.eclipse.jetty.websocket.server,or
 g.eclipse.jetty.websocket.servlet,org.glassfish.grizzly,org.glassfish
 .grizzly.comet,org.glassfish.grizzly.http.server,org.glassfish.grizzl
 y.websockets,org.glassfish.hk2.osgiresourcelocator,org.ietf.jgss,org.
 jboss.servlet.http,org.jboss.vfs,org.joda.convert,org.json,org.junit,
 org.junit.internal,org.junit.rules,org.junit.runner,org.junit.runners
 ,org.junit.runners.model,org.mortbay.util.ajax,org.osgi.framework;ver
 sion="[1.9,2)",org.osgi.framework.wiring;version="[1.2,2)",org.osgi.s
 ervice.http;version="[1.2,2)",org.osgi.util.tracker;version="[1.5,2)"
 ,org.springframework.beans.factory.annotation,org.springframework.boo
 t.autoconfigure.condition,org.springframework.boot.autoconfigure.jack
 son,org.springframework.boot.autoconfigure.web.servlet,org.springfram
 ework.boot.context.properties,org.springframework.context,org.springf
 ramework.context.annotation,org.springframework.http,org.springframew
 ork.http.converter.json,org.springframework.stereotype,org.springfram
 ework.util,org.springframework.web.bind.annotation,org.springframewor
 k.web.servlet.mvc.condition,org.springframework.web.servlet.mvc.metho
 d,org.springframework.web.servlet.mvc.method.annotation,org.testng,or
 g.tukaani.xz,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.ls,org.xml
 .sax,org.xml.sax.ext,org.xml.sax.helpers,sun.misc,sun.security.ssl,su
 n.security.util,weblogic.websocket,weblogic.websocket.annotation

Service-Component: OSGI-INF/com.vaadin.flow.osgi.Activator.xml,OSGI-IN
 F/com.vaadin.flow.server.osgi.OSGiResourceProvider.xml,OSGI-INF/com.v
 aadin.flow.server.osgi.VaadinBundleTracker.xml,OSGI-INF/com.vaadin.fl
 ow.component.polymertemplate.rpc.PolymerPublishedEventRpcHandler.xml
Bundle-Developers: vaadin;organization=Vaadin;organizationUrl="http://
 vaadin.com"
Provide-Capability: osgi.service;objectClass:List<String>="com.vaadin.
 flow.component.template.internal.DeprecatedPolymerPublishedEventHandl
 er";uses:="com.vaadin.flow.component.template.internal",osgi.service;
 objectClass:List<String>="com.vaadin.flow.di.ResourceProvider";uses:=
 "com.vaadin.flow.di"

afu.org, android.util.... : I have no any idea where it comes from .
This is absolutely wrong.

This bundle doesn't contain service components except one Activator. All other components comes from dependencies.
And it doesn't provide ant capability.

Many manifest headers are wrong.

Here is the manifest made by 3.3.0 version:

Import-Package: com.vaadin.flow.component;version="[6.0,7)",com.vaadin
 .flow.component.dependency;version="[6.0,7)",com.vaadin.flow.componen
 t.dnd;version="[6.0,7)",com.vaadin.flow.component.html;version="[6.0,
 7)",com.vaadin.flow.component.internal;version="[6.0,7)",com.vaadin.f
 low.component.littemplate;version="[6.0,7)",com.vaadin.flow.component
 .page;version="[6.0,7)",com.vaadin.flow.component.polymertemplate;ver
 sion="[6.0,7)",com.vaadin.flow.component.template;version="[6.0,7)",c
 om.vaadin.flow.data.value;version="[6.0,7)",com.vaadin.flow.dom;versi
 on="[6.0,7)",com.vaadin.flow.function;version="[6.0,7)",com.vaadin.fl
 ow.i18n;version="[6.0,7)",com.vaadin.flow.internal;version="[6.0,7)",
 com.vaadin.flow.internal.nodefeature;version="[6.0,7)",com.vaadin.flo
 w.router;version="[6.0,7)",com.vaadin.flow.server;version="[6.0,7)",c
 om.vaadin.flow.server.communication;version="[6.0,7)",com.vaadin.flow
 .shared;version="[6.0,7)",com.vaadin.flow.shared.communication;versio
 n="[6.0,7)",com.vaadin.flow.shared.ui;version="[6.0,7)",com.vaadin.fl
 ow.templatemodel;version="[6.0,7)",elemental.json;version="[2.8,3)",j
 avax.servlet;version="[3.1,4)",javax.servlet.annotation;version="[3.1
 ,4)",javax.servlet.http;version="[3.1,4)",org.apache.commons.io;versi
 on="[1.4,2)",org.apache.commons.lang3;version="[3.9,4)",org.osgi.fram
 ework;version="[1.9,2)",org.osgi.service.http;version="[1.2,2)",org.o
 sgi.util.tracker;version="[1.5,2)",org.slf4j;version="[1.7,2)"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Service-Component: OSGI-INF/com.vaadin.flow.osgi.Activator.xml

The remaining part contains just bundle name and Export-Package section.
So the manifest is much shorter than the one generated with 5.2.0 .
And this content is correct.

So 5.2.0 bnd is seriously broken and we may not have this version.

@stbischof
Copy link
Contributor Author

stbischof commented Nov 16, 2020

@juergen-albert
could you please helpe me here. I think using bnd 5.2 should help us more then 3.3.

I am sure that bnd is not broken. Maybe checkerframework generates some source that bnd can find.

@denis-anisimov These better Manifest helps the resolver a lot to resove a working framework and ServiceLoader handling!

Service-Component: OSGI-INF/com.vaadin.flow.osgi.Activator.xml,OSGI-IN
 F/com.vaadin.flow.server.osgi.OSGiResourceProvider.xml,OSGI-INF/com.v
 aadin.flow.server.osgi.VaadinBundleTracker.xml,OSGI-INF/com.vaadin.fl
 ow.component.polymertemplate.rpc.PolymerPublishedEventRpcHandler.xml
Bundle-Developers: vaadin;organization=Vaadin;organizationUrl="http://
 vaadin.com"
Provide-Capability: osgi.service;objectClass:List<String>="com.vaadin.
 flow.component.template.internal.DeprecatedPolymerPublishedEventHandl
 er";uses:="com.vaadin.flow.component.template.internal",osgi.service;
 objectClass:List<String>="com.vaadin.flow.di.ResourceProvider";uses:=
 "com.vaadin.flow.di"

@denis-anisimov
Copy link
Contributor

Also, I'm not sure whether this is related or not but

@Activate
public VaadinBundleTracker(BundleContext context)

doesn't work in our ITs config: OSGi tries to instantiate the component and it wants to use a default cosntructor.
But there is no default contractor and it fails to create and register the service.
@Activate annotation should be used properly with compendium 7 but in runtime it's apparently broken.
I'm not sure whether this is related to the compendium version or bnd version.
I had to revert your changes related to VaadinBundleTracker as well.

It's weird why it's broken because I've checked that it worked before accept the PR.

I know that I didn't rebuild the ITs module from scratch to test but used the old one. Probably that's the reason.
But now the code doesn't work even with the correct IT module: the same error is shown in the console about absence of default constructor.

@denis-anisimov
Copy link
Contributor

@denis-anisimov These better Manifest helps the resolver a lot to resove a working framework and ServiceLoader handling!

Service-Component: OSGI-INF/com.vaadin.flow.osgi.Activator.xml,OSGI-IN
 F/com.vaadin.flow.server.osgi.OSGiResourceProvider.xml,OSGI-INF/com.v
 aadin.flow.server.osgi.VaadinBundleTracker.xml,OSGI-INF/com.vaadin.fl
 ow.component.polymertemplate.rpc.PolymerPublishedEventRpcHandler.xml
Bundle-Developers: vaadin;organization=Vaadin;organizationUrl="http://
 vaadin.com"
Provide-Capability: osgi.service;objectClass:List<String>="com.vaadin.
 flow.component.template.internal.DeprecatedPolymerPublishedEventHandl
 er";uses:="com.vaadin.flow.component.template.internal",osgi.service;
 objectClass:List<String>="com.vaadin.flow.di.ResourceProvider";uses:=
 "com.vaadin.flow.di"

I don't understand what you mean.
As I said: flow-tests/test-root-context doesn't provide any capability.
So Provide-Capability header should not be in its manifest at all.

One more time: flow-tests/test-root-context .
DeprecatedPolymerPublishedEventHandler capability is provided by flow-polymer-template bundle.
ResourceProvider capability is provided by the flow-server bundle.

flow-tests/test-root-context doesn't provide ANY capability. Don't see how this incorrect info may help to the resolver.

@stbischof
Copy link
Contributor Author

stbischof commented Nov 16, 2020

@Activate
public VaadinBundleTracker(BundleContext context)

Injecting bundleContext into a Constructor kame with R7 . bnd (with the newer versions) generates a xml file that describes this

Service-Component: [...] OSGI-INF/com.v
 aadin.flow.server.osgi.VaadinBundleTracker.xml, [...] 

will have look on this problem this evening.

@juergen-albert
Copy link

@juergen-albert
could you please helpe me here. I think using bnd 5.2 should help us more then 3.3.

I haven't used maven for quite some time, but as far as I remember does the war packaging cause maven to pack all the defined dependencies that are in certain scopes in the resulting war. This could mean, that bnd is analyzing all the dependent artifacts, when asked to build a manifest for it.

@denis-anisimov can you provide a jar with this large manifest, so we can have a look?

@juergen-albert
Copy link

Besides this: Please use the latest bnd, because it produces much better metadata!

@stbischof
Copy link
Contributor Author

stbischof commented Nov 16, 2020

flow-test-root-context-npm-6.0-SNAPSHOT-ui.jar
Manifest:
https://gist.github.com/stbischof/01dae6f97ab8df568d0d61581830f83c

@juergen-albert
Copy link

As I have guessed. The dependencies are part of the jars classpath.
This is not really BNDs fault. Maven adds the all dependencies to the containers classpath, because packaging is war. BND then takes the classpath and handles it as it should. Version 3.3 simply did not properly handle jar-classpath libs.

The question would be, what the idea behind this jars is. Should they even be bundles or even jars? What is the idea behind packaging everything including the kitchen sink in the jars?

@stbischof
Copy link
Contributor Author

stbischof commented Nov 16, 2020

Vaadin_checker

Please ignore the older 2.5 builds

  • flow-html-components-testbench
    -- vaadin-testbench-core
    --- selenium-remote-driver
    ---- guava
    ----- checker-compat-qual

@stbischof
Copy link
Contributor Author

stbischof commented Nov 16, 2020

@juergen-albert thank you for the hint.

if i exclude org.checkerframework - org.checkerframework in the pom file the

<dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-html-components-testbench</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.checkerframework</groupId>
                    <artifactId>checker-compat-qual</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
  • flow-test-root-context-npm-6.0-SNAPSHOT.war does not have the entry WEB-INF/lib/checker-compat-Qual-2.0.0.jar
  • flow-test-root-context-npm-6.0-SNAPSHOT-ui.jar does not have the Import-Package Entry afu.org.checkerframework.checker.

now:

Import-Package: ch.qos.cal10n,com.github.luben.zstd,com.google.appengine
 .api,com.google.apphosting.api,com.sun.enterprise.web.connector.grizzly
 .comet,com.sun.grizzly.comet,com.sun.grizzly.tcp,com.sun.grizzly.util.b
 uf,com.sun.grizzly.websockets,com.sun.jdi,com.sun.jdi.connect,com.sun.j
 di.e

if you add a -wab into the bnd.bnd file you could get this manifest:

Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.component)(version>=1.4.0)(!(version>=2.0.0)))",osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Service-Component: OSGI-INF/com.vaadin.flow.osgi.Activator.xml

there is no Provide-Capability

Please look into the bnd docs. It is a bit late an i am not sure. Web Archive Bundles

https://bnd.bndtools.org/md/805-instructions.html
look for Web Archive Bundles


there is an Import-Package instructions !com.vaadin.flow.uitest.servlet*, but cant see the package

@stbischof
Copy link
Contributor Author

stbischof commented Nov 16, 2020

@Activate
public VaadinBundleTracker(BundleContext context)

doesn't work in our ITs config: OSGi tries to instantiate the component and it wants to use a default cosntructor.
But there is no default contractor and it fails to create and register the service.
@Activate annotation should be used properly with compendium 7 but in runtime it's apparently broken.

could show me the log in the build where the it fails.
I am also sure that there was no fail in the test.

Lets check the spec:

112.3.4 Constructor Injection

Bnd has generated this file OSGI_INF/com.vaadin.flow.server.osgi.VaadinBundleTracker.xml and the init="1" declares the constructor
CORRECT:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.4.0" name="com.vaadin.flow.server.osgi.VaadinBundleTracker" immediate="true" deactivate="deactivate" init="1">
  <service>
    <provide interface="java.lang.Object"/>
  </service>
  <implementation class="com.vaadin.flow.server.osgi.VaadinBundleTracker"/>
</scr:component>

WRONG

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="com.vaadin.flow.server.osgi.VaadinBundleTracker" immediate="true" activate="&lt;init&gt;" deactivate="deactivate">
  <implementation class="com.vaadin.flow.server.osgi.VaadinBundleTracker"/>
  <service>
    <provide interface="java.lang.Object"/>
  </service>
</scr:component>

if this entry is WRONG, then bnd version is 3.3 (see manifest for version)

I pushed a commit of an OSGi-ITest you can see all from the log. bipolis@e367ef1
Should I create a PR for the tests to osgi-master or can yo just pick the commit? thex are committet to this branche (osgi-master-fix)

01:07:51.734 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - com.vaadin.flow.server.osgi.VaadinBundleTracker activated via Constructor.

01:07:51.716 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Component created: DS=DS13, implementation=com.vaadin.flow.server.osgi.OSGiResourceProvider, immediate=false, default-enabled=true, factory=null, configuration-policy=optional, activate=activate, deactivate=deactivate, modified=null configuration-pid=[com.vaadin.flow.server.osgi.OSGiResourceProvider]
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Component Services: scope=singleton, services=[com.vaadin.flow.di.ResourceProvider]
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Component Properties: {}
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Querying state disabled
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Querying state disabled
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Component can not be activated since it is in state disabled
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider] : Querying state disabled
01:07:51.717 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Updating target filters
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Changed state from disabled to unsatisfiedReference
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Component enabled
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : ActivateInternal
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Querying state unsatisfiedReference
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Querying state unsatisfiedReference
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Activating component from state unsatisfiedReference
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Querying state unsatisfiedReference
01:07:51.718 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Querying state unsatisfiedReference
01:07:51.719 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : Changed state from unsatisfiedReference to satisfied
01:07:51.720 [main] DEBUG com.vaadin.flow.server.osgi.OSGiResourceProvider - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.OSGiResourceProvider(0)] : registration change queue [registered]
01:07:51.720 [main] INFO Events.Service.com.vaadin.flow.server - ServiceEvent REGISTERED
01:07:51.721 [main] DEBUG ROOT - bundle com.vaadin.flow.server:6.0.0 (14) BundleComponentActivator : May enable component holder com.vaadin.flow.server.osgi.VaadinBundleTracker
01:07:51.721 [main] DEBUG ROOT - bundle com.vaadin.flow.server:6.0.0 (14) BundleComponentActivator :Enabling component holder com.vaadin.flow.server.osgi.VaadinBundleTracker
01:07:51.721 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Component created: DS=DS14, implementation=com.vaadin.flow.server.osgi.VaadinBundleTracker, immediate=true, default-enabled=true, factory=null, configuration-policy=optional, activate=activate, deactivate=deactivate, modified=null configuration-pid=[com.vaadin.flow.server.osgi.VaadinBundleTracker]
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Component Services: scope=singleton, services=[java.lang.Object]
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Component Properties: {}
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Querying state disabled
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Querying state disabled
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Component can not be activated since it is in state disabled
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker] : Querying state disabled
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Updating target filters
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Changed state from disabled to unsatisfiedReference
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Component enabled
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : ActivateInternal
01:07:51.722 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Querying state unsatisfiedReference
01:07:51.723 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Querying state unsatisfiedReference
01:07:51.723 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Activating component from state unsatisfiedReference
01:07:51.723 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Querying state unsatisfiedReference
01:07:51.723 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Querying state unsatisfiedReference
01:07:51.723 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Changed state from unsatisfiedReference to satisfied
01:07:51.723 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : registration change queue [registered]
01:07:51.723 [main] INFO Events.Service.com.vaadin.flow.server - ServiceEvent REGISTERED
01:07:51.724 [main] DEBUG ROOT - bundle org.apache.felix.scr:2.1.24 (34) getService  {java.lang.Object}={service.id=50, service.bundleid=14, service.scope=bundle, component.name=com.vaadin.flow.server.osgi.VaadinBundleTracker, component.id=1}: stack of references: []
01:07:51.731 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Checking constructor public com.vaadin.flow.server.osgi.VaadinBundleTracker(org.osgi.framework.BundleContext)
01:07:51.733 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Found constructor with 1 arguments : public com.vaadin.flow.server.osgi.VaadinBundleTracker(org.osgi.framework.BundleContext)
01:07:51.733 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : This thread collected dependencies
01:07:51.733 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : getService (single component manager) dependencies collected.
01:07:51.733 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Querying state satisfied
01:07:51.734 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Querying state satisfied
01:07:51.734 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - com.vaadin.flow.server.osgi.VaadinBundleTracker activated via Constructor.
01:07:51.736 [main] INFO Events.Service.com.vaadin.flow.client - ServiceEvent REGISTERED
01:07:51.741 [main] INFO Events.Service.com.vaadin.flow.push - ServiceEvent REGISTERED
01:07:51.744 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : getting activate: activate
01:07:51.745 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Locating method activate in class com.vaadin.flow.server.osgi.VaadinBundleTracker
01:07:51.745 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Declared Method com.vaadin.flow.server.osgi.VaadinBundleTracker.activate([interface org.osgi.service.component.ComponentContext]) not found
01:07:51.746 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Locating method activate in class org.osgi.util.tracker.BundleTracker
01:07:51.746 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Declared Method org.osgi.util.tracker.BundleTracker.activate([interface org.osgi.service.component.ComponentContext]) not found
01:07:51.746 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Locating method activate in class java.lang.Object
01:07:51.747 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Declared Method java.lang.Object.activate([interface org.osgi.service.component.ComponentContext]) not found
01:07:51.747 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : activate method [activate] not found, ignoring
01:07:51.747 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Set implementation object for component
01:07:51.747 [main] DEBUG com.vaadin.flow.server.osgi.VaadinBundleTracker - bundle com.vaadin.flow.server:6.0.0 (14)[com.vaadin.flow.server.osgi.VaadinBundleTracker(1)] : Changed state from satisfied to active
01:07:51.747 [main] DEBUG ROOT - bundle org.apache.felix.scr:2.1.24 (34) bundle com.vaadin.flow.theme.lumo:6.0.0 (15) : Starting extension synchronously

@stbischof
Copy link
Contributor Author

stbischof commented Nov 17, 2020

@denis-anisimov I run test tests on flow-tests/test-root-context over 10 times
every 3 time it workes!
here is the full log of a build.
https://gist.github.com/stbischof/f0ac323dc3ffdf5eb8597a39e6059f47

every other time failed with enableSessionExpiredNotification_sessionExpired_notificationShown :
That is not an OSGi or bnd problem.

[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.48 s <<< FAILURE! - in com.vaadin.flow.uitest.ui.InternalErrorIT
[ERROR] enableSessionExpiredNotification_sessionExpired_notificationShown[ANY_Chrome_](com.vaadin.flow.uitest.ui.InternalErrorIT)  Time elapsed: 7.479 s  <<< FAILURE!
java.lang.AssertionError: After enabling the 'Session Expired' notification, the page should not be refreshed after killing the session
	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at com.vaadin.flow.uitest.ui.InternalErrorIT.enableSessionExpiredNotification_sessionExpired_notificationShown(InternalErrorIT.java:92)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at com.vaadin.testbench.parallel.ParallelRunner$TBMethod.invokeExplosively(ParallelRunner.java:494)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at com.vaadin.testbench.parallel.ParallelRunner$1.evaluate(ParallelRunner.java:468)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:410)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

[INFO] Running com.vaadin.flow.uitest.ui.ErrorPageIT
Starting ChromeDriver 86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378}) on port 14316
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Nov 17, 2020 2:29:37 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.595 s - in com.vaadin.flow.uitest.ui.ErrorPageIT
[INFO] Running com.vaadin.flow.uitest.ui.dependencies.ContextInlineApiIT
[WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0 s - in com.vaadin.flow.uitest.ui.dependencies.ContextInlineApiIT
[INFO] Running com.vaadin.flow.uitest.ui.template.collections.TwoWayListBindingIT
Starting ChromeDriver 86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378}) on port 12432
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Nov 17, 2020 2:29:20 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.026 s - in com.vaadin.flow.uitest.ui.template.collections.TwoWayListBindingIT
[INFO] Running com.vaadin.flow.FaultyLocationIT
Starting ChromeDriver 86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378}) on port 14290
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Nov 17, 2020 2:29:39 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.221 s - in com.vaadin.flow.FaultyLocationIT
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   InternalErrorIT.enableSessionExpiredNotification_sessionExpired_notificationShown:92 After enabling the 'Session Expired' notification, the page should not be refreshed after killing the session
[INFO] 
[ERROR] Tests run: 310, Failures: 1, Errors: 0, Skipped: 10

at last I got this errors from the same testClass as above

[ERROR] Errors: 
[ERROR] com.vaadin.flow.uitest.ui._InternalErrorIT.enableSessionExpiredNotification_sessionExpired_notificationShown[ANY_Chrome_](com.vaadin.flow.uitest.ui._InternalErrorIT)
[ERROR]   Run 1: _InternalErrorIT.setup:47->AbstractTestBenchTest.open:171->AbstractTestBenchTest.open:175->AbstractTestBenchTest.getTestURL:245->ViewOrUITest.getTestPath:60 » Runtime
[ERROR]   Run 2: _InternalErrorIT.resetSystemMessages:153->TestBenchTestCase.waitUntil:247->TestBenchTestCase.waitUntil:223 » Timeout
[INFO] 
[ERROR] com.vaadin.flow.uitest.ui._InternalErrorIT.internalError_showNotification_clickEsc_refresh[ANY_Chrome_](com.vaadin.flow.uitest.ui._InternalErrorIT)
[ERROR]   Run 1: _InternalErrorIT.setup:47->AbstractTestBenchTest.open:171->AbstractTestBenchTest.open:175->AbstractTestBenchTest.getTestURL:245->ViewOrUITest.getTestPath:60 » Runtime
[ERROR]   Run 2: _InternalErrorIT.resetSystemMessages:153->TestBenchTestCase.waitUntil:247->TestBenchTestCase.waitUntil:223 » Timeout
[INFO] 
[ERROR] com.vaadin.flow.uitest.ui._InternalErrorIT.internalError_showNotification_clickNotification_refresh[ANY_Chrome_](com.vaadin.flow.uitest.ui._InternalErrorIT)
[ERROR]   Run 1: _InternalErrorIT.setup:47->AbstractTestBenchTest.open:171->AbstractTestBenchTest.open:175->AbstractTestBenchTest.getTestURL:245->ViewOrUITest.getTestPath:60 » Runtime
[ERROR]   Run 2: _InternalErrorIT.resetSystemMessages:153->TestBenchTestCase.waitUntil:247->TestBenchTestCase.waitUntil:223 » Timeout
[INFO] 
[ERROR] com.vaadin.flow.uitest.ui._InternalErrorIT.sessionExpired_refreshByDefault[ANY_Chrome_](com.vaadin.flow.uitest.ui._InternalErrorIT)
[ERROR]   Run 1: _InternalErrorIT.setup:47->AbstractTestBenchTest.open:171->AbstractTestBenchTest.open:175->AbstractTestBenchTest.getTestURL:245->ViewOrUITest.getTestPath:60 » Runtime
[ERROR]   Run 2: _InternalErrorIT.resetSystemMessages:153->TestBenchTestCase.waitUntil:247->TestBenchTestCase.waitUntil:223 » Timeout

@stbischof
Copy link
Contributor Author

I added waitUntil(driver -> isMessageUpdated()); after the clickButton(UPDATE);

I run the test of flow-tests/test-root-context 7 of 8 Times without errors.
commit bipolis@a6b7ab4

the one error happened here (completely other test):

[ERROR] Failures: 
[ERROR]   DomEventFilterIT.debounce:64->assertMessages:174 Unexpected message at index 0 expected:<T[hrottle: ab]> but was:<T[railing: a]>
[INFO] 
[ERROR] Tests run: 310, Failures: 1, Errors: 0, Skipped: 10

@denis-anisimov
Copy link
Contributor

As I have guessed. The dependencies are part of the jars classpath.
This is not really BNDs fault. Maven adds the all dependencies to the containers classpath, because packaging is war. BND then takes the classpath and handles it as it should. Version 3.3 simply did not properly handle jar-classpath libs.

The question would be, what the idea behind this jars is. Should they even be bundles or even jars? What is the idea behind packaging everything including the kitchen sink in the jars?

Well, any way is good for me.

bnd maven plugin version 3.3.0 doesn't put extra things in manifest.
As I mentioned : the module is normally a WAR which contains UI views for ITs. And it's executed being deployed to jetty.
I don't want to duplicate the same classes in another module.
So the same classes are packaged as JAR via jar plugin and classifier ui:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        <index>false</index>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>ui-tests</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>ui</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>ui</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

And the module has bnd file for bundle manifest.
3.3.0 bnd maven plugin doesn't add extra imports into the manifest.
5.2.0 bnd maven plugin puts everything.
So it's related to the version for sure.

If you know another way of proper packaging one module as a WAR and as a WAB please let me know.
I will just use it: there are no any problems with this.

@denis-anisimov
Copy link
Contributor

@stbischof , let's don't discuss things here in the closed PR.
I just let you know the issue.

So: for now bnd version 3.3.0 will be used.
I've reverted almost all changes from this PR.

I will not accept any changes into the #9321 until it's merged and until osgi repo is configured for validation, sorry.
This is the infinite journey and I may not proceed with this without any validation.
Once validation is done you may create a PR against the master branch in Flow or in osgi and it will prove that nothing is broken.

@stbischof
Copy link
Contributor Author

Sure. I will create a PR against master.

@juergen-albert
Copy link

@denis-anisimov Please refrain from using bnd 3.3.0 it is ancient and 5.2 will produce much better Manifests. I don't know your exact setup and how the WAR and WAP will be deployed in OSGi. In short: Should this be a Bundle?

If No: Just remove this line: <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>

If Yes: Use 3.3 only for this project or we might be able to tell bnd to not scan the included libs.

@stbischof
Copy link
Contributor Author

If you know another way of proper packaging one module as a WAR and as a WAB please let me know.
I will just use it: there are no any problems with this.

from bnd-doc as above described

Defines the internal bundle class path, is taken into accont by bnd. That is, classes will be analyzed according to this path. The files/directories on the Bundle-ClassPath must be present in the bundle. Use Include-Resource to include these jars/directories in your bundle. In general you should not use Bundle-ClassPath since it makes things more complicated than necessary.

@denis-anisimov
Copy link
Contributor

@denis-anisimov Please refrain from using bnd 3.3.0 it is ancient and 5.2 will produce much better Manifests. I don't know your exact setup and how the WAR and WAP will be deployed in OSGi. In short: Should this be a Bundle?

If No: Just remove this line: <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>

If Yes: Use 3.3 only for this project or we might be able to tell bnd to not scan the included libs.

It should be a bundle, yes: that's the target . It should be possible to deploy it to the OSGi container.
The jar should be a WAB.

@stbischof
Copy link
Contributor Author

@denis-anisimov could you please tell me which jars you want to have in the lib folder of the war.

activation-1.1.jar
animal-sniffer-annotations-1.14.jar
atmosphere-runtime-2.4.30.slf4jvaadin1.jar
btf-1.2.jar
byte-buddy-1.10.9.jar
checker-compat-qual-2.0.0.jar
commonmark-0.9.0.jar
commons-cli-1.2.jar
commons-codec-1.11.jar
commons-compress-1.19.jar
commons-exec-1.3.jar
commons-fileupload-1.3.3.jar
commons-io-2.5.jar
commons-lang3-3.9.jar
commons-logging-1.2.jar
error_prone_annotations-2.1.3.jar
flow-client-6.0-SNAPSHOT.jar
flow-data-6.0-SNAPSHOT.jar
flow-dnd-6.0-SNAPSHOT.jar
flow-html-components-6.0-SNAPSHOT.jar
flow-html-components-testbench-6.0-SNAPSHOT.jar
flow-lit-template-6.0-SNAPSHOT.jar
flow-polymer-template-6.0-SNAPSHOT.jar
flow-push-6.0-SNAPSHOT.jar
flow-server-6.0-SNAPSHOT.jar
flow-test-common-6.0-SNAPSHOT.jar
gentyref-1.2.0.vaadin1.jar
guava-25.0-jre.jar
gwt-elemental-2.8.2.jar
gwt-elemental-2.8.2.vaadin2.jar
handlebars-4.0.6.jar
httpclient-4.5.13.jar
httpcore-4.4.13.jar
j2objc-annotations-1.1.jar
jackson-annotations-2.10.2.jar
jackson-core-2.10.2.jar
jackson-coreutils-1.6.jar
jackson-databind-2.10.2.jar
jackson-dataformat-yaml-2.9.5.jar
jackson-datatype-jsr310-2.10.2.jar
javaparser-core-3.15.1.jar
javaparser-symbol-solver-core-3.15.1.jar
javaparser-symbol-solver-logic-3.15.1.jar
javaparser-symbol-solver-model-3.15.1.jar
javassist-3.18.1-GA.jar
javax.annotation-api-1.3.2.jar
jaxb-api-2.3.0.jar
jmustache-1.12.jar
joda-time-2.9.7.jar
jopt-simple-5.0.3.jar
json-patch-1.6.jar
json-schema-core-1.2.8.jar
json-schema-validator-2.2.8.jar
jsoup-1.12.1.jar
jsr305-3.0.1.jar
libphonenumber-8.0.0.jar
license-checker-1.0.5.jar
mailapi-1.4.3.jar
mobile-drag-drop-2.3.0-rc.1.jar
msg-simple-1.1.jar
okhttp-3.11.0.jar
okio-1.14.0.jar
ph-commons-9.1.2.jar
ph-css-6.1.1.jar
rhino-1.7R4.jar
selenium-api-3.141.59.jar
selenium-chrome-driver-3.141.59.jar
selenium-edge-driver-3.141.59.jar
selenium-firefox-driver-3.141.59.jar
selenium-ie-driver-3.141.59.jar
selenium-java-3.141.59.jar
selenium-opera-driver-3.141.59.jar
selenium-remote-driver-3.141.59.jar
selenium-safari-driver-3.141.59.jar
selenium-support-3.141.59.jar
slf4j-api-1.7.30.jar
slf4j-ext-1.7.25.jar
slf4j-simple-1.7.30.jar
snakeyaml-1.18.jar
swagger-annotations-1.5.21.jar
swagger-annotations-2.0.4.jar
swagger-codegen-2.3.1.jar
swagger-codegen-3.0.2.jar
swagger-codegen-generators-1.0.2.jar
swagger-compat-spec-parser-1.0.33.jar
swagger-core-1.5.21.jar
swagger-core-2.0.4.jar
swagger-models-1.5.21.jar
swagger-models-2.0.4.jar
swagger-parser-1.0.39.jar
swagger-parser-2.0.5.jar
swagger-parser-core-2.0.5.jar
swagger-parser-v2-converter-2.0.5.jar
swagger-parser-v3-2.0.5.jar
uri-template-0.9.jar
vaadin-testbench-core-6.3.0.jar
vaadin__vaadin-mobile-drag-drop-1.0.0.jar
validation-api-2.0.1.Final.jar

@denis-anisimov
Copy link
Contributor

@denis-anisimov could you please tell me which jars you want to have in the lib folder of the war.

activation-1.1.jar
animal-sniffer-annotations-1.14.jar
atmosphere-runtime-2.4.30.slf4jvaadin1.jar
btf-1.2.jar
byte-buddy-1.10.9.jar
checker-compat-qual-2.0.0.jar
commonmark-0.9.0.jar
commons-cli-1.2.jar
commons-codec-1.11.jar
commons-compress-1.19.jar
commons-exec-1.3.jar
commons-fileupload-1.3.3.jar
commons-io-2.5.jar
commons-lang3-3.9.jar
commons-logging-1.2.jar
error_prone_annotations-2.1.3.jar
flow-client-6.0-SNAPSHOT.jar
flow-data-6.0-SNAPSHOT.jar
flow-dnd-6.0-SNAPSHOT.jar
flow-html-components-6.0-SNAPSHOT.jar
flow-html-components-testbench-6.0-SNAPSHOT.jar
flow-lit-template-6.0-SNAPSHOT.jar
flow-polymer-template-6.0-SNAPSHOT.jar
flow-push-6.0-SNAPSHOT.jar
flow-server-6.0-SNAPSHOT.jar
flow-test-common-6.0-SNAPSHOT.jar
gentyref-1.2.0.vaadin1.jar
guava-25.0-jre.jar
gwt-elemental-2.8.2.jar
gwt-elemental-2.8.2.vaadin2.jar
handlebars-4.0.6.jar
httpclient-4.5.13.jar
httpcore-4.4.13.jar
j2objc-annotations-1.1.jar
jackson-annotations-2.10.2.jar
jackson-core-2.10.2.jar
jackson-coreutils-1.6.jar
jackson-databind-2.10.2.jar
jackson-dataformat-yaml-2.9.5.jar
jackson-datatype-jsr310-2.10.2.jar
javaparser-core-3.15.1.jar
javaparser-symbol-solver-core-3.15.1.jar
javaparser-symbol-solver-logic-3.15.1.jar
javaparser-symbol-solver-model-3.15.1.jar
javassist-3.18.1-GA.jar
javax.annotation-api-1.3.2.jar
jaxb-api-2.3.0.jar
jmustache-1.12.jar
joda-time-2.9.7.jar
jopt-simple-5.0.3.jar
json-patch-1.6.jar
json-schema-core-1.2.8.jar
json-schema-validator-2.2.8.jar
jsoup-1.12.1.jar
jsr305-3.0.1.jar
libphonenumber-8.0.0.jar
license-checker-1.0.5.jar
mailapi-1.4.3.jar
mobile-drag-drop-2.3.0-rc.1.jar
msg-simple-1.1.jar
okhttp-3.11.0.jar
okio-1.14.0.jar
ph-commons-9.1.2.jar
ph-css-6.1.1.jar
rhino-1.7R4.jar
selenium-api-3.141.59.jar
selenium-chrome-driver-3.141.59.jar
selenium-edge-driver-3.141.59.jar
selenium-firefox-driver-3.141.59.jar
selenium-ie-driver-3.141.59.jar
selenium-java-3.141.59.jar
selenium-opera-driver-3.141.59.jar
selenium-remote-driver-3.141.59.jar
selenium-safari-driver-3.141.59.jar
selenium-support-3.141.59.jar
slf4j-api-1.7.30.jar
slf4j-ext-1.7.25.jar
slf4j-simple-1.7.30.jar
snakeyaml-1.18.jar
swagger-annotations-1.5.21.jar
swagger-annotations-2.0.4.jar
swagger-codegen-2.3.1.jar
swagger-codegen-3.0.2.jar
swagger-codegen-generators-1.0.2.jar
swagger-compat-spec-parser-1.0.33.jar
swagger-core-1.5.21.jar
swagger-core-2.0.4.jar
swagger-models-1.5.21.jar
swagger-models-2.0.4.jar
swagger-parser-1.0.39.jar
swagger-parser-2.0.5.jar
swagger-parser-core-2.0.5.jar
swagger-parser-v2-converter-2.0.5.jar
swagger-parser-v3-2.0.5.jar
uri-template-0.9.jar
vaadin-testbench-core-6.3.0.jar
vaadin__vaadin-mobile-drag-drop-1.0.0.jar
validation-api-2.0.1.Final.jar

Complicated question.

First of all : why do you talk about WAR?
We don't need WAR in OSGi.

So is this question really about WAR or it's about JAR for OSGi ?

@stbischof
Copy link
Contributor Author

stbischof commented Nov 17, 2020

It should be a bundle, yes: that's the target . It should be possible to deploy it to the OSGi container.
The jar should be a WAB.

I would create a WAB. One single zip file with the file-extention=war and an osgi manifest.
If you create a <packaging>war</packaging> and use a newer bnd-plugin it will generate the manifest and includes all NON-Optional Artefacts that are in Not-Test and Not-Provided Scope into the Bundle-Classpath and lib folder. Then bnd searches in all that classes for imports.

I will make a PR. Then you could comment which artefacts should be excluded.

BTW.

@juergen-albert
NOT surprisingly - I found the reasons why bnd adds this Import-Packages.
Bnd does right!

afu.org.checkerframework.checker.formatter.qual,afu.or
 g.checkerframework.checker.nullness.qual,afu.org.checkerframework.che
 cker.regex.qual,afu.org.checkerframework.checker.units.qual,afu.org.c
 heckerframework.dataflow.qual,afu.org.checkerframework.framework.qual
 ,android.net,android.net.http,android.os,android.security,android.uti
 l,ch.qos.cal10n,com.android.org.conscrypt

denis-anisimov pushed a commit that referenced this pull request Nov 18, 2020
…and osgi deps (#9361)

refactor: OSGi improvements 

* update bnd-version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* update osgi dependency and version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix mocking osgi-classes

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* OSGiResourceProvider uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* VaadinBundleTracker uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* Remove `empty` BundleActivator

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* use constants for osgi.http.whiteboard.servlet.pattern

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix unregister Service PolymerPublishedEventRpcHandler

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* registers PolymerPublishedEventRpcHandler as a declarative service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
pleku pushed a commit that referenced this pull request Dec 7, 2020
…and osgi deps (#9361)

refactor: OSGi improvements 

* update bnd-version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* update osgi dependency and version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix mocking osgi-classes

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* OSGiResourceProvider uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* VaadinBundleTracker uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* Remove `empty` BundleActivator

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* use constants for osgi.http.whiteboard.servlet.pattern

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix unregister Service PolymerPublishedEventRpcHandler

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* registers PolymerPublishedEventRpcHandler as a declarative service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
TatuLund added a commit that referenced this pull request Dec 16, 2020
* test: Fix duplicate registration (#9233)

Lock the registry when registering
dynamic route in serviceInit to not have
a race where 2 inits note that path is not
registered and then try to register the route.

Fixes #9223

* refactor: Remove log usage in embedded components (#9254)

8d012f7 removed some log and converted others into debug
but log in disconnectedCallback was left.

* refactor: expose the items count API to components (#9257)

Exposes DataCommunicator::getDataProviderSize to the components, in order to get the items count taking into account the countCallback, if it has been set previously.

Related-to: vaadin/flow-components#282

* chore: unit test for devmode-not-ready page contents and type (#9266)

* chore: do not depend on commons.lang3 (#9271)

* chore: fix typo (#9272)

Fix typo in DataCommunicator::getDataProviderSize() javadoc.

* fix: Sync HierarchicalDataCommunicator's expand state with client side (#9275)

HierarchicalDataCommunicator's expanded state were not being synchronised with client side and TreeGrid's expanded nodes were being collapsed after re-attaching.

Warranty: Sync TreeGrid expanded items state with the client side when detaching and reattaching

Fixes: #9175

* chore: Bump version to 6.0-SNAPSHOT (#9279)

* refactor: make web browser immutable (#9298)

* feat: Create Flow plugins for webpack (#9295)

* feat: Create Flow plugins for webpack

Moved stats file handling to a custom plugin.
Added feature for copying custom Flow plugins
for use with webpack.

Fixes #9283

* fix: AppShellConfigurator is now considered for theme endpoint (#9332)

AppShellConfigurator is now also considered when
scanning for annotations and deciding theme.

Fixes #9110

* fix: fix TreeGrid updating wrong expanded items state on setDataProvider (#9336)

Fixes: #9328
Details: HierarchicalDataProvider's reset method was called before recreating the HierrarchyMapper in setDataProvider. This was creating wrong updates for the client side.

* feat!: Theme annotation should be only on AppShellConfigurator (#9313)

Having the `@Theme` annotation on Flow views or router layouts will not be allowed anymore, it should be on `AppShellConfigurator` instead.

Fixes #9092

* test(TypeScript): ensure CSRF token is updated when session is invalidated (#9329)

* test(TypeScript): ensure CSRF token is updated when session is invalidated

Fixes #9164

* add log message

* fix: increase threshold for performance test (#9381)

* fix: hide loading indicator when endpoint call fails (#9380)

* feat: tree-shakeable ES imports for TS form validators (#9374)

- Use tree-shakeable ES imports for TS form validators based on the latest version of validators lib.
- Add missing `return` in the `submit()` method

* feat: Theme can be defined as string or class (#9349)

Add a string definition for theme that matches the "application theme" in the theme folder inside /frontend/theme/, loading the css automatically from there. This is based on Lumo theme, always.
Change old class based theme to use themeClass for theme selection.

Fixes #9281

* fix!: Use data view filter and sorting only to that component (#9315)

In-memory filtering and sorting are now stored directly in component, which gives an opportunity to change it through the data view API for a certain component separately from other components bound to the same data provider.

Fixes #8655

* fix: support Range requests with either start or end byte index omitted (#9368)

Supports headers of the type Range: -123 and Range: 123-.

Fixes #9083.

* refactor: revert 'Use data view filter and sorting only to that component' (#9390)

Revert the changes for #8655 to be able to bump the version of components and avoid compile errors.

* chore: remove test module test-subcontext (#9394)

This module is subsumed by test-router-custom-context.

* chore: update readme with discord link (#9382)

* test: remove Theme annotation from demo helpers module (#9395)

* feat: Do not allow themeClass and themeName in same annotation (#9389)

Theme Class and Theme Name is not supported in
the same Theme annotation as theme name builds
on the Lumo theme.

test-themes is now for testing the Application theme only.
Old theme test was moved into test-misc.

Fixes #9370

* fix!: Use data view filter and sorting only to that component (#9315)

In-memory filtering and sorting are now stored directly in component, which gives an opportunity to change it through the data view API for a certain component separately from other components bound to the same data provider.

Fixes: #8655

* feat: Only use one theme and fail for duplicates (#9406)

Now we only handle the theme with the name inside the Theme annotation.

Fixes #9383

* Read stats.json content as a bundle resource in OSGi
Read token file as a bundle resource in OSGi

Fixes #9146
Fix NPE
Revert logic back to the previous state
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendUtils.java
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/OSGiAccess.java

* Refactor Instantiator and resources access

Fixes #9185
Exclude non-serializable classes
Drop dependency to flow-push from flow-server
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/server/BootstrapHandler.java
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
#	flow-server/src/test/java/com/vaadin/flow/server/connect/generator/endpoints/model/OSGiInstantiatorFactory.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/generator/endpoints/model/OSGiResourceProvider.java
#	flow-server/src/test/java/com/vaadin/flow/server/connect/typeconversion/StringConversionTest.java

* Remove flow-osgi dep from flow-push, increase osgi cmpn version
# Conflicts:
#	flow-push/pom.xml
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/VaadinBundleTracker.java

* Correct unit tests after refactoring: make them compiling
Mock VaadinServlet in MockVaadinServletService
Adapt unit tests for refactored code
Adapt more unti tests and add one more new SPI method
Fix serializable test, proceed with unit tests adaption
Adapt unit tests for classes in com.vaadin.flow.server
Adapt unit tests in the com.vaadin.flow.server.communication package
* Adapt more unit tests

* Make sure that ServletContextInitializers are executed after
LookupInitializer
Fix OSGi presence check to be able to run unit test
Adapt servlet deployer unit tests
Exclude OSGi related classes from test
Exclude all OSGi impl classes from serializable test
# Conflicts:
#	flow-polymer-template/src/test/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParserTest.java
#	flow-server/src/main/java/com/vaadin/flow/server/DeploymentConfigurationFactory.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/ApplicationRouteRegistry.java
#	flow-server/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer
#	flow-server/src/test/java/com/vaadin/flow/component/InvalidUrlTest.java
#	flow-server/src/test/java/com/vaadin/flow/component/UITest.java
#	flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerDependenciesTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/DeploymentConfigurationFactoryTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/I18NProviderTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/MockServletServiceSessionSetup.java
#	flow-server/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinServiceTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinServletConfigurationTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinServletServiceTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/VaadinSessionTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/PushHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/frontend/FrontendUtilsTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/DevModeInitializerTestBase.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/EnableOSGiRunner.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/ServletDeployerTest.java

* Fix OSGi Lookup related issues
Fix OSGi related unit test one more time

# Conflicts:
#	flow-osgi/src/main/java/com/vaadin/flow/osgi/support/OSGiResourceProvider.java
#	flow-server/src/main/java/com/vaadin/flow/server/VaadinServlet.java
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/OSGiAccess.java
#	flow-server/src/main/java/com/vaadin/flow/server/osgi/VaadinBundleTracker.java
#	flow-server/src/main/java/com/vaadin/flow/server/startup/LookupInitializer.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/EnableOSGiRunner.java
#	flow-server/src/test/java/com/vaadin/flow/server/startup/OSGiInitApplicationRouteRegistryTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/webcomponent/OSGiWebComponentConfigurationRegistryTest.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/osgi/Activator.java

* Correct the resource access for VaadinService

* Extend SPI, provide javadocs some unit tests fixes
Minor code corrections, javadocs
Correct unit test
# Conflicts:
#	flow-polymer-template/src/test/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParserTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentBootstrapHandlerTest.java

* test: add unit tests

# Conflicts:
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/osgi/Activator.java

* test: make it possible to run felix-jetty in npm mode
# Conflicts:
#	flow-tests/servlet-containers/felix-jetty/pom.xml
#	flow-tests/test-root-context/pom-npm.xml

* Make httpclient dependency optional for now. (#9262)

* refactoring: move OSGi resource provider impl to flow-server (#9268)

OSGi ResourceProvider impl should be available as a service at the moment when Vaadin WAB register a servlet.
It's not possible without extra unclear config to make sure that the service is registered if it's in the flow-osgi : the bundle may be activated at any moment regardless of servlet registration.
The issue doesn't appear if the service is registered at the flow-bundle start phase.

* refactor: review fixes for OSGi (#9289)

* refactoring: review fixes

* chore: add a comment about Jar packaging in test-root-context module

* fix: ensureServletContext should be always called

* fix: fix review comments
# Conflicts:
#	flow-tests/test-root-context/pom-npm.xml

* refactor: get rid of cmpn osgi dependency (#9307)

Not needed for flow-server.

* refactoring: App classpath resources should be access via
ResourceProvider (#9278)

Fixes #9269
# Conflicts:
#	flow-polymer-template/src/main/java/com/vaadin/flow/component/polymertemplate/NpmTemplateParser.java
#	flow-server/src/main/java/com/vaadin/flow/server/BootstrapUtils.java

* test: update unit tests

* refactor: fix various OSGi related issues

* add back lost classes during cherry-picks
* fix unit tests
* rewrite polymer template RPC

* fix: fix javadocs after merge conflicts

* fix: fix mocks in unit tests

* test: Correct activator

* refactor: correct lookup initializer filtering code

* fix: fix javadocs (SQ)

* refactor: Remove OSGi related ITs and osgi module from the repo

* fix: fix some review comments

* fix: test unstable test

* refactor: get rid of OSGiClientStaticResource (#9277)

* fix: use content parameter in the activate method

* fix: Make OSGi incompatible vaadin-connect dependencies optional

* fix: make Spring deps optional

* fix: make a workaround for broken Route registry API

* fix: avoid not-breaking exception ojn loading class from another bundle

* fix: workaround for possible bug in route registry (like #9360).

* [OSGi] - Cleanup BudleActivator and Service registration, Update bnd and osgi deps (#9361)

refactor: OSGi improvements 

* update bnd-version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* update osgi dependency and version

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix mocking osgi-classes

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* OSGiResourceProvider uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* VaadinBundleTracker uses @component to declare the service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* Remove `empty` BundleActivator

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* use constants for osgi.http.whiteboard.servlet.pattern

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix unregister Service PolymerPublishedEventRpcHandler

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* registers PolymerPublishedEventRpcHandler as a declarative service

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix: add explanation why OSGi Component annotation is safe to use

* fix: code review fixes

* fix: return back accidentially removed method and call init for service

* fix: remove non-existent class pattern from test

* fix: fix import order

* fix: extract code to a separate method

* fix: correct unit test

* fix: fix unit test

* refactor: simplify list merging

* fix: return back lost code after review

* fix: imports order

* fix: revert bnd version

* fix: imports order, review comments

* fix: restore lost test method

* fix: import orders

* fix: revert not working deployment of test-root-context ui classifier

* fix: check if Url contains directory change in Dev Mode (#9392)

Checks whether the Url contains a directory change and a double encoding in Dev Mode. Returns 403 Forbidden immediately and skip the request handling, if does.

* fix: preserve filter to not lose it between page requests (#9421)

Data communicator's filter removal, which has been introduced for components with internal filtering (like a ComboBox), may lead to filter loss during the items scrolling. This fix reverts the filter removal and the components should implement this feature on their side, if necessary.

Related-to: vaadin/flow-components#388

* chore: Update issue template with discord link (#9426)

* chore: update chrome expectation to 87 (#9445)

* fix: revert changes which broke route registration (#9432)

Need to active the tracker from an servlet context initializer because @activate doesn't work on CTOR with parameter

* chore: fix outdated AppShell javadoc (#9453)

* test: add test for setting global font (#9436)

Fixes #9409

* fix race-condition in IT-Tests (#9416)

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>

* fix: mark tests that should not be executed in OSGi (#9456)

* fix: mark tests that should not be executed in OSGi

* fix: don't use push in route not found error page in OSGi

* fix: avoid route with wildcard parameter which doesn't work in OSGi

* fix: exclude wildcard parameter IT and devmode IT

* fix: exclude "context" resource IT from OSGi tests

* fix: make annotation packages optional in OSGi (#9465)

Also fix test to first open page before checking client.

fixes #9463

* fix: made VaadinRequest available in endpoint (#9442)

* fix: made vaadinrequest available in endpoint

* clear VaadinRequest instance after endpoint call

* chore: remove mentions of “Connect” (#9151)

* Rename “Connect” to “Fusion”

* Remove “Fusion” naming

* feat: Serve theme static files from VAADIN/static (#9451)

Static files in META-INF/VAADIN/static will now be served
on request to VAADIN/static.
Added new webpack loader that changes app theme
css urls targeting ./ and ../ to be VAADIN/static/ instead.
Where ../ can not go outside of the application theme folder.

Fixes #9405

* refactor: Remove OSGi code from flow-server (#9472)

* refactor: Remove OSGi code from flow-server

Fixes #9219

* chore: update Flow versions description (#9469)

* feat: Theme component with app theme. (#9418)

Added the feature that you can theme components
with the app theme by creating a css file in
'frontend/theme/myTheme/components' with the
component tag name e.g. 'my-field'  should have 'my-field.css'

Fixes #9348

* fix: check whether class implements an interface first directly (#9486)

Part of #9480

* fix: remove instance field from singleton IndexHtmlRequestHandler (#9475)

* fix: remove instance field from singleton IndexHtmlRequestHandler

* apply code review suggestions

* Stop logging error when updating dev dependencies (#9476)

As there is a conflict with the dependencies and prevent adding
the flow-dev-dependencies package to the platform (#9345), this will hide
the unavoidable error that was logged for Vaadin apps.
 
Fixes #9251

* fix: optimize handling of requests containing Range header (#9484)

More efficient parsing of the header value. Also, range count is capped at 16
(additional will be ignored) and overlapping ranges at 2 (request will be denied
if above).

* fix: Correct regexp to only match when digit first (#9496)

Use Matcher::find instead of Matcher::matches as matches never matched.

Fixes #9494

* test: add test that external urls are not touched (#9482)

Added test that we don't touch external
urls (relative or abosolute).
Moved flow to be under path so we can have
jetty serve "external" resources.

Fixes #9430

* fix: Add polyfill for constructable stylesheets (#9489)

Add the constructable stylesheets polyfill so
app theme also works with non chrome based browsers.

Fixes #9488

* fix: Initialize VaadinServlet after Lookup is available (#9500)

fix: don't initialize Vaadin servlet until Lookup is not available

* feat: Enable adding assets from node_modules (#9495)

* feat: Enable adding assets from node_modules

It is now possible to import resources from
installed node_modules by adding the asset to
theme/my-theme/theme.json

Fixes #9468

* Add comment to doc on copyStaticAssets

* Fix url expectation after merge

* format lines

* test: add unit test for clear all in the servlet init method (#9507)

* Fix: fix file system traversal of theme-loader to stop at root (#9505)

The theme-loader recursion for themeFolder should stop
at the root level. Also if no theme folder found we should
not spend time on replacement.

* fix: enable PlainScriptViaJavaScriptIT in OSGi (#9520)

fixes #9461

* fix: enable PushRouteWildcardParameterIT in OSGi (#9518)

fixes #9459

* fix: enable BaseHref IT back (#9515)

Fixes #9458

* chore: Add information on logging in webpack (#9527)

Added information on log levels
with webpack loaders and plugins.

* test: fix test class and register view servlet with a context in OSGi (#9528)

Part of vaadin/osgi#5

* fix: removed `hasClientIssue("8236")` guard as ITs now pass (#9536)

* Fix: Update Lit bundle parser regex. (#9546)

Now the pattern will not fail with a StackOverflowException
as we will search from the start character accepting
any characters until we reach the caught start character with ;

* fix: Enable lit css importing (#9550)

Fixes #9532

* fix: use provided executor for frontend tools (#9553)

fixes vaadin/spring#691

* feat: Resource handling to not need plugin copying (#9558)

Fixed the url handling so that theme resources
get prepended with theme/[themeName] while
having the correct absolute path. With this we can handle
these url resources with the css-loader which in turn
leads to file-loader gettign the files for copying.

External url are still not touched in any way.

part of #9410 and #9533

* fix: file-loader name for windows execution (#9575)

Windows file path separator \ should not
be used as it will result in %0B when it should
be /

* test: Fixed flaky tests caused by variable ui in ValidatorTestBase.java (#9524)

Added a ui variable in the ValidatorTestBase class to attach strong reference, in order to avoid garbage collecting it during the test run.

* refactor: get Executor service from Lookup instead init params (#9572)

fixes #9570

* fix: Add missing refreshAll method to data view

Adds the missed refresh all method to data view API.

Fixes: #9574

* chore: Update contributing guide with setup info (#9576)

The contribution guide was missing the project setup information.

There were outdated instructions in the readme, which was on the other hand not up to date and only had instructions for Eclipse. Now everything is in contribution guide and readme is short and simple, pointing to contribution guide for those who want to work with the project.

* fix!: Make VaadinService.dependencyFilters unmodifiable

While the change is backwards compatible from API perspective, it could be considered a behavior change although there is quite low risk of exposure in apps. Thus targeting 2.5 for the LTS and the recently released 5.0.

* fix: encode attribute value during transfer from embedded web app (#9583)

encode attribute value during transfer from embedded web app

* chore: move fusion endpoint code to fusion-endpoint module (#9499)

Fixes: #9354
move fusion code to a separate fusion-endpoint module, so that the fusion dependencies which are not OSGi compatible can be removed from the flow-server module.

- move the code in the connect package  to fusion-server
- removed the non OSGi compatible packages from the bnd file in flow-server
- change  `TaskGenerateOpenApi` and `TaskGenerateConnect` to interfaces in flow-server, have the implementations in fusion-endpoint since they are using code inside the connect package
- Move endpoint related tests:
   - from NodeTasksTest to  NodeTasksEndpointTest, 
   - from DevModeInitializerTest to DevModeInitializerEndpointTest 
- Add a `LookupImpl` class in the `flow-maven-plugin` module for finding endpoint services.
- Introduce a `isInstantiableService`method in `ReflectTools`

* feat: Embedded component appTheme support (#9588)

Add support for application theme with
embedded components.

Fixes #8564

* feat: Enable importing CSS from node_modules (#9543)

Enable using CSS files from installed node_modules by adding 'importCss' to theme/my-theme/theme.json.

Fixes #9410

* refactor: simplify ResourceProvider (#9609)

fixes #9605

* chore: add internal classes to access classloader and init context (#9618)

* chore: add internal classes to access classloader and init context

related to #9601 : needed to restore OSGi resource provider

* fix: loading indicator visible and isActive true while endpoint fetch (#9593)

* fix: loading indicator visible and isActive true while endpoint fetch

* Clarified code and added test

* fix: theme files can now be referenced as theme/theme-name (#9590)

Theme files are now copied under theme/[theme-name]
and can be referenced by theme/them-name/path/file.ff
even though they are located at VAADIN/static

Fixes: #9405 and #9535

* Fix: Generated theme.js is now named theme.generated.js (#9616)

my-theme.js is now generated as my-theme.generated.js

Fixes #9595

* Feat: Check that npm resources are available (#9617)

Check that we have named npm resources
available or throw an exception informing
the user to install it using a NpmPackage
annotation or manually with (p)npm i

Fixes #9615

* refactor: rename the app-theme root folder from theme to themes (#9626)

Fixes #9611

* refactor: refine renaming and incorrect paths in ThemeIT (#9634)

* rename app-theme root folder to themes

* chore: fix flaky tests that depends on mock count (#9631)

* chore: create deepClean profile (#9311)

Using the deepClean profile one can
clean up all the generated files and
node_modules folders from all test modules.

* test: add document.css level styles tests (#9646)

Adds a tests for checking that the document.css file is injected to the document scope and not injected to embedded element shadow root.

Fixes #9552

* refactor: extract common config functionality and introduce add config (#9635)

refactor: extract common config functionality and introduce add config

part of #9417

Co-authored-by: caalador <mikael.grankvist@gmail.com>
Co-authored-by: Guille <alvarezguille@users.noreply.github.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Co-authored-by: Johannes Eriksson <joheriks@vaadin.com>
Co-authored-by: Soroosh Taefi <taefi.soroosh@gmail.com>
Co-authored-by: Denis <denis@vaadin.com>
Co-authored-by: Artem Godin <fluorumlabs@users.noreply.github.com>
Co-authored-by: Anton Platonov <anton@vaadin.com>
Co-authored-by: Haijian Wang <30408303+haijian-vaadin@users.noreply.github.com>
Co-authored-by: Pekka Hyvönen <pekka@vaadin.com>
Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com>
Co-authored-by: Stefan Bischof <33224746+stbischof@users.noreply.github.com>
Co-authored-by: Jouni Koivuviita <jouni@vaadin.com>
Co-authored-by: Jialin Shao <jialin_shao@outlook.com>
Co-authored-by: Tan Bui <tan@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants