Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

Compilation errors #64

Closed deepub closed 5 years ago

deepub commented 6 years ago

Hi There,

I downloaded the v2.0.1 release and attempted to compile it. I am getting a bunch of compilation errors reproduced below.

$ mvn clean install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] Azure Cosmos DB SQL API [INFO] Async SDK for SQL API of Azure Cosmos DB Service [INFO] Async SDK for SQL API of Azure Cosmos DB Service - Examples [INFO] Async SDK for SQL API of Azure Cosmos DB Service - Benchmarking tool [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Azure Cosmos DB SQL API 2.0.1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ azure-cosmosdb-parent --- [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ azure-cosmosdb-parent --- [INFO] Installing /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/pom.xml to /Users/dbhati2/.m2/repository/com/microsoft/azure/azure-cosmosdb-parent/2.0.1/azure-cosmosdb-parent-2.0.1.pom [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Async SDK for SQL API of Azure Cosmos DB Service 2.0.1 [INFO] ------------------------------------------------------------------------ Downloading: http://xxx/content/groups/public/org/apache/maven/plugins/maven-javadoc-plugin/2.9.1/maven-javadoc-plugin-2.9.1.pom Downloaded: http://xxx/content/groups/public/org/apache/maven/plugins/maven-javadoc-plugin/2.9.1/maven-javadoc-plugin-2.9.1.pom (16 KB at 40.0 KB/sec) Downloading: http://xxx/content/groups/public/org/apache/maven/plugins/maven-javadoc-plugin/2.9.1/maven-javadoc-plugin-2.9.1.jar Downloaded: http://xxx/content/groups/public/org/apache/maven/plugins/maven-javadoc-plugin/2.9.1/maven-javadoc-plugin-2.9.1.jar (360 KB at 194.0 KB/sec) [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ azure-cosmosdb --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ azure-cosmosdb --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/sdk/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ azure-cosmosdb --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 184 source files to /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/sdk/target/classes [INFO] /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/sdk/src/main/java/com/microsoft/azure/cosmosdb/JsonSerializable.java: Some input files use unchecked or unsafe operations. [INFO] /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/sdk/src/main/java/com/microsoft/azure/cosmosdb/JsonSerializable.java: Recompile with -Xlint:unchecked for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/sdk/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/caches/AsyncCache.java:[93,60] no suitable method found for flatMap((vaule)->{[...](); },(err)->{ l[...](); },()->Observ[...]pty()) method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>) is not applicable (cannot infer type-variable(s) R (actual and formal argument lists differ in length)) method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>,int) is not applicable (cannot infer type-variable(s) R (actual and formal argument lists differ in length)) method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>,rx.functions.Func1<? super java.lang.Throwable,? extends rx.Observable<? extends R>>,rx.functions.Func0<? extends rx.Observable<? extends R>>) is not applicable (no instance(s) of type variable(s) T exist so that rx.Observable conforms to ? extends rx.Observable<? extends R>) method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>,rx.functions.Func1<? super java.lang.Throwable,? extends rx.Observable<? extends R>>,rx.functions.Func0<? extends rx.Observable<? extends R>>,int) is not applicable (cannot infer type-variable(s) R (actual and formal argument lists differ in length)) method rx.Observable.<U,R>flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends U>>,rx.functions.Func2<? super TValue,? super U,? extends R>) is not applicable (cannot infer type-variable(s) U,R (actual and formal argument lists differ in length)) method rx.Observable.<U,R>flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends U>>,rx.functions.Func2<? super TValue,? super U,? extends R>,int) is not applicable (cannot infer type-variable(s) U,R (argument mismatch; int is not a functional interface)) [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Azure Cosmos DB SQL API ............................ SUCCESS [ 0.208 s] [INFO] Async SDK for SQL API of Azure Cosmos DB Service ... FAILURE [ 4.723 s] [INFO] Async SDK for SQL API of Azure Cosmos DB Service - Examples SKIPPED [INFO] Async SDK for SQL API of Azure Cosmos DB Service - Benchmarking tool SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.026 s [INFO] Finished at: 2018-08-31T13:40:30-07:00 [INFO] Final Memory: 20M/116M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project azure-cosmosdb: Compilation failure [ERROR] /Users/dbhati2/Downloads/azure-cosmosdb-java-2.0.1/sdk/src/main/java/com/microsoft/azure/cosmosdb/rx/internal/caches/AsyncCache.java:[93,60] no suitable method found for flatMap((vaule)->{[...](); },(err)->{ l[...](); },()->Observ[...]pty()) [ERROR] method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>) is not applicable [ERROR] (cannot infer type-variable(s) R [ERROR] (actual and formal argument lists differ in length)) [ERROR] method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>,int) is not applicable [ERROR] (cannot infer type-variable(s) R [ERROR] (actual and formal argument lists differ in length)) [ERROR] method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>,rx.functions.Func1<? super java.lang.Throwable,? extends rx.Observable<? extends R>>,rx.functions.Func0<? extends rx.Observable<? extends R>>) is not applicable [ERROR] (no instance(s) of type variable(s) T exist so that rx.Observable conforms to ? extends rx.Observable<? extends R>) [ERROR] method rx.Observable.flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends R>>,rx.functions.Func1<? super java.lang.Throwable,? extends rx.Observable<? extends R>>,rx.functions.Func0<? extends rx.Observable<? extends R>>,int) is not applicable [ERROR] (cannot infer type-variable(s) R [ERROR] (actual and formal argument lists differ in length)) [ERROR] method rx.Observable.<U,R>flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends U>>,rx.functions.Func2<? super TValue,? super U,? extends R>) is not applicable [ERROR] (cannot infer type-variable(s) U,R [ERROR] (actual and formal argument lists differ in length)) [ERROR] method rx.Observable.<U,R>flatMap(rx.functions.Func1<? super TValue,? extends rx.Observable<? extends U>>,rx.functions.Func2<? super TValue,? super U,? extends R>,int) is not applicable [ERROR] (cannot infer type-variable(s) U,R [ERROR] (argument mismatch; int is not a functional interface)) [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :azure-cosmosdb

moderakh commented 6 years ago

@deepub This package is already published to central maven repo (https://mvnrepository.com/artifact/com.microsoft.azure/azure-cosmosdb/2.0.1). For using the sdk in your app you won't need rebuilding. Rebuilding would only be required if you are planning to make changes to the SDK or send a PR.

If you are planning to just use the sdk add the following dependency to your maven pom file:

<dependency>
  <groupId>com.microsoft.azure</groupId>
  <artifactId>azure-cosmosdb</artifactId>
  <version>2.0.1</version>
</dependency>

If you are planning to build this package yourself: The error you are getting is a compilation error. Seems you are trying to build this on mac os x. On Mac OS X my java version is "1.8.0_181" and building works fine.

Please make sure your java version is at least 1.8.0_181 and try again. Please let me know how that goes.

moderakh commented 5 years ago

closing this as we haven't heard back. If you still face the issue please feel free to re-open