Subscribed Content library synchronization with a 3rd party publisher fails with java.lang.NullPointerException
search cancel

Subscribed Content library synchronization with a 3rd party publisher fails with java.lang.NullPointerException

book

Article ID: 397243

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Subscribed content library synchronization is failing with error "A general runtime error occurred. An error occurred: java.lang.NullPointerException"

Log snipped:

| ERROR    | ########-######-####-####-##:######## | cls-simple-activity-13    | ContentLibraryActivityCallback | vapi opId: ########-######-####-####-##:######## - vapi call finished with an error
java.lang.NullPointerException: null
        at com.vmware.cl.utils.LibraryUtilityService.estimateCost(LibraryUtilityService.java:131) ~[cls-main-1.0.0.jar:?]
        at com.vmware.cl.activities.SyncLibraryActivity.phaseSyncItems(SyncLibraryActivity.java:270) ~[cls-main-1.0.0.jar:?]
        at sun.reflect.GeneratedMethodAccessor2828.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_422]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_422]
        at com.vmware.vcloud.activity.toolkit.simple.executor.SimpleActivityWorker.executePhase(SimpleActivityWorker.java:358) [activity-framework-toolkit-1.0.0.jar:?]
        at com.vmware.vcloud.activity.toolkit.simple.executor.SimpleActivityWo
| DEBUG    | ########-######-####-####-##:######## | cls-simple-activity-5     | CertificateTrustStrategy       | getServerThumbprint:  algorithm SHA-1  host https://3rd-party-content-library-FQDN/ContentLib_Prod/lib.json

Cause

The missing "selfHref" property In item.json files of the third party publisher caused the vAPI call to fail with a NullPointerException. 

Resolution

Item.json files need to have selfHref property.

Example:
{
 "version": ...,
 "id": ...,
 "name": ...,
 "created": ...,
 "description": "",
 "type": ...,
 "files": [...],
 "properties": ...,
 "metadata": [...],
 "vms": [],
       "selfHref": "Windows/Windows-2012R2-Standard/item.json"

 

Additional Information

You will notice two new files at the root directory of your 3rd Party Content Library. The first is the items.json which provides reference to all the files within the library and you will see that each subsequent directory will also contain an individual item.json file describing the content within the local directories. The lib.json is the 3rd Party Content Library endpoint and is what you will be specify when subscribing to a 3rd Party Content Catalog and by providing the absolute URL to this file when setting up a new Content Library.