I'm implementing the SimpleThing example in the Java SDK and I'm trying to log data to a value stream for Temperature.
I'm getting the following error when the logging is enabled
Unable to Invoke Service UpdateSubscribedPropertyValues on TestThing
any help would be welcome.
Nick, can you check the permissions for the user on which you try to call that service ?
Also you can open Composer with this user and check if he has access to that object first and then to the service.
Let me know if this helps.
I suspect that you're right as I have removed Users from the Everybody Orginisation. but Can't use the Java SDK anyway as it doesn't support offline message store and forward so this has now become a noot point.
Nick, regarding the "Unable to invoke Service" error, can you see the object and it's service in Composer with that particular user ? What happens when you try to log data to the Value Stream ?
The gateway user does not have access the the thing through composer.
They 'should' have visibility of the thing and they have read, write, event execute, event subscribe, and service execute permissions on all properties, events and services on the thing.
As I said in my earlier post the data in the property is updated it is just not logged.
It looks like three errors are logged when it updates the data.
ErrorCode(723f04fe-3d35-4f99-b5e0-f29112db78b2), Cause(null), Reason(Access was attempted on a null reference variable.), Possible Resolutions(Remove the reference to the null variable within your extension code.)
Unable to dispatch [ uri = /Things/RemoteThing2/Services/UpdateSubscribedPropertyValues/]: Unable to Invoke Service UpdateSubscribedPropertyValues on RemoteThing2 : null
error executing APIRequest Message: Unable to dispatch [ uri = /Things/RemoteThing2/Services/UpdateSubscribedPropertyValues/]: Unable to Invoke Service UpdateSubscribedPropertyValues on RemoteThing2 : null, sending ERROR ResponseMessage to caller!
I added the gateway user to the administrators group as a quick fix but really don't want to leave this in place due the security risk involved.
Any pointers what to do next would be greatlyfully received.
There are a lot of cases where the operation in a service is not run as the current user running the mashup. Event responses seem to be executed as System, so you need to grant the access to the operation in the error. In your case, that is the ability to execute the server UpdateSubscriptedPropertyValues on the TestThing entity. It is my experience that you'll just have to deal with these as they come up individually or grant pretty sweeping powers to the System user (which may not be a best practice).
Looking at this again, it seems that Things/RemoteThing2 resolves to null - is that because of the run time permissions on RemoteThing2?
I'm getting the exact same error. Did you ever resolve this with out the need to make the user an administrator?
Had the exact same problem myself (see my previous post) and as it always happens, after asking for help I managed to solve this myself.
The issue is a visibility problem with logged properties. You need to ensure that the user that is used to do the updates has visibility of not only the thing, but also the Value Stream and the Value Stream's persistance provider (typically ThingworxPersistenceProvider).
HTH eveyone else who has this same problem. I've wasted far to much time due to PP logging from the Thingworx platform.