Skip to end of metadata
Go to start of metadata

This guide will illustrate setting up an A&AI development environment in Ubuntu 16.04.  

DRAFT - this guide is in process of being updated - thanks for your patience (smile)

For this exercise, I set up a new instance of Ubuntu in Virtualbox and gave it 16G RAM, 200GB dynamically allocated storage, and 3 processors.

  1. install openjdk 8
    1. sudo apt install openjdk-8-jdk

  2. Install single node hadoop/janusgraph
    1. $ wget
    2. $ unzip
    3. $ cd janusgraph-0.2.0-hadoop2/
    4. $ ./bin/ start, make sure you are not a root user as elasticsearch cannot be run as root, response is like:
      Forking Cassandra...
      Running `nodetool statusthrift`... OK (returned exit status 0 and printed string "running").
      Forking Elasticsearch...
      Connecting to Elasticsearch ( OK (connected to
      Forking Gremlin-Server...
      Connecting to Gremlin-Server ( OK (connected to
      Run to connect.
    5. you can verify whether everything is running by executing  
      ./bin/ status

  3. Install haproxy (If you are on Mac OS X, Here's the link to HAProxy setting with Docker Setting up HAProxy for MAC OS X user)
    1. $ sudo apt-get -y install haproxy
    2. $ <path-to-haproxy>/haproxy -v
      HA-Proxy version 1.6.3 2015/12/25
      Copyright 2000-2015 Willy Tarreau <>
    3. Install this haproxy.cfg file in /etc/haproxy

    4. Download aai.pem

    5. $ sudo cp aai.pem /etc/ssl/private/aai.pem
    6. $ sudo chmod 640 /etc/ssl/private/aai.pem
    7. $ sudo chown root:ssl-cert /etc/ssl/private/aai.pem
    8. sudo mkdir /usr/local/etc/haproxy
    9. Add these hostnames to the loopback interface in /etc/hosts: 

      1. localhost

    10. $ sudo service haproxy restart

  4. Set up repos. First, follow the initial setup instructions in Setting Up Your Development Environment
    1. $ mkdir -p ~/LF/AAI
    2. $ cd ~/LF/AAI
    3. $ git clone ssh://<username>
    4. $ git clone ssh://<username>
    5. $ git clone ssh://<username>
    6. $ git clone ssh://<username>
    7. If you did not originally create a settings.xml file when setting up the dev environment, you may get an error on some of the repos saying that oparent is unresolvable.  Using the example settings.xml file should solve this problem: Setting Up Your Development Environment#MavenExamplesettings.xml

  5. Build aai-common, traversal, and resources
    1. $ cd ~/LF/AAI/aai-common
    2. $ mvn -DskipTests clean install
      Should result in BUILD SUCCESS
    3. $ cd ~/LF/AAI/resources
    4. $ mvn -DskipTests clean install
      Should result in BUILD SUCCESS
    5. $ cd ~/LF/AAI/logging-service
    6. $ mvn -DskipTests clean install
      Should result in BUILD SUCCESS
    7. $ cd ~/LF/AAI/traversal
      I had to add the following to traversal/pom.xml to get traversal to build, this may not be necessary: 
                          <name>Restlet repository</name>
    8. mvn -DskipTests clean install
      Should result in BUILD SUCCESS

  6. Janus setup
    1. Modify both and to the following (for all MS’s that will connect to the local Cassandra backend)
      storage.cassandra.keyspace=onap;  or different keyspace name of your choosing
      • update ~/LF/AAI/resources/aai-resources/src/main/resources/etc/appprops/
      • update ~/LF/AAI/resources/aai-resources/src/main/resources/etc/appprops/
      • update ~/LF/AAI/traversal/aai-traversal/src/main/resources/etc/appprops/
      • update ~/LF/AAI/traversal/aai-traversal/src/main/resources/etc/appprops/
    1. NOTE: The first thing that would need to be done is adding the schema to the local instance. (this will need to be done whenever using a new keyspace or after wiping the data).
    2. Here's the command I used, and it worked:
      $ cd ~/LF/AAI/resources; java -DAJSC_HOME=aai-resources -DBUNDLECONFIG_DIR=src/main/resources/ -Dloader.main=org.onap.aai.dbgen.GenTester -jar aai-resources/target/aai-resources-1.2.0-SNAPSHOT.jar
      verify the version of built jar
  7. Start the "resources" microservice
    1. Resources runs on port 8447.  Go to the resources directory
      $ cd ~/LF/AAI/resources
    2. Set the debug port to 9447
      $ export MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9447,server=y,suspend=n"
    3. Start the microservice
      $ java -DAJSC_HOME=aai-resources -DBUNDLECONFIG_DIR=src/main/resources/ -jar aai-resources/target/aai-resources-1.2.0-SNAPSHOT.jar
      Should see something like this: Resources Microservice Started 

  8. Verify the resources microservice (this example uses Postman utility for Google Chrome)
    1. Use basic auth, user = AAI, pw = AAI
    2. Set the X-TransactionId header (in the example below, the value is 9999)
    3. Set the X-FromAppId header (in the example below, the value is jimmy-postman)
    4. Perform a GET of (If you don't have HAproxy, you can use 8447 port instead of 8443)
    5. You should see an error as below, 404 Not Found, ERR.5.4.6114.  This indicates that the service is functioning normally:

  9. Start the "traversal" microservice
    1. Traversal runs on port 8446.  Go to the traversal directory
      $ cd ~/LF/AAI/traversal
    2. Set the debug port to 9446
      $ export MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9446,server=y,suspend=n"
    3. Start the microservice
      $ java -DAJSC_HOME=aai-traversal -DBUNDLECONFIG_DIR=src/main/resources/ -jar aai-traversal/target/aai-traversal-1.2.0-SNAPSHOT.jar
      Should see something like this: Traversal Microservice Started

  10. Verify the traversal microservice by executing attached postman AAI API calls
    1. Set up the widget models
      This will set up the postman to add widget models: Add Widget Models.postman_collection.json
    2. Create a runner using this file: models.csv
    3. Run the test runner
    4. Add a named query called "getComponentList" (this named query is used by VID): NamedQuery.postman_collection.json
    5. Add objects: Add Instances for Named Query.postman_collection.json (when using vXX in place of v11, replace the xmlns "http://org.openecomp.aai.inventory/v11" with "http://org.onap.aai.inventory/vXX" in the Body of the PUT request)
    6. Execute named-query: Execute Named Query.postman_collection.json
      You should see something like the following:
  11. Your A&AI instance is now running, both the resources and traversal microservices are working properly with a local janus graph. 
  12. Next: Tutorial: Making and Testing a Schema Change in A&AI in Beijing Release


  File Modified
File aai.pem Mar 13, 2018 by James Forsyth
File Add Instances for Named Query.postman_collection.json Mar 13, 2018 by James Forsyth
File Add Widget Models.postman_collection.json Mar 13, 2018 by James Forsyth
File Execute Named Query.postman_collection.json Mar 13, 2018 by James Forsyth
File haproxy.cfg Mar 13, 2018 by James Forsyth
PNG File image2017-7-26_11-6-11.png Mar 13, 2018 by James Forsyth
PNG File image2017-7-26_16-17-19.png Mar 13, 2018 by James Forsyth
PNG File image2017-7-26_16-23-12.png Mar 13, 2018 by James Forsyth
PNG File image2017-7-26_16-58-5.png Mar 13, 2018 by James Forsyth
File models.csv Mar 13, 2018 by James Forsyth
File NamedQuery.postman_collection.json Mar 13, 2018 by James Forsyth

  • No labels


  1. Thanks Jimmy for this. Step 9 to start "traversal" microservice not working. Would very much appreciate any revised command to start the "traversal" microservice, based on logs/assessment below. Thank you.

    9. c. Start the microservice

    $ java -DAJSC_HOME=aai-traversal -DBUNDLECONFIG_DIR=src/main/resources/ -jar aai-traversal/target/aai-traversal-1.2.0-SNAPSHOT.jar

    The build for traversal does not generate: aai-traversal-1.2.0-SNAPSHOT.jar.

    Build logs show that jar file that is generated is: traversal.jar

    [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ aai-traversal ---

    [INFO] Installing /home/sandeepos/LF/AAI/traversal/aai-traversal/target/traversal.jar to /home/sandeepos/.m2/repository/org/onap/aai/traversal/aai-traversal/1.2.0-SNAPSHOT/aai-traversal-1.2.0-SNAPSHOT.jar

    [INFO] Installing /home/sandeepos/LF/AAI/traversal/aai-traversal/pom.xml to /home/sandeepos/.m2/repository/org/onap/aai/traversal/aai-traversal/1.2.0-SNAPSHOT/aai-traversal-1.2.0-SNAPSHOT.pom

    [INFO] Installing /home/sandeepos/LF/AAI/traversal/aai-traversal/target/ to /home/sandeepos/.m2/repository/org/onap/aai/traversal/aai-traversal/1.2.0-SNAPSHOT/

    [INFO] ------------------------------------------------------------------------

    [INFO] Reactor Summary:


    [INFO] aai-traversal ...................................... SUCCESS [ 0.949 s]

    [INFO] aai-traversal ...................................... SUCCESS [ 10.131 s]

    [INFO] ------------------------------------------------------------------------


  2. Hi Jimmy - sorry...i re-cloned and traversal microservice working fine. Thank you

  3. Hi. A question here. Files that need to be updated in step 6.b/c/d/e cannot be found in the repo cloned recently. These files are replaced by janugraph-xxx. properties. Shall we still update the 'storage.backend' and 'storage.hostname' as before? Needs update for the setup guide. Thanks

    1. Hi, Ruoyu Ying - right, they are replaced by janusgraph-xxx props file.  We're still using casandra, so yes..  I will be updating the setup guide soon.

  4. Hi Jimmy,

    I am trying to execute the OOF HAS service on my laptop and there is a dependency on AAI. 

    1) Is there an instance of AAI executing in a lab or other environment that I might connect to?

    2) The instructions above are presenting some challenges.

    Step 3. c:  I'm running virtualbox on a Mac and have not been successful in installing guest additions and getting cut n paste to work, making installing haproxy.cfg troublesome. Googling leads to innumerable dead ends - any suggestions?

    Step 3.d. This command only works if there is a aai.pem file in the directory from which the command is run. It appears that the directory would be the home dir on the virtual machine, which of course does not have the file. What am I missing?

    Thanks for the assist

    • Frank
    1. Hi, Frank Sandoval we are running a couple of instance in the windriver pod lab if you want to try it there.

      I'll be updating this guide soon, which hopefully will help.

      I had success with bidirectional copy/paste with mac os on virtualbox 5.2.8 r121009 and ubuntu 16.04-LTS

      You can get the aai.pem file by clicking the link above.

  5. Hi. I faced a problem when processing the step 6.i.

    Got errors like below. Can anyone help?

    Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.springframework.boot.loader.Launcher.launch(
    at org.springframework.boot.loader.Launcher.launch(
    at org.springframework.boot.loader.PropertiesLauncher.main(
    Caused by: java.lang.ExceptionInInitializerError
    at org.onap.aai.dbmap.AAIGraph.getInstance(
    at org.onap.aai.dbgen.GenTester.main(
    ... 8 more
    Caused by: java.lang.RuntimeException: Failed to instantiate graphs
    at org.onap.aai.dbmap.AAIGraph.<init>(
    at org.onap.aai.dbmap.AAIGraph.<init>(
    at org.onap.aai.dbmap.AAIGraph$Helper.<clinit>(
    ... 10 more
    Caused by: java.lang.IllegalArgumentException: Could not find implementation class:
    at org.janusgraph.util.system.ConfigurationUtil.instantiate(
    at org.janusgraph.diskstorage.Backend.getImplementationClass(
    at org.janusgraph.diskstorage.Backend.getIndexes(
    at org.janusgraph.diskstorage.Backend.<init>(
    at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.getBackend(
    at org.janusgraph.graphdb.database.StandardJanusGraph.<init>(
    at org.onap.aai.dbmap.AAIGraph.loadGraph(
    at org.onap.aai.dbmap.AAIGraph.<init>(
    ... 12 more
    Caused by: java.lang.ClassNotFoundException:
    at java.lang.ClassLoader.loadClass(
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at org.janusgraph.util.system.ConfigurationUtil.instantiate(
    ... 22 more

  6. please add below dependency in resources/aai-resources/pom.xml as well as traversal/pom.xml(to run microservice)


    hope this will resolve your problem.

    1. Hi Devendra,

      Thank you so much. It's working fine now.

  7. Hello,

    I have been trying the deployment of AAI Beijing version cloning the script from git repo and instantiating the init script. When I run the script, it initiates but the docker of aai-resources gets exited.

    root@aai-beijiing:/opt# docker ps -a
    CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS                      PORTS               NAMES
    681cd2fc4896   "/bin/bash /opt/ap..."   29 minutes ago      Exited (1) 28 minutes ago                       testconfig_aai-resources.api.simpledemo.onap.org_1

    When I looked at the docker logs, I don't find any errors but I notice the below in it. Please suggest.

    OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
    OpenJDK 64-Bit Server VM warning: ignoring option PermSize=512M; support was removed in 8.0
    OpenJDK 64-Bit Server VM warning: Cannot open file /opt/app/aai-resources/logs/ajsc-jetty/gc/aai_gc.log due to No such file or directory

      .   ____          _            __ _ _
     /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
     \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
      '  |____| .__|_| |_|_| |_\__, | / / / /
     :: Spring Boot ::       (v1.5.12.RELEASE)
    10:00:04,978 |-INFO in LogbackRequestLog - Will use configuration resource [/localhost-access-logback.xml]
    10:00:04,986 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - debug attribute not set
    10:00:04,986 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
    10:00:04,986 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [ACCESS]
    10:00:04,987 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@591391158 - No compression will be used
    10:00:04,987 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@591391158 - Will use the pattern /opt/app/aai-resources/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd} for the active file
    10:00:04,987 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern '/opt/app/aai-resources/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd}'.
    10:00:04,987 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
    10:00:04,988 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Tue Jun 19 12:30:37 UTC 2018
    10:00:05,005 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[ACCESS] - Active log file name: /opt/app/aai-resources/logs/ajsc-jetty/localhost_access.log
    10:00:05,005 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[ACCESS] - File property is set to [/opt/app/aai-resources/logs/ajsc-jetty/localhost_access.log]
    10:00:05,005 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [ACCESS] to null
    10:00:05,005 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction - End of configuration.
    10:00:05,005 |-INFO in ch.qos.logback.access.joran.JoranConfigurator@358ee631 - Registering current configuration as safe fallback point

  8. Hi, Jimmy,

    I followed the guide from Step 1. While executing step 10.c to run the test runner, all of the 90 iterations received the response messages below. It seemed that some precondition were missed. Or I missed something.

    Thank you.

    <? xml version = "1.0" encoding = "UTF-8" standalone = "yes" ?>

        < Fault >

        < requestError >

        < serviceException >

        < messageId > SVC3000 < /messageId>

        < text > Invalid input performing % 1 on % 2(msg = % 3)(ec = % 4) < /text>

        < variables >

            < variable > PUT < /variable>

            < variable > service - design - and - creation / models / model / 9551346 c - 7 d8b - 4 daf - 9926 - b93e96e2344a < /variable>

            < variable > Precondition Required: resource - version not passed for update of / service - design - and - creation / models / model / 9551346 c - 7 d8b - 4 daf - 9926 - b93e96e2344a < /variable>

            < variable > ERR.5.4.6130 < /variable>

        < /variables>

        < /serviceException>

        < /requestError>

        < /Fault>

  9. Hi Jimmy,

    When I executed step 10.d with Postman, an error showed up:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
            <text>Invalid input performing %1 on %2 (msg=%3) (ec=%4)</text>
              <variable>Precondition Required:resource-version not passed for update of /service-design-and-creation/named-queries/named-query/0367193e-c785-4d5f-9cb8-7bc89dc9ddb7</variable>

    It seems some preconditions were missed. For step 10.c, I executed successfully. So any other preconditions? Thank you very much.

    1. Hi, Zheng Liu - I means that named-query already exists.  On a second PUT on that object, you need to include the resource-version in the payload, which you can get by doing a GET on the object first.

      1. Hi, James Forsyth

        As you mentioned, I've get the resource-version by doing a GET request. So how to include this resource-version in the payload? Could you provide more details? Thanks a lot.

      2. Hi James Forsyth

        I've solved this issue. Thank you very much.

  10. James Forsyth , Every one I am trying to build reources using mvn but getting below errors. Appreciate any help on why is this happening . 

    [INFO] surefireArgLine set to -javaagent:/home/ubuntu/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/home/ubuntu/LF/AAI/resources/aai-resources/target/code-coverage/jacoco-ut.exec,excludes=**/**/models/**/*.class,dumponexit=true
    [INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (jacoco-initialize-unit-tests) @ aai-resources ---
    [INFO] argLine set to -javaagent:/home/ubuntu/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/home/ubuntu/LF/AAI/resources/aai-resources/target/coverage-reports/jacoco.exec,excludes=**/**/models/**/*.class,dumponexit=true
    [INFO] --- maven-dependency-plugin:2.10:unpack (unpack-schema-dependency) @ aai-resources ---
    [INFO] Configured Artifact: org.onap.aai.aai-common:aai-schema:1.3.0:jar
    [INFO] Unpacking /home/ubuntu/.m2/repository/org/onap/aai/aai-common/aai-schema/1.3.0/aai-schema-1.3.0.jar to /home/ubuntu/LF/AAI/resources/aai-resources/src/main/resources/schema with includes "**/oxm/**/*.xml" and excludes ""
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v9/aai_oxm_v9.xml
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v11/aai_oxm_v11.xml
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v12/aai_oxm_v12.xml
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v13/aai_oxm_v13.xml
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v10/aai_oxm_v10.xml
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v8/aai_oxm_v8.xml
    [WARNING] Unable to expand to file /home/ubuntu/LF/AAI/resources/onap/oxm/v14/aai_oxm_v14.xml
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO] aai-resources ...................................... SUCCESS [ 1.035 s]
    [INFO] aai-resources ...................................... FAILURE [ 2.298 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.011 s
    [INFO] Finished at: 2018-11-15T08:24:21+00:00
    [INFO] Final Memory: 56M/723M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack (unpack-schema-dependency) on project aai-resources: Unable to create Marker: /home/ubuntu/LF/AAI/resources/aai-resources/target/dependency-maven-plugin-markers/org.onap.aai.aai-common-aai-schema-jar-1.3.0-19780290: No such file or directory -> [Help 1]
    [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] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1]
    [ERROR] After correcting the problems, you can resume the build with the command

    1. Hi samir kumar,

      Are there existing files under the "/home/ubuntu/LF/AAI/resources/onap/oxm/" sub-directory? What are the permissions on the directory and files?


      1. Hi Keong Lim ,

        Let me check and revert . Unfortunately the AWS instance i was using got terminated and need to reproduce the error.

  11. Hi James Forsyth,

    I encountered this error while installing the step 6.b

    Detailed error log looks like this:

    cd ~/LF/AAI/resources; java -DAJSC_HOME=aai-resources -DBUNDLECONFIG_DIR=src/main/resources/ -Dloader.main=org.onap.aai.dbgen.GenTester -jar aai-resources/target/aai-resources-1.4.0-SNAPSHOT.jar
    Exception in thread "main" java.lang.ClassNotFoundException: org.onap.aai.dbgen.GenTester
    at java.lang.ClassLoader.loadClass(
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    at org.springframework.boot.loader.Launcher.launch(
    at org.springframework.boot.loader.Launcher.launch(
    at org.springframework.boot.loader.PropertiesLauncher.main(

    And i'm wondering if there's a method to install the newest AAI code locally without OOM?

    Thanks a lot.

    Best Regards,


  12. Zheng Liu How did you resolve the resource-version issue. Can you please provide a solution here