cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Error when logging remote property data

nadams1
10-Marble

Error when logging remote property data

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.

9 REPLIES 9

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.

Thanks anyway.

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.

2016-07-07 15:39:58.351

ERROR

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.)

GatewayUser

c.t.c.p.ReflectionProcessor

WSExecutionProcessor-994

2016-07-07 15:39:58.351

ERROR

Unable to dispatch [ uri = /Things/RemoteThing2/Services/UpdateSubscribedPropertyValues/]: Unable to Invoke Service UpdateSubscribedPropertyValues on RemoteThing2 : null

GatewayUser

c.t.w.p.APIProcessor

WSExecutionProcessor-994

2016-07-07 15:39:58.351

ERROR

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!

c.t.s.s.w.p.WSExecutionInstance

WSExecutionProcessor-994

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.

Thanks

Nick

waynelove
12-Amethyst
(To:nadams1)

Hi Nick

 

I'm getting the exact same error.  Did you ever resolve this with out the need to make the user an administrator?

 

Thanks

Wayne

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?

waynelove
12-Amethyst
(To:nadams1)

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.

Aruna
6-Contributor
(To:waynelove)

Thank you, This helped me

Announcements


Top Tags