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

Steam Sensor Java SDK

SOLVED
Highlighted
Regular Member

Steam Sensor Java SDK

Hi,

While running the steam sensor example of Java SDK (latest one Java-SDK-6-0-4-595), I am getting below error:


Exception in thread "main" com.thingworx.communications.client.things.exceptions.DuplicateCharacteristicException: Service already defined: GetSteamSensorReadings

at com.thingworx.communications.client.things.VirtualThing.createServiceProcessorsFromThingShape(VirtualThing.java:717)

at com.thingworx.communications.client.things.VirtualThing.initializeFromAnnotations(VirtualThing.java:667)

at com.thingworx.sdk.steam.SteamThing.init(SteamThing.java:93)

at com.thingworx.sdk.steam.SteamThing.<init>(SteamThing.java:78)

at com.thingworx.sdk.steam.SteamSensorClient.main(SteamSensorClient.java:67)

In this example, I also passed the arguments as ws://localhost:80/Thingworx/WS 625807eb-43ef-40b0-b68f-9f5c6f308bbd 1000 1 10.


I tried to debug it but was not able to run this example through eclipse.

Can anyone have tried this example? I am using the latest Java SDK from PTC support site. and the Java SDK file name is MED-61061-CD-055_M030_Java-SDK-6-0-4-595.

Thanks,

Aditya

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Steam Sensor Java SDK

In the SteamThing.java class, where the initializeFromAnnotations() method was called twice.

Once in the creation of the constructor and then again later. So, I removed the 2nd instance of the initializeFromAnnotations() method, and then it started working after compiling the code.

View solution in original post

4 REPLIES 4
Highlighted

Re: Steam Sensor Java SDK

Hi Aditya, can you confirm if there are no two services of same name as noted in the error GetSteamSensorReadings

Highlighted

Re: Steam Sensor Java SDK

Hi Sushant,

Thank you for the response.

There are no two services of the same name. Please find attached below the code too.

If I am commenting the GetSteamSensorReadings service, then the same error I am also getting for AddNumbers service too.

Regards,

Aditya

Highlighted

Re: Steam Sensor Java SDK

It is the Java SDK Java-SDK-6-0-4-595. The latest one.

Highlighted

Re: Steam Sensor Java SDK

In the SteamThing.java class, where the initializeFromAnnotations() method was called twice.

Once in the creation of the constructor and then again later. So, I removed the 2nd instance of the initializeFromAnnotations() method, and then it started working after compiling the code.

View solution in original post

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!