Community
Participate
Working Groups
attributeid=foo,bar is parsed as [(attribute=foo), (bar)]. This causes the upper layers to discard the ServiceUrl.
Released a change that doesn't fix the root cause, but safeguards consumers from broken attributes
Created attachment 117874 [details] mylyn/context/zip
There is maybe another bug with handling ":" in the attributes. I get that error. ch.ethz.iks.slp.ServiceLocationException: service url is malformed: [service:osgi:6x://mhhb3j0c/?scope=UNDEFINED:UNDEFINED:5da1e680-f1e0-11d9-bbed-0002a5d5c51b:5da1e680-f1e0-11d9-bbed-1112a5d5c51b,objectClass=6x,version=0.0.0]. at ch.ethz.iks.slp.ServiceURL.<init>(ServiceURL.java:148) at org.osgi.impl.service.discovery.slp.SLPServiceDescriptionAdapter.createServiceURL(SLPServiceDescriptionAdapter.java:338) at org.osgi.impl.service.discovery.slp.SLPServiceDescriptionAdapter.addInterfacesAndVersionsToProperties(SLPServiceDescriptionAdapter.java:116) at org.osgi.impl.service.discovery.slp.SLPServiceDescriptionAdapter.<init>(SLPServiceDescriptionAdapter.java:78) at org.osgi.impl.service.discovery.slp.SLPHandlerImpl.publishService(SLPHandlerImpl.java:205)
(In reply to comment #1) > Released a change that doesn't fix the root cause, but safeguards consumers > from broken attributes Backported this change to release_2_1 and release_2_0 too.
I've narrowed it down to ch.ethz.iks.slp.impl.SLPMessage.stringToList(String, String) not recognizing the ABNF grammar [1] of attributes. [1] http://tools.ietf.org/html/rfc2608#page-10
Created attachment 119288 [details] patch Adds a (generated) parser for attributes to jSLP based on the ABND defined in the RFC.
(In reply to comment #3) > There is maybe another bug with handling ":" in the attributes. I get that > error. > > > ch.ethz.iks.slp.ServiceLocationException: service url is malformed: > []. > at ch.ethz.iks.slp.ServiceURL.<init>(ServiceURL.java:148) > at > org.osgi.impl.service.discovery.slp.SLPServiceDescriptionAdapter.createServiceURL(SLPServiceDescriptionAdapter.java:338) > at > org.osgi.impl.service.discovery.slp.SLPServiceDescriptionAdapter.addInterfacesAndVersionsToProperties(SLPServiceDescriptionAdapter.java:116) > at > org.osgi.impl.service.discovery.slp.SLPServiceDescriptionAdapter.<init>(SLPServiceDescriptionAdapter.java:78) > at > org.osgi.impl.service.discovery.slp.SLPHandlerImpl.publishService(SLPHandlerImpl.java:205) > Service attributes cannot be passed to the ServiceURL. The url just accepts "service:osgi:6x://mhhb3j0c" and attributes and scope can be passed to ch.ethz.iks.slp.Advertiser.register(ServiceURL, List, Dictionary).
(In reply to comment #3) > ch.ethz.iks.slp.ServiceLocationException: service url is malformed: > [service:osgi:6x://mhhb3j0c/?scope=UNDEFINED:UNDEFINED:5da1e680-f1e0-11d9-bbed-0002a5d5c51b:5da1e680-f1e0-11d9-bbed-1112a5d5c51b,objectClass=6x,version=0.0.0]. Btw. that's malformed because string misses the port like e.g. "mhhb3j0c:123". If the port would be set, "?scope..." would be takes as a service path (not attributes!).
Fix released to HEAD (/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/attr/README.txt explains how to generate the parser).
Created attachment 119370 [details] mylyn/context/zip