Client searching for Service with Number in Name throws Exception
-----------------------------------------------------------------
Key: FELIX-361
URL: https://issues.apache.org/jira/browse/FELIX-361
Project: Felix
Issue Type: Bug
Components: Framework
Environment: Believe it is all operating systems but found it on Linux
operating system
Reporter: Ken Robinson
Priority: Minor
Hi.
I found what may be a bug when a service name has a digit (0-9) in it.
The following exception is thrown when a client service looks up the
service.
org.osgi.framework.BundleException: Activator start error.
at org.apache.felix.framework.Felix._startBundle(Felix.java:1579)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1469)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:348)
at
org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:82)
at
org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:265)
at
org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:167)
at java.lang.Thread.run(Thread.java:712)
Caused by: org.osgi.framework.InvalidSyntaxException: expected =|~=|>=|<=
at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:75)
at org.apache.felix.framework.Felix.getServiceReferences(Felix.java:2673)
at
org.apache.felix.framework.Felix.getAllowedServiceReferences(Felix.java:2720)
at
org.apache.felix.framework.BundleContextImpl.getServiceReferences(BundleContextImpl.java:370)
at au.edu.qut.ranet.p2ps.service.itest.Activator.start(Activator.java:29)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
at org.apache.felix.framework.Felix._startBundle(Felix.java:1535)
...6 more
org.osgi.framework.InvalidSyntaxException: expected =|~=|>=|<=
It seems to emanant from Parser.java and in particular, the following
lines:
if (op == NOOP)
{
String oplist = "=|~=|>=|<=";
throw new ParseException("expected " + oplist);
}
What seems to be happening if the char is not a letter of the alphabet
it assumes it must be an operator.
This happens with the following client code.
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." );
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.