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.