Hi Niclas,

Here it is.
public class Activator implements BundleActivator
{
    /**
     * Implements BundleActivator.start().
     *
     * @param context the framework context for the bundle.
     */
    public void start( BundleContext context ) throws Exception
    {
        System.out.println("Before reference");
        // Query for all service references matching any language.
        System.out.println("Class name is " + P2PS.class.getName());
        ServiceReference[] refs =
            context.getServiceReferences(P2PS.class.getName(),
                                         "(P2PS=*)" );
        System.out.println("Got past reference");
        // Query for all service references matching any language.
        if ( refs != null )
        {
            // First, get a dictionary service and then check if the
word is correct.
            P2PS p2ps = ( P2PS ) context.getService( refs[0] );
        
            p2ps.testP2PS();
                
            // Unget the dictionary service.
            context.ungetService( refs[0] );
        }
        else
        {
            throw new RuntimeException( "I need a service to test it
properly." );
        }
    }

On 9/8/07, Niclas Hedhman <[EMAIL PROTECTED]> wrote:
> On Saturday 08 September 2007 14:04, Ken Robinson wrote:
> > Do properties normally not have numbers in them? I don't know. The
> > service did not complain when I registered it.
>
> This seems that the getServiceReferences() thinks that the string passed is a
> pattern expression and not just the objectClass itself.
>
> Could you pass on the whole code snippet that does the lookup?? Or at least do
> a System.out on the argument passed to the getServiceReferences() and mail
> that here?
>
>
> Cheers
> Niclas
>
>

Reply via email to