Skip to main content
10-Marble
May 28, 2019
Solved

[Java SDK Tutorial] FileTransfer example and Simplethingclient, Invoke error

  • May 28, 2019
  • 2 replies
  • 2564 views

Hello,

 

I did SDK tutorial. I have some error with FileTransfer example and Simplethingclient.
I have no issue with ExampleClient and Tunnel Example and I am stuck on the following error. How could I try to solve it ?
I don't know how to solve them. I have already retry configuration of eclipse three times with different project but no progress 😕


I am able to connect to the hosted thingworx server because I receve this message :
>  [main] INFO c.t.s.simplething.SimpleThingClient - ****************Connected to ThingWorx Server****************

However, I have for the two example the same kind of error :
(SimpleThingClient example )

> com.thingworx.common.exceptions.GenericHTTPException: Unable to dispatch [ uri = /Things/SimpleThing_1/Services/CreateNewThing/]: Unable to Invoke Service CreateNewThing on SimpleThing_1 : Execution error in service script [CreateNewThing] :: Entity [EntityServices] does not exist
at com.thingworx.communications.client.BaseClient.invokeService(BaseClient.java:422) ~[thingworx-communications-client-development.server.build-b679.jar:na]
at com.thingworx.communications.client.BaseClient.invokeService(BaseClient.java:372) ~[thingworx-communications-client-development.server.build-b679.jar:na]
at com.thingworx.sdk.simplething.SimpleThingClient.main(SimpleThingClient.java:101) ~[bin/:na]

 


(FileTransferExample)

>com.thingworx.common.exceptions.GenericHTTPException: Entity SystemRepository does not exist or is not yet associated with a Thing
at com.thingworx.communications.client.BaseClient.invokeService(BaseClient.java:422)
at com.thingworx.communications.client.BaseClient.invokeService(BaseClient.java:372)
at com.thingworx.sdk.examples.FileTransferExample.main(FileTransferExample.java:47)

 

Thanks in advance for your help

Best answer by thingw0rxgenie

This is likely a permissions issue. Does the user you created the application key for have access to run CreateNewThing on EntityServices?

 

To test this, log in as the user (set their password first if you haven't already) and try to run the service. If you can't then update their permissions to allow it. Another test you can do, which shouldn't be done in a production system, is to create the app key for the administrator and test the application using the new app key.Instructions for running CreateNewThing:

 

1. Go to Resources on the left.

2. Find EntityServices.

3. Go to Services.

4. Find and run the CreateNewThing service.

2 replies

Clement_D10-MarbleAuthor
10-Marble
May 31, 2019
I am still stuck. I have made many try but I know no clue for the cause of the error. I am using SDK 6.1.0.679 and example download on thingworx.
5-Regular Member
June 13, 2019

This is likely a permissions issue. Does the user you created the application key for have access to run CreateNewThing on EntityServices?

 

To test this, log in as the user (set their password first if you haven't already) and try to run the service. If you can't then update their permissions to allow it. Another test you can do, which shouldn't be done in a production system, is to create the app key for the administrator and test the application using the new app key.Instructions for running CreateNewThing:

 

1. Go to Resources on the left.

2. Find EntityServices.

3. Go to Services.

4. Find and run the CreateNewThing service.

Clement_D10-MarbleAuthor
10-Marble
June 13, 2019

Ok, i followed your advice and I am able to create manually a thing by using the service on my online hosted server. As you can see on my capture.
I also check the application key and it seems correct.
I am only using the administrator sessions to make the tutoriel.
I try with admin key and the two example are now working however I don't understand why my application key is not working as it should. The application key isn't allow to access create new thing ?
creation_test.JPGcreation_test_res.JPG

5-Regular Member
June 13, 2019

The issue isn't the application key, but the User you assigned the key too. The application key is connected to a user, who has a set of permissions. Based on those permissions, says whether a person can access certain Resources and functionality.

 

To get your application key to work, update that permissions for that user it is attached to. You'll have to play with the permissions/user groups to find the right configuration for you. OR if you're just trying to test and not in a production environment, add that user to the Administrators user group.