Re: Maven - Example Felix Launcher

2010-05-21 Thread Matthias N.
Hello, in the last days I tried to build a Java App that embedds Felix and gets build by Maven2. When starting the app outside eclipse in console, I got the error: ERROR: Unable to start system bundle. (java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set) java.lang.NoClassD

Re: Dynamic Service Lookup

2010-05-21 Thread Felix Meschberger
Hi, On 20.05.2010 20:30, Carl Hall wrote: > I'm familiar with: > > @Reference(referenceInterface = MySweetInterface.class, target = > "(specialProp=certainThingIWant)") > > but am wondering if I can do something like that during the activation a > component. > > My scenario is this. I have a c

Re: webservice annotation

2010-05-21 Thread Andrea Turbati
Thank you for the answer. I add in the manifest javax.jws in the Import-Package and now it seems that I've resolved that problem, but a new one has appeared: GRAVE: interface com.sun.xml.internal.ws.developer.WSBindingProvider is not visible from class loader java.lang.IllegalArgumentExceptio

RE: Threads in OSGi

2010-05-21 Thread Larry Touve
> Are you sure its using the same thread and not a new thread and the > old one hangs? If it is a new thread but the old one hangs can you try > without the felix shell.tui bundle around? > > regards, > > Karl As usual, it seems I made a mistake. I must have been using the Runnable implementat

Re: Threads in OSGi

2010-05-21 Thread Karl Pauls
Are you sure its using the same thread and not a new thread and the old one hangs? If it is a new thread but the old one hangs can you try without the felix shell.tui bundle around? regards, Karl On Fri, May 21, 2010 at 4:12 PM, Larry Touve wrote: >> What type is "thread" (in "thread.start") ?

RE: Threads in OSGi

2010-05-21 Thread Larry Touve
> What type is "thread" (in "thread.start") ? And what exactly is > ListenerThread ? > i think you are speaking of different apis. Nothing about osgi (like Karl > just said). I have used both a Thread and a Runnable: public class ListenerThread extends Thread // or public class ListenerThread

Re: Threads in OSGi

2010-05-21 Thread Donald Whytock
If ListenerThread implements Runnable, the way to start it is ListenerThread listener = new ListenerThread(39000); new Thread(listener).start(); according to the API: http://java.sun.com/javase/6/docs/api/java/lang/Thread.html The start() method only works with extensions of Thread. Don On Fr

RE: Dynamic Service Lookup

2010-05-21 Thread Larry Touve
> Can I run this outside of an activator? Is it safe to hold an internal > reference to BundleContext after component activation? You can run this outside the activator. You can use an internal reference, or you can try this from inside the getService() method: BundleContext context = Bundl

Re: Threads in OSGi

2010-05-21 Thread Toni Menzel
On Fri, May 21, 2010 at 3:59 PM, Larry Touve wrote: >> It is the case with osgi too. Nothing differnent to standard java. >> What os are you on? >> > > I'm running Windows 7, with Felix 2.0.2 (Glassfish V3.1-SNAPSHOT). > > In standard Java, thread.start() and thread.run() have different behavior.

RE: Threads in OSGi

2010-05-21 Thread Larry Touve
> It is the case with osgi too. Nothing differnent to standard java. > What os are you on? > I'm running Windows 7, with Felix 2.0.2 (Glassfish V3.1-SNAPSHOT). In standard Java, thread.start() and thread.run() have different behavior. The run() method runs the code within the calling thread, an

Re: Dynamic Service Lookup

2010-05-21 Thread Carl Hall
Can I run this outside of an activator? Is it safe to hold an internal reference to BundleContext after component activation? On Fri, May 21, 2010 at 9:53 AM, Carl Hall wrote: > That looks perfect. What if the service being looked up ("tracked") isn't > available when this chunk of code runs?

Re: Dynamic Service Lookup

2010-05-21 Thread Carl Hall
That looks perfect. What if the service being looked up ("tracked") isn't available when this chunk of code runs? On Fri, May 21, 2010 at 9:51 AM, Larry Touve wrote: > Have you tried using a ServiceTracker with a filter? > >private T getService(Class type, String key, String value) >{

RE: Dynamic Service Lookup

2010-05-21 Thread Larry Touve
Have you tried using a ServiceTracker with a filter? private T getService(Class type, String key, String value) { String filterString = "(&(objectclass="+type.getName()+") ("+key+"="+value+"))"; logger.info("Looking up services: " + filterString); Filter filter =

Re: Threads in OSGi

2010-05-21 Thread Karl Pauls
On Fri, May 21, 2010 at 3:40 PM, Larry Touve wrote: > I'm writing a bundle that spawns threads to listen for socket connections, > and when connections occur, it spawns off socket reader threads.  After > messing around a bit, it appears as though the start() method is acting like > the run() m

Threads in OSGi

2010-05-21 Thread Larry Touve
I'm writing a bundle that spawns threads to listen for socket connections, and when connections occur, it spawns off socket reader threads. After messing around a bit, it appears as though the start() method is acting like the run() method, in that it hangs and doesn't actually create a new thr