Re: Enforcing mandatory components for an application

2021-10-13 Thread Bertrand Delacretaz
On Tue, Oct 12, 2021 at 11:59 PM Neil Bartlett  wrote:
> ...But you are building a closed
> world with a well-defined set of bundles. As the application assembler you
> know that there will never be another bundle to come along and save the day...

In such cases, I think having a PERMANENT_FAILURE state for services
would be useful, and that's where you would decide to give up.

I don't think there's such a concept for OSGI services, if I had to
implement that I would probably implement my own "failed services
registry"  where services can indicate that they're hopelessly dead.
Each service can then decide on their own when that happens, probably
based on service-specific timeouts.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Automatically update bundles

2014-08-05 Thread Bertrand Delacretaz
Hi,

On Mon, Aug 4, 2014 at 5:34 PM, Tim McIver  wrote:
> ...I've begun writing code that gets the symbolic
> name of any installed plugin, then uses this to get all Resources with a
> given symbolic name from the external OBR.  Next, I would see if any of
> these Resources are a more recent version of what's installed.  Finally,
> I need the framework to use these newer bundles instead of the old
> ones...

The Sling installer might help. I'm not sure if anyone uses it outside
of Sling at the moment, but AFAIK the core is independent from Sling.

See http://sling.apache.org/documentation/bundles/osgi-installer.html
and you're welcome to ask on the Sling users list [1] for more
details.

-Bertrand

[1] http://sling.apache.org/project-information.html#mailing-lists

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: How to use a service immediately after its activation?

2014-03-24 Thread Bertrand Delacretaz
Hi Peter,

Thanks for the detailed explanation!

On Sun, Mar 23, 2014 at 4:57 PM, Peter Kriens  wrote:

> ...The beauty of it all is that with DS you can override the reference target 
> filters. So in the case you cannot change the client,
> you set the Foo.target configuration property to the desired filter...

I guess that's where I'm missing a bit, so assuming you have

@Service(property="state=migrated")
public class FooMigrator implements Foo {
...as in your example
}

You seem to imply that I can configure DS so that a client that has:

@Reference
void setFoo(Foo f) { this.f=f; }

Without any state filter actually gets the Foo service that has
state=migrated instead of the one that has no state property.

If that's correct, how is that setup?

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: How to use a service immediately after its activation?

2014-03-20 Thread Bertrand Delacretaz
Hi Peter,

On Thu, Mar 20, 2014 at 4:32 PM, Peter Kriens  wrote:
> ...The migrator depends on the raw service and registers a delegate service 
> after it has
> migrated the database. You can easily make a pipeline like this. A simple 
> service property
> will do the trick. In DS it is easy to use the target filter (that can be set 
> by config admin
> so you code is ignorant of the fact) to manage the pipeline.
>
> db -> migrator -> client
...

Looks very cool, I agree. But how do you hide the raw db service from
existing clients that currently get it via an @Reference annotation
with no specific filter?

My understanding is that a DS client that does not specify a filter
will get the first service that provides the corresponding interface,
so as soon as the raw db is available, those clients will see it.

I'm probably missing something...by "can be set by config admin" do
you mean that I can setup a default filter so that clients with no
filter only see the delegate service that the migrator registers,
because that delegate will have something like a visibleTo=allClients
service property?

> ...In general you make things surprisingly complex once you step outside the 
> standard service dependency model

Absolutely agree, so if your suggestion works without any changes to
existing clients that's fantastic.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: How to use a service immediately after its activation?

2014-03-19 Thread Bertrand Delacretaz
Hi,

On Tue, Mar 18, 2014 at 10:22 PM, Neil Bartlett  wrote:
> ...Whatever you're trying to do in your special listener, wouldn't it be
> better done inside the same bundle as the service?...

You're right, and this is similar to what Bruce suggests - the
bundle's initialization code can look for initializer services using a
whiteboard pattern, and call them before making the actual service
available.

To answer Marcel's question about the use case, the app in question is
Sling-based and uses a content repository service. When upgrading the
app you might need to make some changes to the content before the new
version of the app starts working with the content repository. So yes,
making this part of the content repository service design makes
absolute sense.

David B's hooks suggestion also looks interesting, as a generic way of
talking to services early in the setup phase.

Thanks everybody for the pointers!

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: How to use a service immediately after its activation?

2014-03-18 Thread Bertrand Delacretaz
Hi,

On Tue, Mar 18, 2014 at 7:24 PM, David Jencks  wrote:
> ...If you have a DS component with a reference to your desired service, with 
> a bind method,
> the bind method will be called at some point when the desired service is 
> available,
> whether the service or your component starts first...

Ah yes, of course...this makes me realize that what I'm actually
looking for is a way for my code to interact with the service before
DS components even see it, if that's possible.

So it looks like my core question is whether the framework or DS
provide a "service is about to be made available" hook - is there such
a thing? Barring that I guess my best option is to use a specific
start level to run my piece of code in the appropriate startup phase.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



How to use a service immediately after its activation?

2014-03-18 Thread Bertrand Delacretaz
Hi,

I'd like to interact with a given service as soon as it is created, ideally
before other clients use it.

Is it safe to use a service in the
ServiceListener.serviceChanged(ServiceReference R) method, grabbing it from
R?

I suppose there's no way to prioritize a given ServiceListener, but at
least my code would run as soon as the service becomes available.

Or is there a better way?

-Bertrand


Re: OSGi Bundle Repository (How to host them on a server)?

2013-12-03 Thread Bertrand Delacretaz
On Tue, Dec 3, 2013 at 12:03 AM, Elliot Huntington
 wrote:
> http://stackoverflow.com/questions/20337818/osgi-bundle-repositories-how-to-host-them-on-a-server

This sounds like Apache ACE, http://ace.apache.org/

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: declarative Services

2013-06-03 Thread Bertrand Delacretaz
Hi,

On Sat, Jun 1, 2013 at 12:10 AM, bokie  wrote:
> I'm quite comfortable with OSGi and Felix but have I've never used
> Declarative Services. I've started reading up on the topic and started to
> ask my self some questions...

I'm going to shamelessly plug my small example app at
https://github.com/bdelacretaz/OSGi-for-mere-mortals - I think it
demonstrates how DS simplifies OSGi, including ConfigurationAdmin.

The Dependency Manager is totally invisible to the programmer in that
example, and that's a good thing IMO.

Apache Sling is also extensively based on DS, and we're very happy
with the results - if you want concrete examples you could have a look
as well (but that's a fairly large codebase).

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Safe to retain references to OSGi bundles?

2013-04-18 Thread Bertrand Delacretaz
On Thu, Apr 18, 2013 at 3:24 PM, Robert Munteanu  wrote:
> ...The reason I need to hold on to the bundle is to load classes using that 
> its classloader
> at a later point in time...

Can't you do that using getClass().getClassLoader() on a class that's
inside that bundle?

I *think* keeping references to Bundle objects is fine if you track
them with a BundleTracker, but that sounds somewhat complicated.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Shutdown deadlock on OS X while doing AWT stuff

2013-03-05 Thread Bertrand Delacretaz
Hi,

On Tue, Mar 5, 2013 at 2:15 PM, Dan Gravell
 wrote:
> ...Stopping the
> bundles has the effect of calling:
>
> @Deactivate def shutdown() {
> awt.SystemTray.getSystemTray.getTrayIcons.foreach(systemTray.remove);
> ...

It's been a long time since I did any AWT...shouldn't that be called
with EventQueue.invokeAndWait(...) to avoid trouble with the AWT
events queue thread?

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Permission to translate your page at http://felix.apache.org/

2013-03-05 Thread Bertrand Delacretaz
Hi,

On Thu, Feb 28, 2013 at 7:36 PM, Anja Skrba  wrote:
> ...I would be grateful if you could allow me to translate your writing into
> Serbo-Croatian language, that is used in all Former Yugoslav Republics and
> to post it on my website...

>From the foundation's point of view, this is cool as long as your
website makes it clear that it is not associated with or endorsed by
the Apache Software Foundation -
http://www.apache.org/foundation/marks/ has some more info.

As long as you keep to true facts such as "this is my own translation
of the Apache Felix documentation" as opposed to "this is the
Serbo-Croatian documentation of Apache Felix", and link to the
original documentation, you're fine, and it's a great way to spread
the word!

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Configuration Admin service example?

2011-04-26 Thread Bertrand Delacretaz
Hi,

On Tue, Apr 26, 2011 at 4:46 PM, Cristiano Gavião  wrote:
> ...I found maven-scr-plugin annotation very interesting and easy...
>
> Now I'm trying figuring out how I could inject properties from a config file
> on the service using DS...

The Felix file installer (
http://felix.apache.org/site/apache-felix-file-install.html ) does
this.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Configuration Admin service example?

2011-04-26 Thread Bertrand Delacretaz
Hi,

On Tue, Apr 26, 2011 at 12:03 AM, Cristiano Gavião  wrote:
> I would like to use Configuration Admin Service with Declared Service. 
> But I
> couldn't find yet a updated tutorial with a good example

If your goal is to create Declarative Services that have configuration
parameters, the maven-scr-plugin [1] makes things very easy.

See [2] for an example which uses a number of @Property annotations
for configurable parameters.

-Bertrand

[1] http://felix.apache.org/site/apache-felix-maven-scr-plugin.html

[2] 
http://svn.apache.org/repos/asf/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Alternative to Tycho using Felix

2011-04-14 Thread Bertrand Delacretaz
Hi Benoît,

2011/4/14 Benoît Thiébault :
> ...I am currently working on a project that is managed by Maven as a
> multi-modules project, each module representing an OSGi bundle. What I would
> like to do is to automatically generate a distributable packaging of the
> project for each targeted platform. In this packaging, I would like to have
> one executable (in the form of a sh scripton Linux for instance) that would
> launch felix for instance, install and start all the required bundles.
>
> Is there such a tool ? What are the best practices to package OSGi
> applications ?...

We have something like that in Sling - our maven-launchpad-plugin [1]
takes a list of bundles, gets them from a Maven repository and can
produce a runnable jar, a war file and a karaf descriptor. It doesn't
produce a Linux script for example, but turning an executable jar into
that is not too hard.

See [2] for a concrete example, and ask on us...@sling.apache.org for more info.

-Bertrand

[1] http://sling.apache.org/site/maven-launchpad-plugin.html
[2] http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Unable to acquire global lock for resolve

2011-03-02 Thread Bertrand Delacretaz
Hi,

On Wed, Sep 29, 2010 at 6:59 PM,   wrote:
> ...Error executing command: Could not start bundle 
> mvn:org.dom4j/com.springsource.org.dom4j/1.6.1 in feature(s):
> Unresolved constraint in bundle com.springsource.org.dom4j [59]. Unable to 
> acquire global lock for resolve

I've had a similar problem in some new Sling integration tests,
details in SLING-2009

In my case the integration tests are adding and starting bundles via
the webconsole's http interface, shortly after starting up the
framework - might indicate a conflict between the webconsole and other
Sling modules calling framework operations.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: pax exam and felix

2011-02-28 Thread Bertrand Delacretaz
On Sun, Feb 27, 2011 at 7:04 PM, teemu kanstren  wrote:
>  I have been trying to learn to use Pax Exam with Felix but without much
> success...

FWIW we do use Pax Exam with Felix in Sling, see for example
http://svn.apache.org/repos/asf/sling/trunk/installer/it

but that might not use the very latest versions of those tools.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: JUnit in Felix OSGI

2011-01-28 Thread Bertrand Delacretaz
Hi,

On Thu, Jan 27, 2011 at 9:06 PM, teemu kanstren  wrote:
>... -integration with the environment (Felix, external bundles) using a
> programmatic setup of Felix and programmatic control of Felix/access to
> bundlecontext, etc

That's where pax exam would help you - we're using it in Sling, you
can see an example at
http://svn.apache.org/repos/asf/sling/trunk/installer/it

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Swing-based OSGi management console

2010-12-02 Thread Bertrand Delacretaz
Hi,

On Thu, Dec 2, 2010 at 1:45 PM, Daniel Faber  wrote:
> ...for a Swing-based desktop application with embedded OSGi framework I'm
> looking for an OSGi management console.  Something similar to the Felix
> Web Console, but with Swing GUI instead of web interface.  Are you aware
> of such a project?...

There's http://www.knopflerfish.org/desktop.html but I have no idea if
and how well it works with Felix.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: [ANN] Felix R4.2 certification

2010-10-26 Thread Bertrand Delacretaz
On Tue, Oct 26, 2010 at 3:54 PM, Richard S. Hall  wrote:
> On 10/26/10 9:36, Bertrand Delacretaz wrote:
>>
>> On Tue, Oct 26, 2010 at 3:17 PM, Richard S. Hall
>>  wrote:
>>>
>>> ...With sponsorship from Oracle, version 3.0.x of the Felix Framework and
>>> version 1.4.x of the Framework Security Provider have been certified R4.2
>>> compliant...
>>
>> Very cool, but can you elaborate on the kind of sponsorship?
>
> In order for a framework to be certified compliant, an OSGi member company
> must submit CT results and pay to have them certified by the OSGi Alliance.
> Oracle sponsored Felix framework certification since it is used in
> GlassFish

Cool, thanks very much for clarifying!
-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: [ANN] Felix R4.2 certification

2010-10-26 Thread Bertrand Delacretaz
On Tue, Oct 26, 2010 at 3:17 PM, Richard S. Hall  wrote:
> ...With sponsorship from Oracle, version 3.0.x of the Felix Framework and
> version 1.4.x of the Framework Security Provider have been certified R4.2
> compliant...

Very cool, but can you elaborate on the kind of sponsorship?

With all the noises about Oracle and Java these days, it might be good
to be more specific.

Thanks,
-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: PermGen Space and creating executable jars that require no special arguments

2010-09-14 Thread Bertrand Delacretaz
Hi Reto,

On Mon, Sep 13, 2010 at 10:51 AM, Reto Bachmann-Gmuer
 wrote:
> ...clerezza always fails to be started without setting
> "-XX:MaxPermSize=128m". I'm wondering if there are ways to either
> reduce PermGen usage or otherwise make the jar executable without any
> special argument (as with a simple double click), starting a new
> forked vm from the executable jar with the option seems a bit awkward

I needed to set JVM arguments for executable jars in a $work project
and haven't found a better way than forking.

To minimize the ugliness of that, my jar only forks if started by
double-clicking it, in which case you don't have a console, detected
using

boolean noUnixConsole = System.getenv("TERM") == null;
boolean noWindowsConsole = System.getenv("PROMPT") == null;
noConsole = noUnixConsole && noWindowsConsole;

And if running on a console I use "-fork" to mean "fork and run with
same JVM params as if jar was double-clicked".

You then have to make sure both processes exit if one of them does or
is killed, IIRC this caused some trouble under Windows.

Far from ideal - if someone has found a better way please share it!

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Managing large Karaf projects with multiple bundles

2010-08-06 Thread Bertrand Delacretaz
On Fri, Aug 6, 2010 at 1:13 PM, Felix Meschberger  wrote:
> On 06.08.2010 12:41, Charles Moulliard wrote:
>> If you don't want to use bundle start level, which solution do you use when
>> you would like to start service or bundles in a specific order ?
>
> Point about the start level is, that it is more like an administrative
> measure: A system administratore may for whatever reason decide to
> assign whatever start levels to whatever bundles

IMO a good reason is to emulate the unix run levels, where for example
level 1 is "single user", so just a management console, level 5 is
"web server active", level 10 is "application active" etc. - as you
say, for system maintenance and testing purposes.

Although start levels can be used to define bundles start order, I
don't think they were meant for that - as Felix says the start order
should be irrelevant.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Managing large Karaf projects with multiple bundles

2010-08-05 Thread Bertrand Delacretaz
Hi,

On Thu, Aug 5, 2010 at 5:06 PM,   wrote:
> My project has about 130 different bundles, which appear to need to be 
> deployed in a specific
> order because of thier dependencies

Relying on bundles start order sounds bad, OSGi best practices should
help avoid that.

Using start levels can help you define the order in which your bundles
start, but that will make management of your system much more complex
than it should be.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Custom resolver

2010-07-26 Thread Bertrand Delacretaz
On Mon, Jul 26, 2010 at 9:28 AM, Sander de Groot  wrote:
> ...ACE looks promising, I'm going to take a look.
> However, whats bothering me is that I didn't found this (these kind of)
> product while searching on google.
> It seems to me that I'm searching for the wrong keywords, mm, better
> rephrase them

OSGi's lingo is unusual sometimes, maybe due to its origins in
embedded systems and (AFAIK) telecoms.

I don't think I ever heard the word "provisioning" before starting to
work with OSGi ;-)

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Custom resolver

2010-07-22 Thread Bertrand Delacretaz
Hi,

On Thu, Jul 22, 2010 at 10:33 AM, Sander de Groot  wrote:
> ...My context is as follows: I've a cluster of servers (OSGi) and I want to
> deploy a new application to each of these servers. These new applications
> however sometimes have dependencies which are not installed on the (OSGi)
> server in question. In these cases I want the server to handle the missing
> dependencies by looking in a central repository. If the dependency is found
> then it should be installed if not: throw the unresolved dependencies
> exception

ACE might be helpful for this, http://incubator.apache.org/ace/

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: How to check if a bundle is already installed?

2010-04-14 Thread Bertrand Delacretaz
On Wed, Apr 14, 2010 at 5:00 AM, Mahammad Nasir
 wrote:
>
> Thanks, I think this will solve my problem wherever I have symbolic name. I
> have some places I have only bundle physical name. Is there any otherways to
> check based on physical name?...

The bundle filename you mean?

There's Bundle.getLocation() but that does not change if the bundle is
updated after being installed, see
http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Bundle.html#getLocation()
- so you usually cannot rely on that. The Bundle-SymbolicName/Version
combo is the only stable identifier AFAIK.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: How to check if a bundle is already installed?

2010-04-13 Thread Bertrand Delacretaz
Hi,

On Tue, Apr 13, 2010 at 11:27 AM, Mahammad Nasir
 wrote:
> ...How can i check if a bundle is already installed? i dint find any api to
> check if it is already installed...

you can do something like

   String bundleSymbolicName = ...
   Bundle[] bundles = bundleContext.getBundles();
for (Bundle bundle : bundles) {
if (bundleSymbolicName.equals(bundle.getSymbolicName())) {
return bundle;
}
}

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Webconsole hanging

2010-03-01 Thread Bertrand Delacretaz
Hi,

On Fri, Feb 26, 2010 at 11:30 PM, John E. Conlon  wrote:
>> ka...@root> start 3
...
>> ka...@root> start 37
...
> After that I WAS able to connect to the webconsole.
>
> Start levels?

Start levels shouldn't make a difference AFAIK, the console should
work if started before or after the jetty bundle...looks like
something's wrong between those two bundles, or maybe something else
is registering a servlet on the same path as the web console, and
getting in the way?

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Webconsole hanging

2010-02-26 Thread Bertrand Delacretaz
Hi,

On Fri, Feb 26, 2010 at 2:25 AM, John E. Conlon  wrote:
> Have been experiencing an intermittent hanging problem when I try to connect
> to a felix web console. By hanging I mean - connecting to the url produces a
> blank webpage - no errors just a blank page.    Sometimes it works and other
> times not (its around a 50% failure rate.)  When I make a connection to a
> newly started framework's webconsole and I get a hang the only thing I can
> do is to restart the framework.  (I am using Karaf with felix)...

Could it be that your system is stuck in a loop like FELIX-1967 ?

I've seen similar symptoms when experiencing that problem, the console
appears to be stuck because it's waiting on locks that are held for a
very long time due to Resolver.findConsistentClassSpace running in
circles.

If that's the case, thread dumps every few seconds would show that
method active at various stages, and CPU usage would be high.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Default web app integration behavior

2009-10-09 Thread Bertrand Delacretaz
Hi,

On Fri, Oct 9, 2009 at 2:01 PM, Edelson, Justin
 wrote:
> ...I can look at creating some patches against Sling that do the following:...
> * Add SNAPSHOT version support (i.e. always upgrade SNAPSHOTs)...

Sling's OSGi installer module (similar to fileinstall, but using
bundles from a JCR repository [1]) does this, and note that there's a
small gotcha: always updating snapshots can slow down startup
significantly if you have many bundles, which is suboptimal for
testing.

That module solves the problem by storing the modification dates of
the snapshots, and not upgrading bundles if those dates don't change.

-Bertrand


[1] 
http://sling.apache.org/site/jcr-installer-jcrjcrinstall-and-osgiinstaller.html

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Felix 2.0.0 download link broken

2009-09-29 Thread Bertrand Delacretaz
Hi,

On Tue, Sep 29, 2009 at 3:09 PM, Sahoo  wrote:
> http://cwiki.apache.org/confluence/display/FELIX/%5Bpreferred%5D/felix/felix-framework-2.0.0.zip
> is broken.

Just noticed that as well, it's the mirror selection script that's not
called apparently.

Using http://www.apache.org/dyn/closer.cgi/felix/ will allow you to
select a mirror, and you can then navigate down manually.

-Bertrand

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Felix inside web container

2009-01-13 Thread Bertrand Delacretaz
Hi Vinicius,

On Fri, Jan 9, 2009 at 7:12 PM, Vinicius Carvalho
 wrote:
> Bertrand Sling is amazing,...

Thanks!

> ...One thing we really would like is to use some framework to help on the
> development, I guess I'm just too lazy now that I've used Spring and Seam,
> and all the stuff they do for us (Transaction demarcation, Open Session in
> View, different scopes for beans) and I really wish I could use spring dm
> also...

I don't have experience mixing Spring DM with Sling, but [1] reports
getting that to work.

> ...I've got some great guidance from a user (really sorry, do not have the
> message now, otherwise I would name him) about GWT integration, which is
> another thing we would like to use

There is a GWT extension for Sling at [2], maybe that helps.

> ...I'm feeling like McGyver, if only I had a bubble gum, a paper clip and a
> pencil ...

I know...paradox of choice ;-)

-Bertrand

[1] http://dev.day.com/microsling/content/blogs/main/slingspringspling.html

[2] http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/gwt/

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Felix inside web container

2009-01-09 Thread Bertrand Delacretaz
Hi,

On Tue, Jan 6, 2009 at 1:28 PM, Vinicius Carvalho
 wrote:
> ...I was imagining putting the Felix inside a servlet context, much like 
> Spring
> app do. And my servlets would consume services provided by the Felix, I
> would create some special servlets front ends to install bundles, list them,
> update, and the application would only consume the services

Apache Sling does something similar, you can have a look at the code
under [1] to see how Felix is started.

Sling allows you to register servlets using SCR annotations, see [2]
for example, loading a bundle that contains that JsonQueryServlet is
enough to have it process URLs ending in ".query.json".

See http://incubator.apache.org/sling for general info about Sling.

-Bertrand

[1] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher

[2] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/JsonQueryServlet.java

-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: Error in fwk JarContent class: "Unable to open JAR file"

2008-12-09 Thread Bertrand Delacretaz
On Tue, Dec 9, 2008 at 4:01 PM, Richard S. Hall <[EMAIL PROTECTED]> wrote:
> One quick question, are you running on Windows?

Not me - I've seen the "java.util.zip.ZipException: error in opening
zip file" error on macosx while working on jcrinstall.

-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Error in fwk JarContent class: "Unable to open JAR file"

2008-12-09 Thread Bertrand Delacretaz
Hi,

On Mon, Dec 8, 2008 at 9:33 AM, Pierre De Rop
<[EMAIL PROTECTED]> wrote:
>... I am testing hot deployment on our app server (with Felix 1.4.0) and I
> discovered that, after a couple of bundle updates,
> then I end up with the following fwk exception:
>
> -> ERROR: JarContent: Unable to open JAR file. (java.util.zip.ZipException:
> error in opening zip file)
> java.util.zip.ZipException: error in opening zip file...

I remember seeing this error while working on the Sling jcrinstall
module [1], which can do lots of bundle installs/replacements in
batches.

 I didn't track that down precisely as there were other problems, but
what I found out is that bundle uninstall/install/update actions seem
to cause race conditions sometimes, when services managed by SCR are
being stopped or started at the same time.

In our case, using start levels seems to help, although in theory it
should not be required: for now, the best solution that I have found
is to (automatically, see [2]) bring the OSGi start level down before
doing such bundle updates, and raising it again when done.

Note that we're still using org.apache.felix.framework 1.0.4 in Sling,
but the problems that you describe look similar to what I've seen.

-Bertrand

[1] http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/jcrinstall/
[2] https://issues.apache.org/jira/browse/SLING-747

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JMX UI for felix shell service

2008-12-04 Thread Bertrand Delacretaz
Hi Didier,

On Thu, Dec 4, 2008 at 8:30 AM, Didier Donsez <[EMAIL PROTECTED]> wrote:
> ...I have a license issue to solve for the plugin part: the JConsolePlugin
> API is "GPL Classpath Exception" (like the OpenJDK and Glassfish) and I
> don't know if it is compatible with the ASL2

FYI, the place to ask would be [EMAIL PROTECTED], and/or create
an issue at https://issues.apache.org/jira/browse/LEGAL. When
resolved, such cases are added to the list of resolved license issues
at http://www.apache.org/legal/resolved.html

HTH,
-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Questions about building a web-application with OSGi

2008-09-30 Thread Bertrand Delacretaz
Hi,

I'm not an OSGi expert but a Sling committer, and we use OSGi in web
applications extensively there, so I'll try.

On Wed, Sep 17, 2008 at 2:04 AM, Joachim Rohde
<[EMAIL PROTECTED]> wrote:
> ...But first let me explain what I have in mind: I want to build a
> web-application that can be modularized via plugins

Pretty much what Sling does, so you might want to have a look at that
as an example.

> ...Is it just a matter of taste to let the webserver be started by the OSGi
> framework or the OSGi framework be started by a web-application or are there
> some advantages / disadvantegs that I don't see yet?...

I'd say it depends on your environment - a webapp is convenient if
you're in a webapp container environment, whereas for standalone,
runnable jar stuff you might not need a webapp container and the
former might be easier. Sling demonstrates both, in its launchpad/app
and launchpad/webapp modules.

> ...After further investigating I stumpled upon Spring-DM...

Cannot help you on the Spring parts, except maybe this blog post from
a colleague about using Spring in Sling:
http://dev.day.com/microsling/content/blogs/main/slingspringspling.html

> ...And then there is Apache Sling, which is also using Felix. But honestly I 
> am
> not quite sure, if I really got the idea of Sling and if it could be of any
> use for me. Can it?...

Sling is a web framework that is built out of OSGi bundles, and uses a
Java Content Repository for content/data storage.

As I said it might be useful as an example, or you might build your
application on it if working with JCR suits your needs.

Hope this helps, although I'm obviously based towards Sling.
-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OSGI Tools question

2008-09-11 Thread Bertrand Delacretaz
On Thu, Sep 11, 2008 at 10:20 AM, Peter Kriens <[EMAIL PROTECTED]> wrote:

> ...Overall, trying to use maven + Eclipse is a bit of a mess...

I agree, trying use the supposedly cool features of the current
Eclipse/Maven plugins did not work well for me either.

I went to back to working in a less integrated way, that still allows
me to take full advantage of both Maven and Eclipse:

-Define everything in the Maven pom (see [1] for a simple example of a
small pom-based bundle)
-Use mvn eclipse:eclipse to generate the Eclipse project files
-Don't do any compilation or building in Eclipse, and use remote
debugging instead of doing it in Eclipse

This gives me all the advantages of Eclipse for code writing and
debugging, and my Eclipse setups are throwaway, which is very useful
if you're working on several machines or in a team.

-Bertrand

[1] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/samples/webloader/service/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wait for services to be fully registered?

2008-07-28 Thread Bertrand Delacretaz
On Wed, Jun 11, 2008 at 3:31 PM, jaredmac <[EMAIL PROTECTED]> wrote:

> ...So even if I change my client to respond to bind() and unbind() methods, 
> and
> dynamically register/unregister these menu items, then the UI will work
> correctly (with menu items coming and going, I suppose), but the unit tests
> still fail. I want to avoid that

I was confronted with the same problem when writing the integration
tests for Sling [1], and my (pragmatic) solution is, when the
integration tests start, to run some initial tests repeatedly until
the results show a stable state, or a timer expires.

In the case of Sling, those initial tests execute some simple
high-level operations that only work if all services required to run
the integration tests are present. That's a somewhat brute-force way
of finding out about the state of our system, but it is simple to
understand and debug, and works for us. We are planning to integrate
this "system readyness testing" into the platform, see SLING-490.

-Bertrand

[1]  http://svn.eu.apache.org/repos/asf/incubator/sling/trunk/launchpad/webapp

[2] See waitForSlingStartup() method in
http://svn.eu.apache.org/repos/asf/incubator/sling/trunk/commons/testing/src/main/java/org/apache/sling/commons/testing/integration/HttpTestBase.java

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Re: AW: AW: AW: AW: AW: AW: AW: AW: AW: AW:...

2008-07-28 Thread Bertrand Delacretaz
Hi Daniel,

On Fri, Jul 25, 2008 at 8:58 PM, Daniel Felsing <[EMAIL PROTECTED]> wrote:
> Hiho,...

I assume it's your mailer that adds the multiple AW: prefixes to the
subject line, if that's the case it would be nice if you could fix
that - my felix inbox looks really funny today ;-)

Thanks,
-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Declarative Services with maven-bundle-plugin

2007-09-18 Thread Bertrand Delacretaz
On 9/19/07, Rodrigo Madera <[EMAIL PROTECTED]> wrote:

> ...In a normal Eclipse project I would
> add this to the manifest and all would be solved:
>
> Import-Package: org.eclipse.osgi.framework.console;version="1.0.0"

Use the  statement of maven-bundle-plugin, see
http://felix.apache.org/site/maven-bundle-plugin-bnd.html

-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Embedding and *hiding* Felix inside a jar?

2007-09-15 Thread Bertrand Delacretaz
Hi Felix,

On 9/15/07, Felix Meschberger <[EMAIL PROTECTED]> wrote:
> Let me see, whether I understand it correctly...

You do, your description matches what I'm trying to do.

> ...Probably, you will setup a class loader in whose parent is the class
> loader loading the hammer.jar. This private classloader, will know the
> Felix framework (and osgi) libraries, which you load in the Hammer

Exactly.

> ... the
> private class loader must be able to be setup from jar files embedded in
> jar files, which is AFAIK not possible with the standard URLClassLoader...

That's what I found out as well. http://one-jar.sourceforge.net/ uses
a JarClassLoader which demonstrates one way to solve this.

> ...You might want to have a look at the ClassWorlds project for a solution
> to this problem...

Cool, thanks for the pointer. Classworlds looks very interesting, and
the uberjar plugin could help as well.

-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Embedding and *hiding* Felix inside a jar?

2007-09-15 Thread Bertrand Delacretaz
On 9/15/07, Richard S. Hall <[EMAIL PROTECTED]> wrote:
> Perhaps I don't understand exactly what you are asking, but doesn't the
> example application basically do what you want?
>
> http://cwiki.apache.org/FELIX/apache-felix-application-demonstration.html...

>From the functional side of things yes, but what I'm after is some
form of shielding classloader that completely hides the fact that
Felix is used to run my tool.

Hopefully the example below is clearer:

// hammer.jar is in the classpath
// hammerl.jar embeds the Felix runtime, and a number of
// OSGi bundles, used internally

// Hammer comes from hammer.jar
Hammer h = HammerFactory.createHammer();

// This must fail: Felix classes, and classes found in mytool.jar
// except the Hammer interfaces, must be "invisible"
Class.forName("org.apache.felix.framework.Felix");

> ...Perhaps you also wish to make the bundle JAR files embedded into this
> single JAR file too? This should be fairly easy, just embed them as
> resources and then use getResource() to get a resource URL to them and
> use that URL to install them into your Felix instance...

Yes, that shouldn't be too hard, the problem lies more in the
classloader isolation described above.

Thanks for your reply - hope this clarifies what I'm after!
-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Embedding and *hiding* Felix inside a jar?

2007-09-15 Thread Bertrand Delacretaz
Hi,

For an upcoming project I'd like to use Felix to manage third-party
dependencies internally, while hiding this completely from the users
of the resulting tool, which would be delivered as a single jar file.

If for example my library has this interface:

  package tunes.looney.hammer;
  public interface Hammer {
HammerResult process(HammerInput hi)
  throws HammerException;
  }

My jar would only expose this interface and the supporting
tunes.looney.hammer.* classes to the outside world, yet use Felix
internally to manage a set of bundles to implement it.

This would not require the user of the jar to have an OSGi runtime, so
that the jar can be seen as a simple tool with no dependencies.

Has anyone done something similar?

I'm not an expert in classloaders, but I assume an isolating
classloader, which uses jars embedded inside the main jar for the
Felix and third-party stuff, would do the job (with some fun problems
to solve along the way, most probably).

This also sounds a lot like what servlet containers are doing, of course.

Thanks for any advice or pointers to existing such tools,
-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Declarative Services with maven-bundle-plugin

2007-09-15 Thread Bertrand Delacretaz
Hi Rodrigo,

On 9/15/07, Rodrigo Madera <[EMAIL PROTECTED]> wrote:
>... I'm trying to develop a Declarative Service using the maven-bundle-plugin,
> but I can't find documentation on it

The docs are at
http://felix.apache.org/site/maven-bundle-plugin-bnd.html ,  but to
create Declarative Services you should also have a look at the
maven-scr-plugin, see
http://felix.apache.org/site/maven-scr-plugin.html

-Bertrand

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]