vaadin 8 wrapped jar dependency doesn't go active

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

vaadin 8 wrapped jar dependency doesn't go active

Steinar Bang
I'm trying to create a karaf 4.1.2 feature that installs vaadin 8.1.5.

One dependency is com.googlecode.gentyref.  The newest version of
gentyref I've found is this non-OSGi jar file:
 https://mvnrepository.com/artifact/com.googlecode.gentyref/gentyref/1.2.0

I've tried to add this jar as a wrap bundle in the feature file:
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="fildele.application">
    <feature name="fildele" description="filedele file sharing web application" version="1.0.0.SNAPSHOT">
        <feature prerequisite="true" dependency="false">wrap</feature>
        <feature prerequisite="false" dependency="false">pax-http-whiteboard</feature>
        <bundle start-level="80">wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0</bundle>
        <bundle start-level="80">mvn:no.priv.bang.fildele/fildele.application/1.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-shared/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-server/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-push/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-client-compiled/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-themes/8.1.5</bundle>
    </feature>
 </features>

But this feature fails in the installation:
 karaf@root()> feature:repo-add mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
 Adding feature url mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
 karaf@root()> feature:install fildele
 Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=fildele; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=fildele)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve fildele/1.0.0.SNAPSHOT: missing requirement [fildele/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=com.vaadin.server; type=osgi.bundle; version="[8.1.5,8.1.5]"; resolution:=mandatory [caused by: Unable to resolve com.vaadin.server/8.1.5: missing requirement [com.vaadin.server/8.1.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.googlecode.gentyref)(version>=1.2.0)(!(version>=2.0.0)))"]]
 karaf@root()>

When I try to install the troublesome jar directly, it doesn't go active:
 karaf@root()> bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0
 Bundle ID: 52
 karaf@root()> bundle:list
 START LEVEL 100 , List Threshold: 50
 ID | State     | Lvl | Version | Name
 ---+-----------+-----+---------+------------------------------------------------
 28 | Active    |  80 | 4.1.2   | Apache Karaf :: OSGi Services :: Event
 52 | Installed |  80 | 0       | wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
 karaf@root()> bundle:capabilities 52
 Bundle 52 is not resolved.
 karaf@root()>

The manifest.mf of data/cache/bundle52/version0.0 has no imports:
 Manifest-Version: 1.0
 Archiver-Version: Plexus Archiver
 Bnd-LastModified: 1507232709268
 Build-Jdk: 1.7.0_51
 Built-By: wouter
 Bundle-ManifestVersion: 2
 Bundle-Name: wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
 Bundle-SymbolicName: wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
 Bundle-Version: 0
 Created-By: 1.8.0_141 (Oracle Corporation)
 Export-Package: com.googlecode.gentyref
 Generated-By-Ops4j-Pax-From: wrap:mvn:com.googlecode.gentyref/gentyref/1
  .2.0
 Originally-Created-By: Apache Maven 3.2.1
 Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
 Tool: Bnd-2.3.0.201405100607

What am I doing wrong?

Thanks!


- Steinar

Reply | Threaded
Open this post in threaded view
|

Re: vaadin 8 wrapped jar dependency doesn't go active

Christian Lutz
Good Morning Steiner,

Your bundle doesnt have version specified
Bundle-Version: 0

To fix this you need to add the bundle-version to your wrap like
wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0

I hope this helps

Christian

Am 05.10.2017 um 21:48 schrieb Steinar Bang <[hidden email]>:

I'm trying to create a karaf 4.1.2 feature that installs vaadin 8.1.5.

One dependency is com.googlecode.gentyref.  The newest version of
gentyref I've found is this non-OSGi jar file:
https://mvnrepository.com/artifact/com.googlecode.gentyref/gentyref/1.2.0

I've tried to add this jar as a wrap bundle in the feature file:
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="fildele.application">
   <feature name="fildele" description="filedele file sharing web application" version="1.0.0.SNAPSHOT">
       <feature prerequisite="true" dependency="false">wrap</feature>
       <feature prerequisite="false" dependency="false">pax-http-whiteboard</feature>
       <bundle start-level="80">wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0</bundle>
       <bundle start-level="80">mvn:no.priv.bang.fildele/fildele.application/1.0.0-SNAPSHOT</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-shared/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-server/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-push/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-client-compiled/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-themes/8.1.5</bundle>
   </feature>
</features>

But this feature fails in the installation:
karaf@root()> feature:repo-add mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
Adding feature url mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
karaf@root()> feature:install fildele
Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=fildele; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=fildele)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve fildele/1.0.0.SNAPSHOT: missing requirement [fildele/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=com.vaadin.server; type=osgi.bundle; version="[8.1.5,8.1.5]"; resolution:=mandatory [caused by: Unable to resolve com.vaadin.server/8.1.5: missing requirement [com.vaadin.server/8.1.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.googlecode.gentyref)(version>=1.2.0)(!(version>=2.0.0)))"]]
karaf@root()>

When I try to install the troublesome jar directly, it doesn't go active:
karaf@root()> bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0
Bundle ID: 52
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID | State     | Lvl | Version | Name
---+-----------+-----+---------+------------------------------------------------
28 | Active    |  80 | 4.1.2   | Apache Karaf :: OSGi Services :: Event
52 | Installed |  80 | 0       | wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
karaf@root()> bundle:capabilities 52
Bundle 52 is not resolved.
karaf@root()>

The manifest.mf of data/cache/bundle52/version0.0 has no imports:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Bnd-LastModified: 1507232709268
Build-Jdk: 1.7.0_51
Built-By: wouter
Bundle-ManifestVersion: 2
Bundle-Name: wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
Bundle-SymbolicName: wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
Bundle-Version: 0
Created-By: 1.8.0_141 (Oracle Corporation)
Export-Package: com.googlecode.gentyref
Generated-By-Ops4j-Pax-From: wrap:mvn:com.googlecode.gentyref/gentyref/1
 .2.0
Originally-Created-By: Apache Maven 3.2.1
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
Tool: Bnd-2.3.0.201405100607

What am I doing wrong?

Thanks!


- Steinar

Reply | Threaded
Open this post in threaded view
|

Antw: Re: vaadin 8 wrapped jar dependency doesn't go active

sahlex
Hi.

Vaadin 8.1.4 uses gentyref version 1.2.0.vaadin1. I included that in my feature. Maybe working for 8.1.5 as well.

    <feature name="vaadin-support">
        <feature>http</feature>
        <feature>http-whiteboard</feature>
        <bundle>mvn:org.jsoup/jsoup/1.8.3</bundle>
        <bundle>mvn:com.vaadin.external/gentyref/1.2.0.vaadin1</bundle>
        <bundle start-level="75">mvn:com.vaadin/vaadin-shared/${vaadin.version}</bundle>
        <bundle start-level="76">mvn:com.vaadin/vaadin-server/${vaadin.version}</bundle>
        <bundle>mvn:com.vaadin/vaadin-osgi-integration/${vaadin.version}</bundle>
        <bundle>mvn:com.vaadin/vaadin-client-compiled/${vaadin.version}</bundle>
        <bundle>mvn:com.vaadin/vaadin-themes/${vaadin.version}</bundle>
    </feature>

Regards,
Alexander


>>>
Good Morning Steiner,

Your bundle doesnt have version specified
Bundle-Version: 0

To fix this you need to add the bundle-version to your wrap like
wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0

I hope this helps

Christian

Am 05.10.2017 um 21:48 schrieb Steinar Bang <[hidden email]>:

I'm trying to create a karaf 4.1.2 feature that installs vaadin 8.1.5.

One dependency is com.googlecode.gentyref.  The newest version of
gentyref I've found is this non-OSGi jar file:
https://mvnrepository.com/artifact/com.googlecode.gentyref/gentyref/1.2.0

I've tried to add this jar as a wrap bundle in the feature file:
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="fildele.application">
   <feature name="fildele" description="filedele file sharing web application" version="1.0.0.SNAPSHOT">
       <feature prerequisite="true" dependency="false">wrap</feature>
       <feature prerequisite="false" dependency="false">pax-http-whiteboard</feature>
       <bundle start-level="80">wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0</bundle>
       <bundle start-level="80">mvn:no.priv.bang.fildele/fildele.application/1.0.0-SNAPSHOT</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-shared/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-server/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-push/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-client-compiled/8.1.5</bundle>
       <bundle start-level="80">mvn:com.vaadin/vaadin-themes/8.1.5</bundle>
   </feature>
</features>

But this feature fails in the installation:
karaf@root()> feature:repo-add mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
Adding feature url mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
karaf@root()> feature:install fildele
Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=fildele; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=fildele)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve fildele/1.0.0.SNAPSHOT: missing requirement [fildele/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=com.vaadin.server; type=osgi.bundle; version="[8.1.5,8.1.5]"; resolution:=mandatory [caused by: Unable to resolve com.vaadin.server/8.1.5: missing requirement [com.vaadin.server/8.1.5] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.googlecode.gentyref)(version>=1.2.0)(!(version>=2.0.0)))"]]
karaf@root()>

When I try to install the troublesome jar directly, it doesn't go active:
karaf@root()> bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0
Bundle ID: 52
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID | State     | Lvl | Version | Name
---+-----------+-----+---------+------------------------------------------------
28 | Active    |  80 | 4.1.2   | Apache Karaf :: OSGi Services :: Event
52 | Installed |  80 | 0       | wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
karaf@root()> bundle:capabilities 52
Bundle 52 is not resolved.
karaf@root()>

The manifest.mf of data/cache/bundle52/version0.0 has no imports:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Bnd-LastModified: 1507232709268
Build-Jdk: 1.7.0_51
Built-By: wouter
Bundle-ManifestVersion: 2
Bundle-Name: wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
Bundle-SymbolicName: wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
Bundle-Version: 0
Created-By: 1.8.0_141 (Oracle Corporation)
Export-Package: com.googlecode.gentyref
Generated-By-Ops4j-Pax-From: wrap:mvn:com.googlecode.gentyref/gentyref/1
 .2.0
Originally-Created-By: Apache Maven 3.2.1
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
Tool: Bnd-2.3.0.201405100607

What am I doing wrong?

Thanks!


- Steinar

Reply | Threaded
Open this post in threaded view
|

Re: vaadin 8 wrapped jar dependency doesn't go active

Steinar Bang
In reply to this post by Christian Lutz
>>>>> Christian Lutz <[hidden email]>:

> Your bundle doesnt have version specified
>> Bundle-Version: 0

Yes, I noticed, but I didn't know how to change this.

I wrapped two jars in vaadin 7.x with TouchKit, and they also had
bundle-version 0, but there it wasn't a problem.

> To fix this you need to add the bundle-version to your wrap like
>> wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0

Right! I wondered about that but I wasn't able to google up how to do it
last night.

Thanks!

> I hope this helps

Thanks! I will try it out?

Reply | Threaded
Open this post in threaded view
|

Re: vaadin 8 wrapped jar dependency doesn't go active

Steinar Bang
In reply to this post by sahlex
>>>>> <[hidden email]>:

> Hi.
> Vaadin 8.1.4 uses gentyref version 1.2.0.vaadin1. I included that in my feature. Maybe working for 8.1.5 as well.

>     <feature name="vaadin-support">
>    <feature>http</feature>
>    <feature>http-whiteboard</feature>
>    <bundle>mvn:org.jsoup/jsoup/1.8.3</bundle>
>    <bundle>mvn:com.vaadin.external/gentyref/1.2.0.vaadin1</bundle>
>    <bundle start-level="75">mvn:com.vaadin/vaadin-shared/${vaadin.version}</bundle>
>    <bundle start-level="76">mvn:com.vaadin/vaadin-server/${vaadin.version}</bundle>
>    <bundle>mvn:com.vaadin/vaadin-osgi-integration/${vaadin.version}</bundle>
>    <bundle>mvn:com.vaadin/vaadin-client-compiled/${vaadin.version}</bundle>
>    <bundle>mvn:com.vaadin/vaadin-themes/${vaadin.version}</bundle>
>     </feature>

Thanks for the tip!

It seems like 1.2.0.vaadin1 can be fetched from maven central, so I
won't need to set up an extra repo:
karaf@root()> bundle:install mvn:com.vaadin.external/gentyref/1.2.0.vaadin1
Bundle ID: 127
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
 ID | State     | Lvl | Version               | Name
----+-----------+-----+-----------------------+---------------------------------------
 28 | Active    |  80 | 4.1.2                 | Apache Karaf :: OSGi Services :: Event
127 | Installed |  80 | 1.2.0.vaadin1         | GenTyRef
karaf@root()>

I think I will try this!

Thanks again!

Reply | Threaded
Open this post in threaded view
|

Re: vaadin 8 wrapped jar dependency doesn't go active

Steinar Bang
In reply to this post by Steinar Bang
>>>>> Steinar Bang <[hidden email]>:

>>>>> Christian Lutz <[hidden email]>:
>> Your bundle doesnt have version specified
>>> Bundle-Version: 0

>> To fix this you need to add the bundle-version to your wrap like
>> wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0

> Right! I wondered about that but I wasn't able to google up how to do it
> last night.

I wasn't able to make this work.

When doing it it a feature file I needed to use "&amp;" instead of "&"
to avoid an XML parsing error:
        <bundle start-level="80">wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&amp;Bundle-Version=1.2.0</bundle>

However, the resulting file failed in installation:
 karaf@root()> feature:repo-add mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
 Adding feature url mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
 karaf@root()> feature:install fildele
 Error executing command: Error:
         Error downloading mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0
         Error downloading mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0
 karaf@root()>


When trying to use this URL on the karaf console, it looks like karaf
tried to send the argument part in the background:

 karaf@root()> bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0
 [1]  background  bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0
 1.2.0
 karaf@root()> bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0&Bundle-Version=1.2.0
 karaf@root()> bundle:list
 START LEVEL 100 , List Threshold: 50
 ID | State     | Lvl | Version | Name
 ---+-----------+-----+---------+--------------------------------------------------------------------
 28 | Active    |  80 | 4.1.2   | Apache Karaf :: OSGi Services :: Event
 52 | Installed |  80 | 0       | wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
 karaf@root()> bundle:uninstall 52
 karaf@root()> bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0\&Bundle-Version=1.2.0
 [2]  background  bundle:install wrap:mvn:com.googlecode.gentyref/gentyref/1.2.0
 1.2.0
 karaf@root()> bundle:list
 START LEVEL 100 , List Threshold: 50
 ID | State     | Lvl | Version | Name
 ---+-----------+-----+---------+--------------------------------------------------------------------
 28 | Active    |  80 | 4.1.2   | Apache Karaf :: OSGi Services :: Event
 53 | Installed |  80 | 0       | wrap_mvn_com.googlecode.gentyref_gentyref_1.2.0
 karaf@root()>

Reply | Threaded
Open this post in threaded view
|

Re: vaadin 8 wrapped jar dependency doesn't go active

Steinar Bang
In reply to this post by Steinar Bang
>>>>> Steinar Bang <[hidden email]>:

> It seems like 1.2.0.vaadin1 can be fetched from maven central, so I
> won't need to set up an extra repo:
> karaf@root()> bundle:install mvn:com.vaadin.external/gentyref/1.2.0.vaadin1
> Bundle ID: 127
> karaf@root()> bundle:list
> START LEVEL 100 , List Threshold: 50
>  ID | State     | Lvl | Version               | Name
> ----+-----------+-----+-----------------------+---------------------------------------
>  28 | Active    |  80 | 4.1.2                 | Apache Karaf :: OSGi Services :: Event
> 127 | Installed |  80 | 1.2.0.vaadin1         | GenTyRef
> karaf@root()>

> I think I will try this!

Now the feature installed:
 karaf@root()> feature:repo-add mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
 Adding feature url mvn:no.priv.bang.fildele/fildele.application/LATEST/xml/features
 karaf@root()> feature:install fildele
 karaf@root()> bundle:list
 START LEVEL 100 , List Threshold: 50
 ID | State  | Lvl | Version        | Name
 ---+--------+-----+----------------+--------------------------------------
 28 | Active |  80 | 4.1.2          | Apache Karaf :: OSGi Services :: Event
 52 | Active |  80 | 8.1.5          | Default Widgetset
 53 | Active |  80 | 1.2.0.vaadin1  | GenTyRef
 54 | Active |  80 | 8.1.5          | Vaadin Push
 55 | Active |  80 | 8.1.5          | Vaadin Server
 56 | Active |  80 | 8.1.5          | Vaadin Shared
 57 | Active |  80 | 8.1.5          | Vaadin Themes
 62 | Active |  80 | 1.0.0.SNAPSHOT | filedele file sharing web application
 99 | Active |  80 | 1.8.3          | jsoup
 karaf@root()>


The feature file used was this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="fildele.application">
    <feature name="fildele" description="filedele file sharing web application" version="1.0.0.SNAPSHOT">
        <feature prerequisite="false" dependency="false">pax-http-whiteboard</feature>
        <bundle start-level="80">mvn:no.priv.bang.fildele/fildele.application/1.0.0-SNAPSHOT</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-shared/8.1.5</bundle>
        <bundle start-level="80">mvn:org.jsoup/jsoup/1.8.3</bundle>
        <bundle start-level="80">mvn:com.vaadin.external/gentyref/1.2.0.vaadin1</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-server/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-push/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-client-compiled/8.1.5</bundle>
        <bundle start-level="80">mvn:com.vaadin/vaadin-themes/8.1.5</bundle>
    </feature>
</features>