Highlighted

NullPointerException when trying to use a swagger FormDataModel

pgleghorn1

06-08-2017

Hi Folks,

I'm getting this NPE in error.log when trying to create a forms Data Integration from a FormDataModel using a Swagger REST service;

Caused by: java.lang.NullPointerException: null

        at com.adobe.aem.dermis.core.rest.service.SwaggerUtils.getDataModel(SwaggerUtils.java:496)

        at com.adobe.aem.dermis.core.rest.service.SwaggerUtils.getDataModels(SwaggerUtils.java:218)

        at com.adobe.aem.dermis.core.rest.service.SwaggerUtils.getMetaData(SwaggerUtils.java:102)

        at com.adobe.aem.dermis.core.rest.service.RestConnector.getDataModels(RestConnector.java:108)

        at com.adobe.aem.dermis.core.rest.service.RestConnector.getDataModels(RestConnector.java:92)

        at com.adobe.aem.dermis.core.service.ConnectorManager.getSchemas(ConnectorManager.java:124)

        at com.adobe.aem.dermis.core.service.slingmodel.FormDataModelManager.getSchemas(FormDataModelManager.java:507)

        ... 126 common frames omitted

Prior to this, creation of the FormDataModel succeeds fine. It looks like this (the swagger file is provided, and basic auth is used):

formdatamodel.PNG

Creation of the DataIntegration succeeds also:

1273407_pastedImage_14.png

. The NPE occurs when clicking Open to edit the newly created DataIntegration, I get this error on-screen:

1273406_pastedImage_6.png

Any suggestions what the issue may be?

The bundle providing this class is:

Symbolic Nameaem-dermis-core
Version1.1.8
Bundle Locationjcrinstall:/libs/fd/dermis/install/aem-dermis-core-1.0.46.jar
Last ModificationSun Aug 06 14:07:39 BST 2017
VendorAdobe Systems Incorporated
DescriptionAEM Forms Dermis Core
Start Level20

Note, I'm able to create a standalone java client from this swaggerfile and query the backend service, so as best I can tell the swaggerfile is ok. The definition is here https://app.swaggerhub.com/apis/pgleghorn/PegaAPI/v1 for anyone interested.

I am using AEM 6.3.0.1 with Forms CFP1, on Windows 10 with Java 1.8.0_131.

Thx
Phil

Replies

Highlighted

pgleghorn1

08-08-2017

An update on this. I have managed to get further by stripping out large chunks of the swaggerfile, with only one simple GET operation then AEM accepts the swaggerfile - https://app.swaggerhub.com/apis/pgleghorn/PegaAPI/12.0.4

It seems that AEM does not like the GET paths with parameters, or any PUT/POST operations, from my original swaggerfile. However it is a tricky process through trial and error to find out what specifically is causing the problem. Trace logger on error.log didn't yield any new info.

Thx

Phil

Highlighted

venkatreddyguda

22-02-2018

Hi ,

I am getting same issues in AEM forms 6.3 while creating form data model.

Can any one help me in this.

Thanks,

Venkat

Highlighted

user2062153

23-02-2018

Hi Phil and Venkat,

NPE is occurring due to missing of properties in Content model definitions (line no. 825) in Pega API Swagger.

I have logged bug in product for fixing this use case and for now there is workaround.

  1. Open the swagger file
  2. Find Content definition (available at line no 825 in yaml file)
  3. add dummy property in content

Upload the updated swagger and FDM editor should be showing all the models and services

Regards,

Vijay Kumar J

Highlighted

venkatreddyguda

26-02-2018

Hi Vijay,

Thanks for your reply.

We are facing different issue in our case.We are getting below error message

Caused by: com.adobe.aem.dermis.exception.DermisException: Swagger definition not found.

    at com.adobe.aem.dermis.core.rest.service.SwaggerUtils.<init>(SwaggerUtils.java:90)

    at com.adobe.aem.dermis.core.rest.service.RestConnector.parseMetaData(RestConnector.java:71)

    at com.adobe.aem.dermis.api.AbstractConnector.getMetaData(AbstractConnector.java:132)

    at com.adobe.aem.dermis.api.AbstractConnector.getSchemaNames(AbstractConnector.java:206)

    at com.adobe.aem.dermis.core.service.ConnectorManager.getSchemas(ConnectorManager.java:120)

    at com.adobe.aem.dermis.core.service.slingmodel.FormDataModelManager.getSchemas(FormDataModelManager.java:465)

Can you please help me out in this.

Thanks,

Venkat

Highlighted

Anish_Somani

26-02-2018

Hi,

This issue is caused when the swagger file is invalid, hence there is no swagger definition has been found. Could you verify the swagger has valid format. YAML can be tricky format sometimes. IF still facing problem, convert it to JSON online and verify schema online. It may make things easier.

Thanks.