Generate API Documentation for RESTful Services in CA SDM 17.1

book

Article ID: 106202

calendar_today

Updated On:

Products

SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service KNOWLEDGE TOOLS CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

Attempting to generate the REST API Documentation in CA SDM 17.1 as documented at:

https://docops.ca.com/ca-service-management/17-1/en/reference/ca-service-desk-manager-reference-commands/generate-api-documentation-for-restful-services

Received errors when performing the undeploy and deploy of  RESTful Web Services 

java.lang.NoClassDefFoundError: com/sun/tools/doclets/internal/toolkit/util/DirectoryManager
        at com.lunatech.doclets.jax.Utils.classToPath(Utils.java:312)
        at com.lunatech.doclets.jax.jaxb.writers.JAXBClassWriter.getWriter(JAXBClassWriter.java:44)
        at com.lunatech.doclets.jax.jaxb.writers.JAXBClassWriter.<init>(JAXBClassWriter.java:39)
        at com.lunatech.doclets.jax.jaxb.model.JAXBClass.write(JAXBClass.java:237)
        at com.lunatech.doclets.jax.jaxb.JAXBDoclet.start(JAXBDoclet.java:106)
        at com.lunatech.doclets.jax.jaxb.JAXBDoclet.start(JAXBDoclet.java:93)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:310)
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:189)
        at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:366)
        at com.sun.tools.javadoc.Start.begin(Start.java:219)
        at com.sun.tools.javadoc.Start.begin(Start.java:205)
        at com.sun.tools.javadoc.Main.execute(Main.java:162)
        at com.ca.ServicePlus.rest.restutil.JavaDocGeneratorImpl.generate(JavaDocGeneratorImpl.java:217)
        at com.ca.ServicePlus.rest.restutil.Pdm_rest_util$RestJavaDocGenThread.run(Pdm_rest_util.java:656)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.doclets.internal.toolkit.util.DirectoryManager
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 19 more
java.lang.NullPointerException
        at com.lunatech.doclets.jax.jaxrs.JAXRSDoclet.<init>(JAXRSDoclet.java:73)
        at com.lunatech.doclets.jax.jaxrs.JAXRSDoclet.start(JAXRSDoclet.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:310)
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:189)
        at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:366)
        at com.sun.tools.javadoc.Start.begin(Start.java:219)
        at com.sun.tools.javadoc.Start.begin(Start.java:205)
        at com.sun.tools.javadoc.Main.execute(Main.java:162)
        at com.ca.ServicePlus.rest.restutil.JavaDocGeneratorImpl.generate(JavaDocGeneratorImpl.java:237)
        at com.ca.ServicePlus.rest.restutil.Pdm_rest_util$RestJavaDocGenThread.run(Pdm_rest_util.java:656)
        at java.lang.Thread.run(Unknown Source)
INFO: Completed generating API documentation.
INFO: Cleaning up temp directories.
INFO: Done.

It creates the REST folder and the POJO folder in the NX_ROOT\DOC directory, but no documentation is created within the folders.

Cause

The reason why the REST Documentation is not deploying properly is that since CA SDM 17.1 uses JRE 1.8, JRE 1.8 and above stopped distributing the needed Doclet support. 

Environment

CA Service Desk Manager 17.1
All Supported Windows Platforms

Resolution

For possible workarounds, please refer to the following CA Service Management Community Post:

https://communities.ca.com/docs/DOC-231174222-generate-api-documentation-for-restful-services

Alternatively, you can open a CA Support Case and request that the REST API Documentation be provided.