cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1546
Views
0
Helpful
1
Replies

Apache Tomcat + Maven + ContextService SDK - Deployment Issue

rdediana
Cisco Employee
Cisco Employee

hello folks,

I would like to get some guidance on the below issue i experienced; i was able to find a "temporary" solution / workaround however i'd like to understand how to address correctly.

My Environment:

Maven: apache-maven-3.5.0

Apache: apache-tomcat-7.0.78

Java: JDK 1.8

Context Service: SDK 2.0.1

i'm using Maven and apache plugin to build / deploy my servlet and context service resources / libs / dependencies to the web service webapp directory. however, when attempting to initialize and connect both client (ContextServiceClient) and management (ManagementConnector) instances to the Context Service i received the below error (First / Second). it wasn't until i copied the required resources "Manually" to the required location did the issues resolve.

i had to work thru two errors to resolve the issue. the project is functioning as expected, however, i'm just looking to understand if this typical or, is there a better way to manage this? what i find odd is that the plugin and connector.property resources are located OUTSIDE the servlet app directory and located with the Apache Bin directory.

First Error:

Cause:

Exception occurred while Loading the configurations

java.io.FileNotFoundException: /Users/regandediana/Development/Tomcat/apache-tomcat-7.0.78/bin/./connector.property (No such file or directory)

Resolution: manually copy "Connector.Property" file to the "Apache_Home/bin" directory.

Second Error:

Cause:

Exception occurred while Loading the configurations

java.io.IOException: Cannot find the specified path: /Users/regandediana/Development/Tomcat/apache-tomcat-7.0.78/bin/plugin

Resolution: manually copy "Plugin" director containing "context-service-sdk-extension-2.0.1.jar" file to "Apache_Home/bin" directory.

any guidance, best practices, or direction would be greatly appreciated.

Regan

1 Accepted Solution

Accepted Solutions

cvadnais
Level 1
Level 1

I believe it uses the current working directory of the process as the default to find connector.properties.  Your tomcat is likely configured to use tomcat/bin as its working directory.  If you would to reference connector.properties in another location, you may specify the path by passing it when initializing the factory.

See Cisco DevNet: Context Service - Context Service SDK Guide The example uses a relative path, but you may pass it a fully qualified path.

Also, it is not supported to run both management connector and client connector in the same java virtual machine.  See note at Cisco DevNet: Context Service - Context Service SDK Guide

View solution in original post

1 Reply 1

cvadnais
Level 1
Level 1

I believe it uses the current working directory of the process as the default to find connector.properties.  Your tomcat is likely configured to use tomcat/bin as its working directory.  If you would to reference connector.properties in another location, you may specify the path by passing it when initializing the factory.

See Cisco DevNet: Context Service - Context Service SDK Guide The example uses a relative path, but you may pass it a fully qualified path.

Also, it is not supported to run both management connector and client connector in the same java virtual machine.  See note at Cisco DevNet: Context Service - Context Service SDK Guide

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: