2017-08-17 3 views
0

私はMicrosoft Device Twinsチュートリアルavailable hereで作業しています。 maven 3.5.0とjava 1.8.0_144の使用。Azure DeviceTwinStatusCallBack - シンボルが見つかりません

私のサービスアプリケーションは何のエラーもなくビルドされていますが、問題はデバイスアプリケーションにあります。 チュートリアルからコピー&ペーストのコードの後とコマンドを使用してプロジェクトをビルドしようとしている「MVNはクリーンパッケージ-DskipTests」私は、このエラーが表示されます。私のpom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.mycompany.app</groupId> 
    <artifactId>simulated-device</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>simulated-device</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
    <groupId>com.microsoft.azure.sdk.iot</groupId> 
    <artifactId>iot-device-client</artifactId> 
    <version>1.3.33</version> 
</dependency> 
    </dependencies> 
    <build> 
    <plugins> 
    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.5</version> 
     <configuration> 
     <source>1.8</source> 
     <target>1.8</target> 
     </configuration> 
    </plugin> 
    </plugins> 
</build> 
</project> 

DeviceTwinStatusCallBackは

cannot find symbol 
[ERROR] symbol: class DeviceTwinStatusCallBack 
[ERROR] location: class com.mycompany.app.App 

ありMicrosoft Azureのドキュメントでは使用できません。誰もが考えている?解決

答えて

0

問題、私はちょうどIotHubEventCallbackを実装し、私自身のクラス作っ:

protected static class MyTwinCallback implements IotHubEventCallback 
{ 
    public void execute(IotHubStatusCode status, Object context) 
    { 
     System.out.println("IoT Hub responded to device twin operation with status " + status.name()); 
    } 
} 

を、私のstartDeviceツイン方法は、今のようになります。

client.startDeviceTwin(new MyTwinCallback(), null, dataCollector, null); 
関連する問題