You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Mark Doyle <ma...@gmail.com> on 2014/09/25 09:38:05 UTC

Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Hi all,

I've created a custom distribution using a kar built from the karaf maven
plugin. The feature file was generated by the plugin.

When I start karaf I get the exception below. I've tried both 3.0.1 and
3.0.2-SNAPSHOT. After the exception karaf quits.

java.lang.RuntimeException: Error installing bundle listed in
startup.properties with url:
wrap:mvn:com.esotericsoftware.minlog/minlog/1.2 and startlevel: 50
at org.apache.karaf.main.Main.installAndStartBundles(Main.java:384)
at org.apache.karaf.main.Main.launch(Main.java:245)
at org.apache.karaf.main.Main.main(Main.java:167)
Caused by: java.lang.RuntimeException: Could not resolve
wrap:mvn:com.esotericsoftware.minlog/minlog/1.2
at
org.apache.karaf.main.util.SimpleMavenResolver.resolve(SimpleMavenResolver.java:59)
at org.apache.karaf.main.Main.installAndStartBundles(Main.java:377)
... 2 more


The jar is not an OSGi bundle hence the features file declaring the wrap
protocol and it IS in the system folder here:
karaf-dist-0.1.2-SNAPSHOT\system\com\esotericsoftware\minlog\minlog\1.2\minlog-1.2.jar

I've tried moving my feature between bootFeatures, startupFeatures and
installedFeatures (I don't really understand the difference by the way) for
the custom dist but it make no difference.

On another note, since this jar won't have an activator and take part in
the OSGI lifecycle layer I'm wondering why it needs to be started anyway.
Perhaps that is what boot, startup and installed are for?

Thanks again

Re: Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes, in the karaf-maven-plugin, change the scope of the kar, and define 
the feature as bootFeatures: it won't update the startup.properties file.

Regards
JB

On 09/25/2014 10:21 AM, MarkD wrote:
> Yeah, I have to reply on the nabble interface (otherwise they bounce) so I
> didn't see your reply until after I'd replied to Achim.
>
> Is there anyway around this or is it a case of waiting for this pax-wrap?
>
> The dependency is transitive from:
> <groupId>com.esotericsoftware.kryo</groupId>
> <artifactId>kryo</artifactId>
>
> so I can't change the scope.
>
> Is there a setting on the karaf maven plugin for feature packaging, perhaps?
>
>
> Thanks for the quick spot!
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Runtime-exception-resolving-system-bundle-with-the-wrap-protocol-Custom-distribution-tp4035504p4035511.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Posted by MarkD <ma...@googlemail.com>.
Yeah, I have to reply on the nabble interface (otherwise they bounce) so I
didn't see your reply until after I'd replied to Achim.

Is there anyway around this or is it a case of waiting for this pax-wrap?

The dependency is transitive from:
<groupId>com.esotericsoftware.kryo</groupId>
<artifactId>kryo</artifactId>

so I can't change the scope.

Is there a setting on the karaf maven plugin for feature packaging, perhaps?


Thanks for the quick spot!



--
View this message in context: http://karaf.922171.n3.nabble.com/Runtime-exception-resolving-system-bundle-with-the-wrap-protocol-Custom-distribution-tp4035504p4035511.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's what I said: wrap works fine in bundle:install, but it's not 
supported in etc/startup.properties (as pax-url-wrap is not yet there).

Regards
JB

On 09/25/2014 10:11 AM, MarkD wrote:
> Good idea.
>
>
> Firstly, I installed minlog manually using *bundle:install -s
> wrap:mvn:com.esotericsoftware.minlog/minlog/1.2 * into my custom karaf.
>
> This seemed to work fine:
> *94 | Active    |  80 | 0              |
> wrap_mvn_com.esotericsoftware.minlog_minlog_1.2*
>
> My feature wasn't listed for some reason so I dropped my feature kar in the
> deploy directly and installed it again with *feature:install -v <myfeature>*
> . It failed for a different reason (use constraint) but I'm sure that's not
> related.
>
> If I install the feature in vanilla karaf (3.0.1) it makes it to the use
> constraint violation as above. If I run the feature install in verbose mode
> (still vanilla) I can see it installed the esoteric minlog jar using wrap.
>
> Let me know if anything isn't clear :)
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Runtime-exception-resolving-system-bundle-with-the-wrap-protocol-Custom-distribution-tp4035504p4035508.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Posted by MarkD <ma...@googlemail.com>.
Good idea.


Firstly, I installed minlog manually using *bundle:install -s
wrap:mvn:com.esotericsoftware.minlog/minlog/1.2 * into my custom karaf.

This seemed to work fine:
*94 | Active    |  80 | 0              |
wrap_mvn_com.esotericsoftware.minlog_minlog_1.2*

My feature wasn't listed for some reason so I dropped my feature kar in the
deploy directly and installed it again with *feature:install -v <myfeature>*
. It failed for a different reason (use constraint) but I'm sure that's not
related.

If I install the feature in vanilla karaf (3.0.1) it makes it to the use
constraint violation as above. If I run the feature install in verbose mode
(still vanilla) I can see it installed the esoteric minlog jar using wrap.

Let me know if anything isn't clear :)




--
View this message in context: http://karaf.922171.n3.nabble.com/Runtime-exception-resolving-system-bundle-with-the-wrap-protocol-Custom-distribution-tp4035504p4035508.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Mark,

did you try to install the feature on a vanilla karaf first?
If it is some issue with Karaf, KAR or feature resolving it's best to start
with a vanilla Karaf and see what happens with a std. Feature, if it fails
there. Did you try to install the bundle itself in Karaf by issuing
bundle:install -s wrap:mvn:com.esotericsoftware.minlog/minlog/1.2
does that work?
If so it has to be something regarding wrap and KAR, if it fails also with
just installing this bundle, it has to be something "esoteric" issue in
your to-wrap bundle :)

regards,  Achim

2014-09-25 9:38 GMT+02:00 Mark Doyle <ma...@gmail.com>:

> Hi all,
>
> I've created a custom distribution using a kar built from the karaf maven
> plugin. The feature file was generated by the plugin.
>
> When I start karaf I get the exception below. I've tried both 3.0.1 and
> 3.0.2-SNAPSHOT. After the exception karaf quits.
>
> java.lang.RuntimeException: Error installing bundle listed in
> startup.properties with url:
> wrap:mvn:com.esotericsoftware.minlog/minlog/1.2 and startlevel: 50
> at org.apache.karaf.main.Main.installAndStartBundles(Main.java:384)
> at org.apache.karaf.main.Main.launch(Main.java:245)
> at org.apache.karaf.main.Main.main(Main.java:167)
> Caused by: java.lang.RuntimeException: Could not resolve
> wrap:mvn:com.esotericsoftware.minlog/minlog/1.2
> at
> org.apache.karaf.main.util.SimpleMavenResolver.resolve(SimpleMavenResolver.java:59)
> at org.apache.karaf.main.Main.installAndStartBundles(Main.java:377)
> ... 2 more
>
>
> The jar is not an OSGi bundle hence the features file declaring the wrap
> protocol and it IS in the system folder here:
>
> karaf-dist-0.1.2-SNAPSHOT\system\com\esotericsoftware\minlog\minlog\1.2\minlog-1.2.jar
>
> I've tried moving my feature between bootFeatures, startupFeatures and
> installedFeatures (I don't really understand the difference by the way) for
> the custom dist but it make no difference.
>
> On another note, since this jar won't have an activator and take part in
> the OSGI lifecycle layer I'm wondering why it needs to be started anyway.
> Perhaps that is what boot, startup and installed are for?
>
> Thanks again
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master

Re: Runtime exception resolving system bundle with the wrap protocol (Custom distribution)

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Mark,

it looks like minlog is not an OSGi bundle and provided in kar in 
compile scope (so added in the startup.properties). So the 
karaf-maven-plugin add it in the startup.properties with wrap: prefix.

Regards
JB

On 09/25/2014 09:38 AM, Mark Doyle wrote:
> Hi all,
>
> I've created a custom distribution using a kar built from the karaf
> maven plugin. The feature file was generated by the plugin.
>
> When I start karaf I get the exception below. I've tried both 3.0.1 and
> 3.0.2-SNAPSHOT. After the exception karaf quits.
>
> java.lang.RuntimeException: Error installing bundle listed in
> startup.properties with url:
> wrap:mvn:com.esotericsoftware.minlog/minlog/1.2 and startlevel: 50
> at org.apache.karaf.main.Main.installAndStartBundles(Main.java:384)
> at org.apache.karaf.main.Main.launch(Main.java:245)
> at org.apache.karaf.main.Main.main(Main.java:167)
> Caused by: java.lang.RuntimeException: Could not resolve
> wrap:mvn:com.esotericsoftware.minlog/minlog/1.2
> at
> org.apache.karaf.main.util.SimpleMavenResolver.resolve(SimpleMavenResolver.java:59)
> at org.apache.karaf.main.Main.installAndStartBundles(Main.java:377)
> ... 2 more
>
>
> The jar is not an OSGi bundle hence the features file declaring the wrap
> protocol and it IS in the system folder here:
> karaf-dist-0.1.2-SNAPSHOT\system\com\esotericsoftware\minlog\minlog\1.2\minlog-1.2.jar
>
> I've tried moving my feature between bootFeatures, startupFeatures and
> installedFeatures (I don't really understand the difference by the way)
> for the custom dist but it make no difference.
>
> On another note, since this jar won't have an activator and take part in
> the OSGI lifecycle layer I'm wondering why it needs to be started
> anyway. Perhaps that is what boot, startup and installed are for?
>
> Thanks again

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com