You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Ken Robinson (JIRA)" <ji...@apache.org> on 2007/09/10 06:08:29 UTC

[jira] Created: (FELIX-361) Client searching for Service with Number in Name throws Exception

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.


[jira] Closed: (FELIX-361) Client searching for Service with Number in Name throws Exception

Posted by "Ken Robinson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ken Robinson closed FELIX-361.
------------------------------


Now works

> 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
>            Assignee: Karl Pauls
>            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.


[jira] Resolved: (FELIX-361) Client searching for Service with Number in Name throws Exception

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls resolved FELIX-361.
------------------------------

    Resolution: Fixed

I fixed a couple of issues with the LDAP filter most noticeably, attributes where limited to [a-zA-Z ] so didn't allow for e.g., numbers. Furthermore, I added some functionality to match the 4.1 spec (values may now be Collections not only Vectors). 

Thanks goes to Angelo van der Sijpt and Jorg Hollenberg for providing me with valuable test cases (and pointing out the diff between the 4.0 and 4.1 spec). 

> 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
>            Assignee: Karl Pauls
>            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.


[jira] Assigned: (FELIX-361) Client searching for Service with Number in Name throws Exception

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-361?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls reassigned FELIX-361:
--------------------------------

    Assignee: Karl Pauls

> 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
>            Assignee: Karl Pauls
>            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.