05-25-2016 06:50 AM
Hi All,
New to ContextService, and ran into an issue.
I was able to register, and get the connection data, using the credentials provided to me.
However when taking one of the samples and trying to run them, I encounter exceptions when the client is trying access the KMS to retrieve encryption keys.
I see this exception thrown by the background threads.
ApiError with errorType: kmsError.failedRequest, errorData: , errorMessage: No response found for KMS request
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.cisco.thunderhead.errors.ApiExceptionFactory.getApiException(ApiExceptionFactory.java:78)
at com.cisco.thunderhead.errors.ApiExceptionFactory.generateApiException(ApiExceptionFactory.java:113)
at com.cisco.thunderhead.errors.ApiExceptionFactory.generateApiException(ApiExceptionFactory.java:95)
at com.cisco.thunderhead.kms.KmsSecureChannel.processResponsePayload(KmsSecureChannel.java:378)
at com.cisco.thunderhead.kms.KmsSecureChannel.transmitRequest(KmsSecureChannel.java:289)
at com.cisco.thunderhead.kms.KmsSecureChannel.submitRequest(KmsSecureChannel.java:235)
at com.cisco.thunderhead.kms.KmsActor.getKey(KmsActor.java:203)
at com.cisco.thunderhead.kms.KmsManager.loadSaltValue(KmsManager.java:320)
at com.cisco.thunderhead.kms.KmsManager.tryInitialize(KmsManager.java:290)
at com.cisco.thunderhead.kms.KmsManager$InitializeCache.run(KmsManager.java:272)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I also then see this warning
main WARN kms.KmsManager - After 20000 milliseconds, kmsManager is still not initialized!
And in some cases when I would issue a create customer request:
main WARN kms.KmsManager - Unable to retrieve hashing salt because KmsManager is still not initialized yet.
main ERROR client.ContextServiceClientImpl - ApiError with errorType: kmsError.failedRequest, errorData: , errorMessage: Unable to access KMS in order to load SCR encryption keys.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.cisco.thunderhead.errors.ApiExceptionFactory.getApiException(ApiExceptionFactory.java:78)
at com.cisco.thunderhead.errors.ApiExceptionFactory.generateApiException(ApiExceptionFactory.java:113)
at com.cisco.thunderhead.errors.ApiExceptionFactory.generateApiException(ApiExceptionFactory.java:95)
at com.cisco.thunderhead.kms.KmsManager.getHashingSalt(KmsManager.java:570)
at com.cisco.thunderhead.client.ContextServiceEncryptionClient.computeFieldValueHashes(ContextServiceEncryptionClient.java:499)
at com.cisco.thunderhead.client.ContextServiceEncryptionClient.computeHashesForAllSearchableFields(ContextServiceEncryptionClient.java:451)
at com.cisco.thunderhead.client.ContextServiceEncryptionClient.inspectAndEncrypt(ContextServiceEncryptionClient.java:423)
at com.cisco.thunderhead.client.ContextServiceEncryptionClient.encryptBean(ContextServiceEncryptionClient.java:118)
at com.cisco.thunderhead.client.BaseEncryptionService.encryptAndCreate(BaseEncryptionService.java:135)
at com.cisco.thunderhead.client.ContextServiceClientImpl.create(ContextServiceClientImpl.java:339)
at com.cisco.thunderhead.client.ContextServiceClientImpl.create(ContextServiceClientImpl.java:319)
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 com.cisco.thunderhead.plugin.ConnectorProxyInvocationHandler.invoke(ConnectorProxyInvocationHandler.java:110)
at com.sun.proxy.$Proxy11.create(Unknown Source)
at addCustomerTest.main(addCustomerTest.java:70)
So what i'm trying to figure out is if anybody else has encountered an error, or perhaps the account credentials I was supplied might be on account that has not been provisioned?
I've attached a log, from the program that is based on the simple connection program in the QuickStart.
I've also ensure that the following are not blocked.
*.webex.com
*.wbx2.com
*.ciscoccservice.com
I downloaded the 1.0.7 sdk from the website, which did an auto update of the extension sdk to 1.0.8
Thank You,
Daniel
06-15-2016 06:51 AM
Daniel,
Can you please share your setup detail where you are running the sample code?
OS version?
Java version?
Are you also facing similar issue with your CVP setup along with sample code?
Thank you
Ankit Parikh
06-17-2016 12:35 PM
Hi Ankit,
Sorry for the delay. Was busy on some other tasks.
I've tried several environments.
At first I simply tried running the samples in the IntellJ IDE.
Other times I would run the app in a command shell.
My development normally is in a Virtual Machine (VirtualBox), but I also
tried running the sample in non-VM environment, just to be sure that wasn't
causing an issue.
The OS I used initially is Windows 8.1 (6.3.9600), and also Windows 10
(10.0.10586)
The JDK I am currently using is jdk1.8.0_91
I'm currently not using CVP, just the custom App. I will enquire to see if
anybody in the organization is working with CVP
Thank you,
Daniel
(REF: ID CS-39)
06-19-2016 03:09 PM
Daniel,
So my understanding is that you have only used Windows to run this, right?
We are investigating a root cause of this issue which is related to Windows OS. We'll get back to you soon with more details.
Thank you
Ankit Parikh
06-19-2016 10:47 PM
Hi Ankit,
Yes only had tried it out on Windows up until this point.
I did just install an Ubuntu (15.04) VM, installed IntelliJ Community
edition (2016.1.3), imported the project, Java (same ver).
I also unregistered. and re-registered the application, to get a new
connection data value.
Then tried the sample again, still getting errors, but i notice this error
that looks a little different then the previous ones:
*"No response found for KMS request. Does the user or machine account have
the spark.syncKms role"*
Attached a new log file.
Thank You
Daniel
REF: ID CS-39
06-21-2016 09:00 AM
Daniel,
Please patch your setup with latest Context Service Extension SDK from: https://context-service-downloads.rciad.ciscoccservice.com/files/latest/context-service-sdk-extension-1.0.8.jar and try to re-run your program. Context Service team has deployed new SDK to production to address multiple KMS issues.
Thank you
Ankit Parikh
06-21-2016 11:28 AM
Hi Ankit,
Just to check, should this work on Windows? Or should I try it also on a
Linux setup?
Is this the only file I need to dowload, I just tried it on my Windows
setup. Still getting errors but some new messages:
Like:
*"Thread-4 ERROR kms.KmsSecureChannel - underlying security provider or
related class not found, or doesn't support required algorithm"*
I have attached a new log.
Thank You
Daniel
REF: ID CS-39
06-27-2016 08:19 AM
Hi Daniel,
Context Service team has released 2.0 version on SDK. This SDK contains many improvements for KMS. If you could upgrade your custom program to use 2.0 SDK, it would be extremely useful. While the team works on making the SDKs available on DevNet, you could download them from here:
Please let me know if you see improvement after upgrading to 2.0 SDK. If you are still seeing issues, we can schedule a WebEx to debug them.
Thank you
Ankit Parikh
06-29-2016 06:05 AM
Hi Daniel,
Any update with 2.0 SDK?
Thank you
Ankit Parikh
06-29-2016 06:13 AM
Hi Ankit,
I have downloaded the 2.0 SDK. But have not had a chance to apply it yet,
been too busy the last couple of days.
I will be trying it today! I will let you know how it goes.
Thank you
Daniel
06-29-2016 12:11 PM
Hi Ankit,
Just upgraded to the 2.0 SDK, and still had issues. I believe I have
tracked it down to an incorrect version of org.bouncycastle being
included. Once I forced a reference to 1.54 (artifact id bcprov-jdk15on ),
rebuilt and re-ran, the code worked correctly and allowed me to add/search
customers/pods.
I have noticed one new exception near the startup (the code still runs
fine).
main ERROR plugin.ConnectorFactory - Exception occurred while Loading the
configurations
java.lang.NullPointerException
at
com.cisco.thunderhead.connector.PropertiesConfiguration.(PropertiesConfiguration.java:41)
at
com.cisco.thunderhead.plugin.ConnectorFactory.loadConfigurations(ConnectorFactory.java:401)
at
com.cisco.thunderhead.plugin.ConnectorFactory.initializeFactory(ConnectorFactory.java:147)
at connect.main(connect.java:21)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Error Initializing Factory! The Error is: ApiError with errorType: ioError,
errorData: Cannot initialize the factory, errorMessage: Failure to
initialize the factory
Thank You,
Daniel Schimmer
On Wed, Jun 29, 2016 at 9:13 AM, Daniel Schimmer <
06-29-2016 12:14 PM
Hi Daniel,
Glad to hear that you had it working (for the most part) with SDK 2.0
Can you please send me your sample project? (Please remove your connection data prior to sending me the project).
I can see what is missing in the project related to the exception you are seeing.
Thank you
Ankit Parikh
06-29-2016 12:39 PM
Hey Ankit,
Here's the project, I have removed the connectiondata elements. But due to
gmail security I had to remove any jar files as well. You will need to put
the appropriate extension sdk in the plugin folder (last used was 2.0.1)
and the 2.0.1 sdk in the src/main/resources folder
Thank You,
Daniel
07-05-2016 06:02 AM
Hi Daniel,
Please try out attached sample program. I have ran this code on Windows 10 and verified that it works.
Here is what you need to do:
1) Download static SDK (context-service-sdk-2.0.1.jar - Box) and place it in src/main/resources
2) Download Extension SDK (context-service-sdk-extension-2.0.1.jar - Box) and place it in plugin directory
3) Run following command from cmd (while you are at the root level of this project) (Please note that below command is a single line. If there are any line breaks, then remove them)
mvn install:install-file -Dfile=src/main/resources/context-service-sdk-2.0.1.jar -DgroupId=com.cisco.thunderhead -DartifactId=context-service-sdk -Dversion=2.0.1 -Dpackaging=jar -DpomFile=src/main/resources/context-service-sdk-pom.xml
4) From Intellij open the project and update all mvn dependencies
5) Run Register.java to get Connection Data
6) Add this connection data in connect.java (line 30)
7) Run connect.java
Please let me know the result.
Thank you
Ankit Parikh
07-05-2016 06:13 AM
Hi Ankit,
I didn't see an attachment? Did you send before it attached?
Daniel
07-05-2016 06:19 AM
Hi Daniel,
Sorry about that. Please download from: sdk-example.zip - Box
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide