Question about bundle class loader lifecycle

2009-08-14 Thread Holger Hoffstätte
Can someone shed a ray of light on when exactly a bundle's classloader is (supposedly) made eligible for GC? I'm working with native code and while it is not required to re- or unload my bundle, it would be nice to have a better grasp of potential lifecycle issues. Right now felix (on Windows)

Re: Question about bundle class loader lifecycle

2009-08-17 Thread Holger Hoffstätte
Todor, Richard - thank you for your responses. I understand how various GC schemes work - I guess I should have asked a more concise question like does the framework explicitly keep a reference to the classloader, and if so, when is that reference released. :) However in the meantime I found out

Re: BundleCache Error Creating Archive

2009-10-14 Thread Holger Hoffstätte
Nima Kaviani wrote: I have developed a cross platform bundle that installs/uninstalls either comm-win32 or comm-linux jars to enable communication with the serial port. Everything works fine on Linux, however on windows, Felix seems to cache win32com.dll along with other files and folders at

Re: Welcome message

2009-10-22 Thread Holger Hoffstätte
Richard S. Hall wrote: On 10/22/09 14:01, Sahoo wrote: I would not call that a simple class. It will certainly be better to have a property to customize the message. +1 We have always expected people would create their own launchers for their own purposes. Now that R4.2 has standardized

Re: Welcome message

2009-10-22 Thread Holger Hoffstätte
Richard S. Hall wrote: We have always expected people would create their own launchers for their own purposes. Now that R4.2 has standardized on the framework launching API, it makes more sense than ever to roll your own launcher (or build on ours). Here we go:

Re: service factory service factory

2010-04-27 Thread Holger Hoffstätte
Donald Whytock wrote: Then it occurred to me that there are multiple types of services I'd like to do this with, which seemed to call for an abstract class, similar to ServiceBinder.GenericActivator, that could be subclassed with the ServiceImpl and the ServiceFactoryImpl. Thus serving as a

Re: Will felix treat system.bundle as org.eclipse.osgi?

2010-06-23 Thread Holger Hoffstätte
Justin Edelson wrote: the Require-Bundle header, OBR should handle it. That said, you should also raise an issue with whomever created these bundles and ask them to fix the manifests. Good luck with that. The Orbit repo at eclipse is its own little locked-in universe and makes heavy use of

Re: mvn package, multi-modules and bundles

2010-10-13 Thread Holger Hoffstätte
On Wed, Oct 13, 2010 at 3:49 AM, LongkerDandy wrote: I have the same situation. Always using mvn install. Seems to work just fine for me with maven3. :-) -h - To unsubscribe, e-mail:

Re: Enforcing Class Unloading

2010-12-01 Thread Holger Hoffstätte
On 01.12.2010 09:04, Nima Kaviani wrote: I have a question now. Is there a way to figure out these wirings programmatically. This will be standardized in OSGi 4.3. You can take a peek at the EA spec at: -h

Re: What do I do about strange package in Import-Package?

2011-01-12 Thread Holger Hoffstätte
On 12.01.2011 15:13, Clay McCoy wrote: The whole reason that I am trying to use Embed dependencies and transitive = true is so that I don't have to deal with dependencies. They are all supposed to be embedded into a self contained jar. But now I am having to deal with sun.misc. This seems

Running HTTP service on random free port

2011-01-17 Thread Holger Hoffstätte
Hi, I'm looking at the HTTP Service and was wondering if anyone can tell if or how I can let the implementation pick a free port for a service, instead of having to choose one myself? The reachable address would be communicated to the outside world by different means, but I don't want to specify

Re: Running HTTP service on random free port

2011-01-20 Thread Holger Hoffstätte
On 20.01.2011 23:50, Carl Hall wrote: This sounds pretty interesting. I'll take a stab at this and be sure to update the JIRA [1]. [1] Great! I would have gotten to it eventually but have other things on my list for now. Will gladly provide

Re: Error building commons xml-apis bundle

2011-01-31 Thread Holger Hoffstätte
On 31.01.2011 15:25, wrote: Hi I'm having a problem trying to get the xml-apis bundle to build. I'm new to Felix and to Maven, so this might all be my fault. When I The good news: not your fault. The bad news: you're doomed. execute Maven against the xml-apis

Re: maven-bundle-plugin/bnd - Generating Manifest only

2011-04-18 Thread Holger Hoffstätte
On 18.04.2011 18:26, Yuri de Wit wrote: Is it possible to only generate the OSGi Manifest with maven-bundle-plugin? Adding OSGi metadata to existing projects without changing the packaging type at: -h

Re: Bundle-NativeCode question.

2011-04-29 Thread Holger Hoffstätte
Sorry for writing so much but you asked for it.. :-) On 28.04.2011 20:08, duncan wrote: We are accessing native libraries from Java. This works outside of OSGi and in OSGi on Windows but not on Linux probably because the dll and so linking behave differently. Yes and no. They work

Re: Bundle-NativeCode question.

2011-04-29 Thread Holger Hoffstätte
On 29.04.2011 16:31, Daniel Faber wrote: wow, awesome post with great detailed explanations which I am very interested in because we had a similar problem. I have just one Thanks! I've read chapter 3.9 Loading Native Code Libraries in the OSGi spec again and it seems the framework is not

Re: Bundle-NativeCode question.

2011-04-29 Thread Holger Hoffstätte
On 29.04.2011 17:30, Richard S. Hall wrote: In that case the only way out is to first try $ORIGIN and, failing that, a fixed location like /tmp or any other directory to which your bundle can unpack the libraries and try again. It's much more difficult to get right since you really want to

Re: Felix maven-bundle-plugin transitive dependency issue

2011-06-10 Thread Holger Hoffstätte
On 10.06.2011 23:39, wrote: Do you feel that embedding all of a file's dependencies into a bundle is the right approach? I think it contravenes some of the core principles of OSGi to embed dependencies except in some rare corner-cases. I'm not Justin, but.. Yes and

Re: Native Lib on Vista (64bits) with JVM 1.6.0_26 64bits needs osname=win32

2011-06-21 Thread Holger Hoffstätte
On 21.06.2011 12:22, Elvy wrote: I'm on Windows Vista (which is 64 bits) and after switching from JVM 32bits AFAIK there are also 32bit variants of Vista and Win7.. to JVM 64bits I had to use the following on my maven-bundle-plugin for my app to properly load on Felix 3.0.8

Re: Install Object as bundle

2011-08-19 Thread Holger Hoffstätte
On 19.08.2011 15:28, wrote: Yes, that's exactly what I need to do. Do you have a recommended approach? Don't know what your service does, but creating a bundle on-the-fly is quite easy (I was surprised how easy, actually). I have some code but can't post the full version,

Re: Start order when using WeavingHook

2011-08-30 Thread Holger Hoffstätte
On 30.08.2011 12:51, Ivanhoe Abrahams wrote: I noticed that it really depends on the start order of the bundles whether my simple class gets woven or not. This is because you haven't really declared any kind of logical dependency between the bundles; if your client bundle can work without

Re: Start order when using WeavingHook

2011-08-30 Thread Holger Hoffstätte
On 30.08.2011 15:36, Richard S. Hall wrote: While I agree with you in spirit, generic caps/reqs won't really help when it comes to preventing one bundle from starting before another, since they address resolve-time dependencies, not activation-time dependencies. The weaver must be active

Fun with bundle-plugin, embedding and merging split packages

2011-10-27 Thread Holger Hoffstätte
..and now for something complicated :) I'm embedding a third-party jar and need to re-export all its packages. In theory I should be able to specify inline=true since I get the classes of the exported packages anyway, so there is no need to still keep the complete jar embedded. Turns out this

Re: Fun with bundle-plugin, embedding and merging split packages

2011-10-27 Thread Holger Hoffstätte
On 27.10.2011 16:59, Stuart McCulloch wrote: This is because embedding uses bnd's Include-Resource instruction, which is independent of the exported/private package processing. Includes are processed after the packages and currently always overwrite any existing resource. Thanks for the

Re: Compiler error with Java 7 for framework generics

2012-01-03 Thread Holger Hoffstätte
On 03.01.2012 09:42, david koch wrote: Hello, I try to use the Bundle.adapt method with Java 1.7.0_02 in the following way: Framework framework; FrameworkStartLevel startLevelObject = framework.adapt(FrameworkStartLevel.class); This is ok for the Eclipse compiler (1.7) but when I

Re: EventAdmin Asynchronous/Parallel EventHandler

2012-01-18 Thread Holger Hoffstätte
On 18.01.2012 03:35, DBinSD wrote: Does the felix implementation of the EventAdmin service support the delivery of events, asynchronously and in parallel to multiple listeners at once? It This was addressed as part of RFC 157 (Updates to EventAdmin) sometime in 2010 and accepted, though I

Re: ServiceFactory not returned on getServiceReferences()

2012-02-04 Thread Holger Hoffstätte
On 03.02.2012 15:49, Richard S. Hall wrote: I also know that the ECF guys ran into this same issue (with Equinox) and that they solved it by introducing a separate proxy bundle under which they'd register their service factories. This is what I did in my (more precisely Paremus')

Re: ClassLoader creation

2012-03-30 Thread Holger Hoffstätte
On 30.03.2012 15:03, Jochen Wiedmann wrote: On Fri, Mar 30, 2012 at 1:02 PM, Felix Meschberger wrote: If sou, you would just open an InputStream to those JAR files and had it over to BundleContext.installBundle(String, inputStream) where string would be an URL (or an URL

Re: ClassNotFoundException

2012-05-15 Thread Holger Hoffstätte
On 15.05.2012 21:34, Neil Bartlett wrote: In other words, Hibernate is stupid, and breaks modularity! It's well known to OSGi programmers as a difficult library to use. What Neil said. But not all's unwell that ends unwell. As usual there is more to it and as you can see on

Explicitly import sun.misc when non-optional - yay or nay?

2012-06-06 Thread Holger Hoffstätte
Hi, I'm trying to fix disruptor's b0rken bundle manifest and it hard-requires sun.misc, hooray. This got me thinking: considering that sun.misc often needs to be added to system packages/bootdelegation anyway, is it a good idea to still explicitly import it? I *think* it is good style in order to

Re: IOException in FilePersistenceManager during startup

2012-08-13 Thread Holger Hoffstätte
On 08/13/12 09:46, Felix Meschberger wrote: Am 10.08.2012 um 20:19 schrieb Martin Lichtin: Hi Very rarely I'm getting the following IOException during startup of a Pax-Exam(-Karaf) test: [FelixStartLevel] ERROR org.apache.felix.fileinstall - Failed to install artifact:

Re: Very beginner question: maven, netbeans. Implementing a client....

2013-02-12 Thread Holger Hoffstätte
On 02/12/13 13:21, Imóveis Nacionais wrote: How can I access server bundle interface type during compile time? By adding it into a separate -api jar for (both client and server) compile time. For runtime you can either turn that jar into a bundle as well (so that compile-time structure

Re: About finding bundle

2013-02-23 Thread Holger Hoffstätte
On 23.02.2013 09:12, Dhiego Abrantes de Oliveira Martins wrote: But, I want to find a bundle that contains an specific implementation of HiService, in this case is HiServiceImpl. This is what service properties are for (it's all in the spec). You don't really want HiServiceImpl, you want the

Re: automatic pom.xml generation from an OSGi bundle MANIFEST.MF

2013-03-06 Thread Holger Hoffstätte
On 06.03.2013 14:30, Francis ANDRE wrote: I would like to mavenize a huge OSGi application. What is the best way to automaticaly produce the pom.xml from an existing MANIFEST.MF OSGi bundle? Unless you have a database/reverse-lookup mechanism that maps packages to jars, the answer is you

Re: JDBC drivers as OSGi bundles

2013-07-02 Thread Holger Hoffstätte
On 02.07.2013 10:36, Christopher BROWN wrote: What is the best strategy for integrating JDBC drivers, such as MySQL, jTDS, and others that can start background threads or timers, so that these can be correctly stopped when the bundle is unloaded? Implementing the JDBC Service bits? See


2013-07-25 Thread Holger Hoffstätte
On Thu, Jul 25, 2013 at 3:34 PM, Neil Bartlett wrote: It's possible that there is a dependency from LeapJava.dll to Leap.dll within the native code. This is not something that OSGi can directly Not just possible but in the case of JNI stubs rather mandatory. :)