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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Help for Azure IoT Hub Connector Demo Issue

DavidShen
5-Regular Member

Help for Azure IoT Hub Connector Demo Issue

Hello everyone,

I'm try to practice the Azure IoT Hub Connector, I follow the guide at http://support.ptc.com/help/thingworx_hc/thingworx_cx_services/#page/thingworx_cx_services%2Fazure_connector%2Fc_azure_connector_hc_top_level_page.html%23 , the connector service is work as well.

but when I try the next step to launch the "Edge Device Demo", I got error as below. can anyone help me to identify the problem?

C:\Thingworx-Azure-IoT-Hub-Connector-2.0.0.141\demo\edge-device-demo\bin>edge-de
vice-demo.bat
09:56:28.252 [main] DEBUG c.t.p.a.i.d.AzureIotEdgeDeviceDemo - Started at:151961
0188252
09:56:30.094 [main] DEBUG c.t.p.a.i.d.AzureIotEdgeDeviceDemo - Device already ex
ists, returning it: id=azuredevice952
09:56:30.094 [main] INFO c.t.p.a.i.d.AzureIotEdgeDeviceDemo - Edge device: id=a
zuredevice952, primaryKey=KuouH1edP/CERlVGNY/PMQ==, secondaryKey=DhAS9P15S0CcbhG
+ClVVqA==, eTag=Nzg1NTQzOTE2
log4j:WARN No appenders could be found for logger (com.microsoft.azure.sdk.iot.d
evice.IotHubConnectionString).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
fo.
Exception in thread "main" groovy.lang.MissingMethodException: No signature of m
ethod: java.lang.Long.call() is applicable for argument types: (java.lang.Long)
values: [2]
Possible solutions: wait(long), wait(), any(), abs(), abs(), wait(long, int)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptByteco
deAdapter.java:58)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaC
lassSite.java:49)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSi
teArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:125)
at com.thingworx.protocol.azure.iot.demo.AzureIotEdgeDeviceDemo$_main_cl
osure2.doCall(AzureIotEdgeDeviceDemo.groovy:122)
at com.thingworx.protocol.azure.iot.demo.AzureIotEdgeDeviceDemo$_main_cl
osure2.doCall(AzureIotEdgeDeviceDemo.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(C
losureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
at groovy.lang.Closure.call(Closure.java:426)
at groovy.lang.Closure.call(Closure.java:420)
at groovy.json.JsonDelegate.cloneDelegateAndGetContent(JsonDelegate.java
:78)
at groovy.json.JsonBuilder.call(JsonBuilder.java:208)
at groovy.json.JsonBuilder$call.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSi
teArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
llSite.java:125)
at com.thingworx.protocol.azure.iot.demo.AzureIotEdgeDeviceDemo.main(Azu
reIotEdgeDeviceDemo.groovy:116)

ACCEPTED SOLUTION

Accepted Solutions

Seems a bug of the Groovy JsonBuilder of Azure IoT Connector 2.0, I have recompiled the code and please unzip attachment and copy the jar file to replace the same one under demo\edge-device-demo\lib, everything is OK.

View solution in original post

13 REPLIES 13
CRArko
17-Peridot
(To:DavidShen)

Hi, David.

 

Can you tell me just a bit more about your setup; like what version of ThingWorx and what DB you are using? I'm going to follow the same procedure and see if I can reproduce the error.

 

Thanks!

 

-- Craig A.

DavidShen
5-Regular Member
(To:CRArko)

Hi Craig,

 

Tanks for your respond,

The environment is ThingWrox 8.1 with H2 DB on windows7.

 

Thanks!

David

CRArko
17-Peridot
(To:DavidShen)

Okay, it will take me a bit to set up a test system, but then I'll walk through the documented process and see if I get the same error.

 

-- Craig A.

DavidShen
5-Regular Member
(To:CRArko)

Thanks, Craig,

 

these more information is when I just launch the Azhre IOT Hub Connector( still not run the edge demo), the TWX report a issue:Could not dispatch async service request [NotifyPropertyUpdate] : Service not implemented. more detail please reference the attachment.New Bitmap Image.jpg

Seems a bug of the Groovy JsonBuilder of Azure IoT Connector 2.0, I have recompiled the code and please unzip attachment and copy the jar file to replace the same one under demo\edge-device-demo\lib, everything is OK.

DavidShen
5-Regular Member
(To:ShengLiangQiu)

Hi Chris,

 

Thank you very much!

 

Everything is OK now!

 

--Wei Guo

Hi,

 

Whenever I am running the windows bat file edge-device-demo.bat after setting environment variable EDGE_DEVICE_DEMO_OPTS="-Dconfig.file=../conf/edge-device.conf" I am getting below error 

Error: Could not find or load main class C:\ThingWorx-Azure-IoT-Hub-Connector-2-0-0\Thingworx-Azure-IoT-Hub-Connector-2.0.0.141\demo\edge-device-demo\conf\edge-device.conf

 

Please let me know what I am doing wrong here.

 

Thanks,

Azim

You may put the parameter in the bat file like below to see if it works or not:

@rem Add default JVM options here. You can also use JAVA_OPTS and EDGE_DEVICE_DEMO_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set EDGE_DEVICE_DEMO_OPTS=-Dconfig.file=C:\Working\AzureIoTConnector200\demo\edge-device-demo\conf\edge-device.conf
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

I got past the same error but I don´t see the values refreshing in the Thing I´ve created, 

 

this is what I see from the edge-device-demo:

13:00:10.724 [pool-3-thread-1] INFO c.t.p.a.i.d.AzureIotEdgeDeviceDemo - Send e
vent response: status=OK_EMPTY, context={}

 

Is this correct?, why is it not updating the values? any help?

Please make sure that you follow the azure IoT connector guide strictly first, then if you happen to see:

Exception in thread "main" groovy.lang.MissingMethodException: No signature of m
ethod: java.lang.Long.call() is applicable for argument types: (java.lang.Long)
values: [2]

in the client console, then use the zip file I posted, unzip it and copy the azure-iot-edge-demo-2.0.0.141.jar file  to replace the original one (remember to backup first), then restart the client, it should be OK. Otherwise please provide the log file for further debug.

AnnaAn
14-Alexandrite
(To:ShengLiangQiu)

@ShengLiangQiu,

Could you explain more for your building tools?

Are you also using the Groovy JsonBuilder with a different version?

This will help us understand more for the issue and note it down in our knowledge base.

 

Thanks,

 

Br,

Anna

AnnaAn
14-Alexandrite
(To:ShengLiangQiu)


@ShengLiangQiu wrote:

Seems a bug of the Groovy JsonBuilder of Azure IoT Connector 2.0, I have recompiled the code and please unzip attachment and copy the jar file to replace the same one under demo\edge-device-demo\lib, everything is OK.



@ShengLiangQiu,

Could you explain more for your building tools?

Are you also using the Groovy JsonBuilder with a different version?

This will help us understand more for the issue and note it down in our knowledge base.

 

Thanks,

 

Br,

Anna

Anna, the building tool is eclipse, groovy-all-2.4.5.jar to build the new version.

Announcements


Top Tags