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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Limit in number of users creating from an extension

ses
1-Newbie
1-Newbie

Limit in number of users creating from an extension

Hey Geeks,

I was trying to create a set of users, from an custom extension created by me.

Inside a loop, I need to create n number of users.

Please see the code snippet;

for(int k=0; k < 3 ; k++) {

  String userName = "testUser" + k;

  services.CreateUser(userName, "Test Desc", null, "pwd");

}

The first user(testUser0) was created successfully in the first iteration.

But in next iterations testUser1 and testUser2 are not created in Thingworx.

The exception I am getting is ;


com.thingworx.common.exceptions.InvalidRequestException: User limit reached; Please Upgrade to Paid Version

        at com.thingworx.system.managers.BaseManager.createEntity(BaseManager.java:211)

        at com.thingworx.contentmanagement.ImportProcessor.processImport(ImportProcessor.java:456)

        at com.thingworx.resources.entities.EntityServices.processImport(EntityServices.java:130)

        at com.thingworx.resources.entities.EntityServices.CreateUser(EntityServices.java:395)

        at com.test.CtsServiceThingTemplate.reloadPicassoDetails(CtsServiceThingTemplate.java:56)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at com.thingworx.common.processors.ReflectionProcessor.processService(ReflectionProcessor.java:170)

        at com.thingworx.handlers.ReflectionServiceHandler.processService(ReflectionServiceHandler.java:45)

        at com.thingworx.things.async.AsyncHandler.run(AsyncHandler.java:42)

        at java.lang.Thread.run(Thread.java:745)

Can anyone help on this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Sujith,

The messages states that you reached the user limit, that you should go for the paid version.

Carles.

View solution in original post

7 REPLIES 7

Hi Sujith,

The messages states that you reached the user limit, that you should go for the paid version.

Carles.

ses
1-Newbie
1-Newbie
(To:CarlesColl)

Hi Carles,

Thanks for your reply.

But I do have only 3 users created so far, and each time when I run the code I could create one more user.

ie. the new user is created in every first iteration only at the time of the for-loop execution.

With the below code, I can create n number of users in TW.

services.CreateUser(userName, "Test Desc", null, "pwd");

Issue is only when I am using this code inside a for-loop.

Thanks,

Sujith

mhollenbach
5-Regular Member
(To:ses)

Whatever server you are using is not a paid version and this is how we are limiting you from creating more users than allowed.

Meghan

Thanks Meghan and Tori, for the reply.

ttielebein
12-Amethyst
(To:ses)

Where is your ThingWorx instance hosted? Is this in a tutorial on the Developer Zone?

ses
1-Newbie
1-Newbie
(To:ttielebein)

ThingWorx instance is hosted in DeveloperZone only

ttielebein
12-Amethyst
(To:ses)

Ah, yes, so programmatic creation of users is disabled in Developer Zone instances, and that explains the error you are seeing. Sorry for the inconvenience there!

If/when you decide to buy the paid version, this will not be an issue anymore.

Hope this helps!

Tori

Top Tags