Community
Participate
Working Groups
An exception is thrown if the path indicated in Remote-Service does not include at least one '/' character (i.e. is at the root of the bundle). For example: Remote-Service: my-service.xml will throw the following exception: Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1937) at org.eclipse.ecf.osgi.services.discovery.local.BundleTrackerImpl.handleRemoteService(BundleTrackerImpl.java:180) at org.eclipse.ecf.osgi.services.discovery.local.BundleTrackerImpl.getRemoteServiceInformationFilesFromBundle(BundleTrackerImpl.java:157) at org.eclipse.ecf.osgi.services.discovery.local.BundleTrackerImpl.checkBundleAndPublishServices(BundleTrackerImpl.java:88) at org.eclipse.ecf.osgi.services.discovery.local.BundleTrackerImpl.addingBundle(BundleTrackerImpl.java:78)
Fix released to HEAD. Fix was to replace this code: String path = token.substring(0, token.lastIndexOf("/")); with this int lastSlash = token.lastIndexOf("/"); String path = (lastSlash <= 0)?"/":token.substring(0,lastSlash); This assures that if the there is no slash at all, or the slash is in the first position, the intention is to assume the file is at the bundle root ("/") Resolving as fixed. Thanks Neil for the report.