You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Alasdair Nottingham (JIRA)" <ji...@apache.org> on 2010/03/13 01:29:27 UTC

[jira] Commented: (ARIES-250) JNDI service name lookup bugs

    [ https://issues.apache.org/jira/browse/ARIES-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844780#action_12844780 ] 

Alasdair Nottingham commented on ARIES-250:
-------------------------------------------

Both issues are solved, but I feel there must be a better solution to sorting out the problem with filters that contain a / in them. The current solution basically iterations char by char through the string.

> JNDI service name lookup bugs
> -----------------------------
>
>                 Key: ARIES-250
>                 URL: https://issues.apache.org/jira/browse/ARIES-250
>             Project: Aries
>          Issue Type: Bug
>          Components: JNDI
>    Affects Versions: 0.1
>            Reporter: Alasdair Nottingham
>            Assignee: Alasdair Nottingham
>             Fix For: 0.1
>
>
> There are two bugs related to lookups using the osgi.jndi.service.name property. These are:
> osgi:service/jdbc/myDataSource
> results in a NamingException. To work correctly first off we try looking using an interface name of jdbc and a filer of myDataSource. Since myDataSource is not a valid filter we get a FilterSyntaxException when we first query. This results in a NamingException. Instead we should ignore the exception so we fall back to a service name lookup.
> The following lookup doesn't work:
> osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/myDataSource)
> because we basically do a split on /, so we end up with:
> osg:service
> javax.sql.DataSource
> (osgi.jndi.service.name=jdbc
> /myDataSource)
> hasFilter returns false in this case which means we query for javax.sql.DataSource with a null filter so we get the wrong DataSource (well only if there are multiple).
> So two fixes:
> 1. If we have more than 3 parts we shouldn't query with interface/filter but go straight to service name.
> 2. We should ignore the / inside a filter, so we need better parsing that balances the brackets.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.