If the filter string is invalid, createFilter will throw an InvalidSyntaxException.
If that does not happen, then the filter string is fine. >From the code snippet, I don't know what the value of the mode variable is. What you should do is print out filter.toString() and see what the final filter is. We also can't see what Dictionary or ServiceReference you are attempting to match against the filter against. So it is possible the nothing matches your filter. Finally, I think the argument to the services console command must be a valid filter string. "-l bundleId" is not a valid filter string which is why you get an exception. -- BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance hargr...@us.ibm.com office: +1 386 848 1781 mobile: +1 386 848 3788 From: prof_trg <prof.tar...@gmail.com> To: equinox-dev@eclipse.org Date: 2009/11/15 07:30 Subject: [equinox-dev] some issues in creatingfilters Sent by: equinox-dev-boun...@eclipse.org Hello, I have some issues in creatingfilters.. in fact, only simple filters are accepted like : filter = context.createFilter("(" + Constants.OBJECTCLASS + "=" + IMyInterface.class.getName() + ")"); however, the filter has filtered nothing if the syntax is like the following, : filter = context.createFilter("(&(" + Constants.OBJECTCLASS + "=" + IMyInterface.class.getName() + ")" + "(" + mode + "=" + true+ "))"); when I taped the command "services -l bundleID" , an exception occured; error in character 1 "("... So w*how can I validate the syntax of filters..and what is the origin of the exception in your opinion (the previous syntax seems correct..) Regards -- View this message in context: http://old.nabble.com/some-issues-in-creatingfilters-tp26358700p26358700.html Sent from the Equinox - Dev mailing list archive at Nabble.com. _______________________________________________ equinox-dev mailing list equinox-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/equinox-dev
_______________________________________________ equinox-dev mailing list equinox-dev@eclipse.org https://dev.eclipse.org/mailman/listinfo/equinox-dev