Access JPM4J bundles by filename in Gradle

33 views
Skip to first unread message

Dave

unread,
Feb 24, 2015, 10:31:47 AM2/24/15
to bndtool...@googlegroups.com
Is there a way to access JPM4J repository bundles by filename from something like a Gradle script?

Specifically, I'm trying to create a distribution zip using Gradle and I need the Felix main JAR. The single runnable JAR created by bnd (using export) does not work for my situation. I can get the other bundles using the runbundles task, but I need the Felix main for launching everything.

Or even better, if there was something built in that would create a Felix launcher distribution.

Thanks,
Dave

BJ Hargrave

unread,
Feb 24, 2015, 10:33:15 AM2/24/15
to bndtool...@googlegroups.com
On Feb 24, 2015, at 10:31 , Dave <dhum...@gmail.com> wrote:

Is there a way to access JPM4J repository bundles by filename from something like a Gradle script?

Specifically, I'm trying to create a distribution zip using Gradle and I need the Felix main JAR. The single runnable JAR created by bnd (using export) does not work for my situation.

Why? You can unzip that jar to get the felix framework and your run bundles.

I can get the other bundles using the runbundles task, but I need the Felix main for launching everything.

Or even better, if there was something built in that would create a Felix launcher distribution.

Thanks,
Dave

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 

BJ



Dave

unread,
Feb 24, 2015, 12:06:35 PM2/24/15
to bndtool...@googlegroups.com
I need the org.apache.felix.main bundle, not the org.apache.felix.framework bundle.

BJ Hargrave

unread,
Feb 24, 2015, 12:53:43 PM2/24/15
to bndtool...@googlegroups.com
On Feb 24, 2015, at 12:06 , Dave <dhum...@gmail.com> wrote:

I need the org.apache.felix.main bundle, not the org.apache.felix.framework bundle.

Why don’t you set main as your run framework then?

On Feb 24, 2015, at 10:31 , Dave <dhum...@gmail.com> wrote:

Is there a way to access JPM4J repository bundles by filename from something like a Gradle script?

Specifically, I'm trying to create a distribution zip using Gradle and I need the Felix main JAR. The single runnable JAR created by bnd (using export) does not work for my situation.

Why? You can unzip that jar to get the felix framework and your run bundles.



 

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 

BJ



Peter Kriens

unread,
Mar 2, 2015, 3:02:01 AM3/2/15
to bndtool...@googlegroups.com
If you have the Project object you can call getRunPath(). These are the JARs (including framework) that are supposed to be on your classpath before the framework starts.

What is the reason you cannot use the executable JAR?

Kind regards,

Peter Kriens


Dave

unread,
Mar 2, 2015, 10:11:22 AM3/2/15
to bndtool...@googlegroups.com
From what I recall, there was a problem with a signed JAR file. I'm using the Bouncy Castle encryption library which is signed.

However, I'm unable to get the bundles to resolve at this point (says a bundle is importing a package that is not available, but I don't actually see that import statement in the bundle's manifest so I'm pretty confused). I would try to debug, but the Bnd launcher is killing the JVM so I can't use the shell. I'm getting this message at the end:

# ignoring timeout handler because framework is already no longer active, shutdown is orderly handled
# alive thread Thread[main,5,main]
# alive thread Thread[Gogo shell,5,main]
# stopped system bundle due to leaving run body

Is there a startup timeout that I can change? I see -runtimeout as an option. I'll have to try that out at some point I suppose.

And at least I haven't found anything built into the bnd launcher that will:
* read in OSGi framework properties from a file that is not embedded in the runnable JAR file
* load bundles from a bundle folder that is not embedded in the runnable JAR file
Are either of those possible?

Peter Kriens

unread,
Mar 3, 2015, 7:47:08 AM3/3/15
to bndtool...@googlegroups.com
On 2 mrt. 2015, at 16:11, Dave <dhum...@gmail.com> wrote:

From what I recall, there was a problem with a signed JAR file. I'm using the Bouncy Castle encryption library which is signed.

However, I'm unable to get the bundles to resolve at this point (says a bundle is importing a package that is not available, but I don't actually see that import statement in the bundle's manifest so I'm pretty confused). I would try to debug, but the Bnd launcher is killing the JVM so I can't use the shell. I'm getting this message at the end:

# ignoring timeout handler because framework is already no longer active, shutdown is orderly handled
# alive thread Thread[main,5,main]
# alive thread Thread[Gogo shell,5,main]
# stopped system bundle due to leaving run body

Is there a startup timeout that I can change? I see -runtimeout as an option. I’ll have to try that out at some point I suppose.
Just put a sleep in the test case at the end. You can also experiment with (if you’re testing as I assume):

-runproperties: tester.continuous=true


And at least I haven't found anything built into the bnd launcher that will:
* read in OSGi framework properties from a file that is not embedded in the runnable JAR file
The properties come from the -runproperties in the bndrun file. You can of course set other properties with -D on the command line.

* load bundles from a bundle folder that is not embedded in the runnable JAR file
Just install Apache Felix File install?


Are either of those possible?
I think so … :-)

Kind regards,

Peter Kriens

Dave

unread,
Mar 3, 2015, 8:51:00 AM3/3/15
to bndtool...@googlegroups.com


On Tuesday, March 3, 2015 at 7:47:08 AM UTC-5, Peter Kriens wrote:
On 2 mrt. 2015, at 16:11, Dave <dhum...@gmail.com> wrote:

From what I recall, there was a problem with a signed JAR file. I'm using the Bouncy Castle encryption library which is signed.

However, I'm unable to get the bundles to resolve at this point (says a bundle is importing a package that is not available, but I don't actually see that import statement in the bundle's manifest so I'm pretty confused). I would try to debug, but the Bnd launcher is killing the JVM so I can't use the shell. I'm getting this message at the end:

# ignoring timeout handler because framework is already no longer active, shutdown is orderly handled
# alive thread Thread[main,5,main]
# alive thread Thread[Gogo shell,5,main]
# stopped system bundle due to leaving run body

Is there a startup timeout that I can change? I see -runtimeout as an option. I’ll have to try that out at some point I suppose.
Just put a sleep in the test case at the end. You can also experiment with (if you’re testing as I assume):

-runproperties: tester.continuous=true

I'm talking about a regular bndrun export that does not have any tests. I can send you the console output to an email. I would rather not post the details online.

And at least I haven't found anything built into the bnd launcher that will:
* read in OSGi framework properties from a file that is not embedded in the runnable JAR file
The properties come from the -runproperties in the bndrun file. You can of course set other properties with -D on the command line.

That's the problem, the properties come from the -runproperties which in the end gets embedded in the exported JAR file. I want to have a Java properties file exposed to the end user so they can adjust as necessary. I suppose I could create a batch file that sets property using -D, but that is a little awkward.

* load bundles from a bundle folder that is not embedded in the runnable JAR file
Just install Apache Felix File install?

I've meant to look into that for some time. That would probably work and give us some additional features. However, it can still be useful to allow a "power" user the ability to easily delete bundles from the bundle folder when they don't want a certain bundle to be installed.

Peter Kriens

unread,
Mar 3, 2015, 12:10:38 PM3/3/15
to bndtool...@googlegroups.com
For whom are the properties intended? If they are for the framework, we could create a command line parameter for the launcher that reads then custom properties. If they are for the application code, why not just read them yourself (or better use File Install and configuration admin).

Kind regards,

Peter Kriens

Dave

unread,
Mar 9, 2015, 9:45:02 AM3/9/15
to bndtool...@googlegroups.com
These would mostly be for 3rd party bundles. We do have an XML file for reading config admin properties, but not everything uses config admin.
Reply all
Reply to author
Forward
0 new messages