Hi,

Attached are some details of the code I am having problem with.

The end of the instantiator-error.txt file clearly indicates the problem but I have not been able to solve it.

"missing requirement [kOSGiInstantiator/1.0.0.SNAPSHOT] osgi.extender; filter="(osgi.extender=osgi.serviceloader.registrar)"

Karaf features for handling serviceloader seem to require "aries-proxy" and "http" to provide all thats needed.

What am I missing?

Paul Fraser

karaf@root()> feature:install vaadin-flow-mainview
Error executing command: Unable to resolve root: missing requirement [root] 
osgi.identity; osgi.identity=vaadin-flow; type=karaf.feature; 
version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; 
filter:="(&(osgi.identity=vaadin-flow)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))"
 [caused by: Unable to resolve vaadin-flow/1.0.0.SNAPSHOT: missing requirement 
[vaadin-flow/1.0.0.SNAPSHOT] osgi.identity; 
osgi.identity=vaadin-flow-instantiator; type=karaf.feature [caused by: Unable 
to resolve vaadin-flow-instantiator/1.0.0.SNAPSHOT: missing requirement 
[vaadin-flow-instantiator/1.0.0.SNAPSHOT] osgi.identity; 
osgi.identity=kOSGiInstantiator; type=osgi.bundle; 
version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: 
Unable to resolve kOSGiInstantiator/1.0.0.SNAPSHOT: missing requirement 
[kOSGiInstantiator/1.0.0.SNAPSHOT] osgi.extender; 
filter="(osgi.extender=osgi.serviceloader.registrar)"]]]
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
    <parent>
        <artifactId>kViews</artifactId>
        <groupId>net.qnenet.kSite</groupId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <!--
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <groupId>net.qnenet.kSite.kViews</groupId>
    <artifactId>kOSGiInstantiator</artifactId>
    <packaging>bundle</packaging>

    <name>QNENet :: KSite :: KViews :: KOSGiInstantiator</name>

    <description>
        kOSGiInstantiator OSGi bundle project.
    </description>

    <properties>
        <maven-bundle-plugin.version>4.1.0</maven-bundle-plugin.version>
        <osgi.version>6.0.0</osgi.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>${osgi.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-server</artifactId>
            <version>1.4.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>net.qnenet.kSite.kViews</groupId>
            <artifactId>kViewManager</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>${maven-bundle-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Version>${project.version}</Bundle-Version>
                        <Export-Package>
                            net.qnenet.kSite.kViews*;version=${project.version}
                        </Export-Package>
                        <Import-Package>
                            *
                        </Import-Package>
                        <Require-Capability>
                            osgi.extender; filter="(osgi.extender=osgi.serviceloader.registrar)"
                        </Require-Capability>
                        <Provide-Capability>
                            osgi.serviceloader; osgi.serviceloader=com.vaadin.flow.di.Instantiator
                        </Provide-Capability>
                        <SPI-Provider>*</SPI-Provider>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <maxmem>256M</maxmem>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->


<features name="kViewsFeatures-1.0-SNAPSHOT" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0";>

    <repository>mvn:net.qnenet.kSite.kUtils/kUtilsFeatures/1.0-SNAPSHOT/xml/features</repository>

        <feature name='vaadin-flow-base' description='Vaadin Flow Base' version='1.0-SNAPSHOT'>
            <details>Vaadin Flow Base</details>
            <feature>scr</feature>
            <feature>http</feature>
            <feature>http-whiteboard</feature>

            <bundle>mvn:com.vaadin/flow-server/1.4.2</bundle>
            <bundle>mvn:com.vaadin/flow-push/1.4.2</bundle>
            <bundle>mvn:com.vaadin/flow-data/1.4.2</bundle>
            <bundle>mvn:com.vaadin/flow-client/1.4.2</bundle>
            <bundle>mvn:com.vaadin/flow-html-components/1.4.2</bundle>
            <!--        <bundle>mvn:com.vaadin/flow-html-components-testbench/1.4.2</bundle>-->
            <bundle>mvn:com.vaadin/flow-osgi/1.4.2</bundle>
            <bundle>mvn:com.vaadin/vaadin-lumo-theme/1.4.2</bundle>
            <bundle>mvn:com.vaadin/vaadin-material-theme/1.4.2</bundle>

            <bundle>mvn:org.jsoup/jsoup/1.11.3</bundle>
            <bundle>mvn:com.vaadin.external.gwt/gwt-elemental/2.8.2.vaadin2</bundle>
            <bundle>mvn:com.vaadin.external/gentyref/1.2.0.vaadin1</bundle>
            <bundle>mvn:com.helger/ph-css/6.1.1</bundle>
            <bundle>mvn:com.helger/ph-commons/9.2.1</bundle>
            <bundle>mvn:javax.servlet/javax.servlet-api/3.1.0</bundle>
            <bundle>mvn:commons-io/commons-io/2.6</bundle>
            <bundle>mvn:net.bytebuddy/byte-buddy/1.9.8</bundle>
            <bundle>mvn:commons-fileupload/commons-fileupload/1.3.3</bundle>
            <bundle>mvn:com.vaadin.external.slf4j/vaadin-slf4j-jdk14/1.6.1</bundle>
            <bundle>mvn:org.apache.commons/commons-lang3/3.9</bundle>
            <bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.8</bundle>
            <bundle>mvn:com.fasterxml.jackson.core/jackson-core/2.9.8</bundle>
            <bundle>mvn:com.fasterxml.jackson.core/jackson-databind/2.9.8</bundle>

        </feature>

    <feature name='vaadin-flow-instantiator' description='Vaadin Flow Instantiator' version='1.0-SNAPSHOT'>
        <details>Vaadin Flow Instantiator</details>
        <feature>vaadin-flow-base</feature>
        <feature>aries-proxy</feature>
        <bundle>mvn:net.qnenet.kSite.kViews/kOSGiInstantiator/1.0-SNAPSHOT</bundle>

    </feature>

        <feature name='vaadin-flow' description='Vaadin Flow' version='1.0-SNAPSHOT'>
            <details>Vaadin Flow with Components</details>
            <feature>vaadin-flow-instantiator</feature>

            <!--        <bundle>mvn:com.vaadin/vaadin-iron-list-flow/1.3.0</bundle>-->
            <!--        Vaadin Item (web component v2.1.0)-->

            <!--        Vaadin Accordion (Flow integration 1.0.3, web component v1.0.0)-->
            <bundle>mvn:com.vaadin/vaadin-accordion-flow/1.0.3</bundle>
            <!--        Vaadin Button (Flow integration 1.3.2, web component v2.1.5)-->
            <bundle>mvn:com.vaadin/vaadin-button-flow/1.3.2</bundle>
            <!--        Vaadin Checkbox (Flow integration 1.3.2, web component v2.2.7)-->
            <bundle>mvn:com.vaadin/vaadin-checkbox-flow/1.3.2</bundle>
            <!--        Vaadin Combo Box (Flow integration 2.1.3, web component v4.2.9)-->
            <bundle>mvn:com.vaadin/vaadin-combo-box-flow/2.1.3</bundle>
            <!--        Vaadin Context Menu (Flow integration 2.0.1, web component v4.3.5)-->
            <bundle>mvn:com.vaadin/vaadin-context-menu-flow/2.0.1</bundle>
            <!--        Vaadin Date Picker (Flow integration 1.3.0, web component v3.3.4)-->
            <bundle>mvn:com.vaadin/vaadin-date-picker-flow/1.3.0</bundle>
            <!--        Vaadin Time Picker (Flow integration 1.1.2, web component v1.2.2)-->
            <bundle>mvn:com.vaadin/vaadin-time-picker-flow/1.1.2</bundle>
            <!--        Vaadin Details (Flow integration 1.0.1, web component v1.0.1)-->
            <bundle>mvn:com.vaadin/vaadin-details-flow/1.0.1</bundle>
            <!--        Vaadin Dialog (Flow integration 1.3.0, web component v2.2.1)-->
            <bundle>mvn:com.vaadin/vaadin-dialog-flow/1.3.0</bundle>
            <!--        Vaadin Select (Flow integration 1.0.0, web component v2.0.4)-->
            <bundle>mvn:com.vaadin/vaadin-select-flow/1.0.0</bundle>
            <!--        Vaadin Form Layout (Flow integration 1.3.1, web component v2.1.2)-->
            <bundle>mvn:com.vaadin/vaadin-form-layout-flow/1.3.1</bundle>
            <!--        Vaadin Grid (Flow integration 3.0.4, web component v5.3.3)-->
            <bundle>mvn:com.vaadin/vaadin-grid-flow/3.0.4</bundle>
            <!--        Vaadin Icons (Flow integration 1.3.1, web component v4.2.2)-->
            <bundle>mvn:com.vaadin/vaadin-icons-flow/1.3.1</bundle>
            <!--        Vaadin List Box (Flow integration 1.3.0, web component v1.1.0)-->
            <bundle>mvn:com.vaadin/vaadin-list-box-flow/1.3.0</bundle>
            <!--        Vaadin Notification (Flow integration 1.3.0, web component v1.2.1)-->
            <bundle>mvn:com.vaadin/vaadin-notification-flow/1.3.0</bundle>
            <!--        Vaadin Ordered Layout (Flow integration 1.3.0, web component v1.1.0)-->
            <bundle>mvn:com.vaadin/vaadin-ordered-layout-flow/1.3.0</bundle>
            <!--        Vaadin Progress Bar (Flow integration 1.3.0, web component v1.1.0)-->
            <bundle>mvn:com.vaadin/vaadin-progress-bar-flow/1.3.0</bundle>
            <!--        Vaadin Radio Button (Flow integration 1.3.1, web component v1.1.5)-->
            <bundle>mvn:com.vaadin/vaadin-radio-button-flow/1.3.1</bundle>
            <!--        Vaadin Split Layout (Flow integration 1.3.1, web component v4.1.0)-->
            <bundle>mvn:com.vaadin/vaadin-split-layout-flow/1.3.1</bundle>
            <!--        Vaadin Tabs (Flow integration 1.3.0, web component v2.1.2)-->
            <bundle>mvn:com.vaadin/vaadin-tabs-flow/1.3.0</bundle>
            <!--        Vaadin Text Field (Flow integration 1.3.0, web component v2.3.7)-->
            <bundle>mvn:com.vaadin/vaadin-text-field-flow/1.3.0</bundle>
            <!--        Vaadin Upload (Flow integration 1.3.0, web component v4.2.1)-->
            <bundle>mvn:com.vaadin/vaadin-upload-flow/1.3.0</bundle>
            <!--        Vaadin Custom Field (Flow integration 2.0.2, web component v1.0.1)-->
            <bundle>mvn:com.vaadin/vaadin-custom-field-flow/2.0.2</bundle>
            <!--        Vaadin App Layout (Flow integration 1.1.1, web component v1.0.2)-->
            <bundle>mvn:com.vaadin/vaadin-app-layout-flow/1.1.1</bundle>
            <!--        Vaadin Login (Flow integration 1.0.0, web component v1.0.0)-->
            <bundle>mvn:com.vaadin/vaadin-login-flow/1.0.0</bundle>
            <!--        Vaadin Board (PRO) (Flow integration 2.2.1, web component v2.1.0)-->
            <bundle>mvn:com.vaadin/vaadin-board-flow/2.2.1</bundle>
            <!--        Vaadin Charts (PRO) (Flow integration 6.3.0, web component v6.2.2)-->
            <bundle>mvn:com.vaadin/vaadin-charts-flow/6.3.0</bundle>
            <!--        Vaadin Confirm Dialog (PRO) (Flow integration 1.2.1, web component v1.1.1)-->
            <bundle>mvn:com.vaadin/vaadin-confirm-dialog-flow/1.2.1</bundle>
            <!--        Vaadin Cookie Consent (PRO) (Flow integration 1.2.1, web component v1.1.1)-->
            <bundle>mvn:com.vaadin/vaadin-cookie-consent-flow/1.2.1</bundle>
            <!--        Vaadin Crud (PRO) (Flow integration 1.1.1, web component v1.0.2)-->
            <bundle>mvn:com.vaadin/vaadin-crud-flow/1.1.1</bundle>
            <!--        Vaadin Grid Pro (PRO) (Flow integration 1.0.0, web component v1.0.4)-->
            <bundle>mvn:com.vaadin/vaadin-grid-pro-flow/1.0.0</bundle>
            <!--        Vaadin Rich Text Editor (PRO) (Flow integration 1.0.1, web component v1.0.2)-->
            <bundle>mvn:com.vaadin/vaadin-rich-text-editor-flow/1.0.1</bundle>


        </feature>

        <feature name='vaadin-flow-view-management' description='Vaadin Flow View Management' version='1.0-SNAPSHOT'>
            <details>Vaadin Flow View Management</details>
            <feature>vaadin-flow</feature>
            <bundle>mvn:net.qnenet.kSite.kViews/kViewManager/1.0-SNAPSHOT</bundle>
        </feature>

        <feature name='vaadin-flow-mainview' description='Vaadin Flow Main View' version='1.0-SNAPSHOT'>
            <details>Vaadin Flow Main View</details>
            <feature>vaadin-flow-view-management</feature>
            <feature>kUtils-system</feature>
            <bundle>mvn:net.qnenet.kSite.kViews/kMainView/1.0-SNAPSHOT</bundle>
        </feature>

</features>
/*
 * Copyright (c) 2019. QNENet
 */

package net.qnenet.kSite.kViews.kOSGiInstantiator;

import com.vaadin.flow.di.DefaultInstantiator;
import com.vaadin.flow.server.VaadinService;
import net.qnenet.kSite.kViews.kViewManager.api.KViewManager;
import org.osgi.service.component.annotations.Reference;


public class KOSGiInstantiator extends DefaultInstantiator {

    @Reference
    private KViewManager manager;

    public KOSGiInstantiator(VaadinService service) {
        super(service);
    }

    @Override
    @SuppressWarnings("unchecked")
    public <T> T getOrCreate(Class<T> type) {
        return (T) manager.getInstance(type.getCanonicalName());
    }
}

Reply via email to