Closed sgireddy closed 6 years ago
@sgireddy these are end to end integration tests and require a valid endpoint.
Which endpoint are you using?
I am using a live cosmosdb on azure (mongoDB endpoint)
Also, the original code sample came with version "0.9.0-SNAPSHOT" but maven central has "0.9.0-rc2" which I believe the latest. I was trying to build the master branch ("0.9.0-SNAPSHOT"), deploy locally but got the following error, could you help setting up gpg secret key?
INFO] Building jar: /Users/shashigireddy/code/git/azure-documentdb-rxjava/azure-documentdb-rx/target/azure-documentdb-rx-0.9.0-SNAPSHOT-javadoc.jar
[INFO]
[INFO] --- maven-gpg-plugin:1.6:sign (sign-artifacts) @ azure-documentdb-rx ---
gpg: no default secret key: No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.906 s
[INFO] Finished at: 2017-11-28T16:24:48-08:00
[INFO] Final Memory: 31M/103M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on project azure-documentdb-rx: Exit code: 2 -> [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/MojoExecutionException
Tried building azure-documentdb-rx project with my own gpg key then building examples project build worked fine but I am seeing runtime errors (below). I removed target & jars from maven local repo (tried with and without gpg goal in mvn build). Didn't work.
java.lang.SecurityException: class "com.microsoft.azure.documentdb.BridgeInternal"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.microsoft.azure.documentdb.rx.internal.RxDocumentClientImpl.<init>(RxDocumentClientImpl.java:200)
at com.microsoft.azure.documentdb.rx.AsyncDocumentClient$Builder.build(AsyncDocumentClient.java:174)
at com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest.setUp(DatabaseAndCollectionCreationAsyncAPITest.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
java.lang.NullPointerException
at com.microsoft.azure.documentdb.rx.examples.DatabaseAndCollectionCreationAsyncAPITest.shutdown(DatabaseAndCollectionCreationAsyncAPITest.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
@sgireddy
java.lang.SecurityException: class "com.microsoft.azure.documentdb.BridgeInternal"'s signer information does not match signer information of other classes in the same package
You are getting this because com.microsoft.azure:azure-documentdb-rx has dependency and also some shared packages with com.microsoft.azure:azure-documentdb. So signing with Microsoft keys are required otherwise java security policy will complain.
Short term solution: If you want to build com.microsoft.azure:azure-documentdb-rx yourself either disable java's security feature or remove the signature from com.microsoft.azure:azure-documentdb.
you can remove signature from the main package (not safe for prod): find $HOME/.m2/repository/com/microsoft/azure/azure-documentdb -iname '.jar' -exec sh -c 'zip -d "{}" META-INF/.SF META-INF/*.RSA' \; || echo "maybe already fixed and cached!"
Long term solution: We are making some improvement which should be out in early 2018 and should fix this.
@moderakh
Thank you for details on gpg key issue.
Looks like my issue is related to the port number on the end point. The following endpoint (without port number) works perfectly fine using .Net connector:
<add key="endpoint" value="https://xxxxxxxxxx.documents.azure.com" />
But not using RxJava, got following:
[rxdocdb-computation1] WARN com.microsoft.azure.documentdb.rx.internal.RetryFunctionFactory - unknown failure, cannot retry [port out of range:-1], attempt number [1]
java.lang.IllegalArgumentException: port out of range:-1
I have been trying 8081 but it was supposed to be 443. Using endpoint https://xxxxxxxxxx.documents.azure.com:443 worked fine. Ideally it should automatically infer the port number 443 when the protocol is https. I am not blocked anymore so I am ok to close the issue or let it open until the library automatically infer the default port number.
@sgireddy you seems to be unblocked for now. The other issue (port has to be explicitly passed) that's a limitation for the java sdk right now. We will fix it. Thanks.
Hi!, Thank you for building RxJava client for cosmos, I got the following exception from my code and the example provided, I am using OSX.