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

Limit in number of users creating from an extension

SOLVED
ses
Newbie
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?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Limit in number of users creating from an extension

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

Re: Limit in number of users creating from an extension

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

Re: Limit in number of users creating from an extension

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

Re: Limit in number of users creating from an extension

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

Re: Limit in number of users creating from an extension

Thanks Meghan and Tori, for the reply.

Re: Limit in number of users creating from an extension

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

Re: Limit in number of users creating from an extension

ThingWorx instance is hosted in DeveloperZone only

Re: Limit in number of users creating from an extension

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

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.