According to your output, the subscription request has a short subscription id. The subscription id might be started from "uuid" string. Fix Subscription::getSID() as the following to avoid the error.
public final static String getSID(String headerValue)
{
if (headerValue == null)
return "";
if (headerValue.startsWith(Subscription.UUID) == false)
return headerValue;
return headerValue.substring(Subscription.UUID.length(), headerValue.length());
}
I will check your problem in more detail.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I tested the TV Sample with Intel Device Validator for UPnP Technologies version 1.0.1768.24077 and the result was the following:
java.lang.StringIndexOutOfBoundsException: String index out of range: -5
at java.lang.String.substring(String.java:1444)
at org.cybergarage.upnp.event.Subscription.getSID(Subscription.java:71)
at org.cybergarage.upnp.event.SubscriptionRequest.getSID(SubscriptionRequest.java:177)
at org.cybergarage.upnp.event.SubscriptionRequest.hasSID(SubscriptionRequest.java:185)
at org.cybergarage.upnp.Device.deviceEventSubscriptionRecieved(Device.java:1506)
at org.cybergarage.upnp.Device.httpRequestRecieved(Device.java:1343)
at org.cybergarage.http.HTTPServer.performRequestListener(HTTPServer.java:155)
at org.cybergarage.http.HTTPServerThread.run(HTTPServerThread.java:47)
I think this exception was thrown when the validator tried to do the command StateVariable: Power.
Joo Paulo Lima
Hi,
Actually, the exception is raised when the validator tries to unsubscribe from the power event, in the subscription tests.
Joo Paulo Lima
Hi Joo,
According to your output, the subscription request has a short subscription id. The subscription id might be started from "uuid" string. Fix Subscription::getSID() as the following to avoid the error.
public final static String getSID(String headerValue)
{
if (headerValue == null)
return "";
if (headerValue.startsWith(Subscription.UUID) == false)
return headerValue;
return headerValue.substring(Subscription.UUID.length(), headerValue.length());
}
I will check your problem in more detail.