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

Help for Azure IoT Hub Connector Demo Issue

SOLVED
Highlighted
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_c... , 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)

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Help for Azure IoT Hub Connector Demo Issue

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.

13 REPLIES 13

Re: Help for Azure IoT Hub Connector Demo Issue

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.

Re: Help for Azure IoT Hub Connector Demo Issue

Hi Craig,

 

Tanks for your respond,

The environment is ThingWrox 8.1 with H2 DB on windows7.

 

Thanks!

David

Re: Help for Azure IoT Hub Connector Demo Issue

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.

Re: Help for Azure IoT Hub Connector Demo Issue

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

Re: Help for Azure IoT Hub Connector Demo Issue

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.

Re: Help for Azure IoT Hub Connector Demo Issue

Hi Chris,

 

Thank you very much!

 

Everything is OK now!

 

--Wei Guo

Re: Help for Azure IoT Hub Connector Demo Issue

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

Re: Help for Azure IoT Hub Connector Demo Issue

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

Re: Help for Azure IoT Hub Connector Demo Issue

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?