Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-142021

Websphere 9.0 - Could not add entity via headless api

Details

    Description

       Steps to reproduce:

      1. Set up Websphere enviroment
      2. Add a site, get its groupId
      3. Run the following curl command:
        curl -X POST -H "accept: application/json" -H "Content-Type: application/json" -u "[email protected]:test" -d "{\"alternativeHeadline\":\"\",\"image\":{\"imageId\":0,\"caption\":\"\"},\"viewableBy\":\"Anyone\",\"keywords\":[],\"articleBody\":\"^<p^>Blogs Entry Content^<\/p^>\",\"taxonomyCategoryIds\":[0],\"description\":\"\",\"headline\":\"Blogs Entry Title\"}" http://localhost:8080/o/headless-delivery/v1.0/sites/${groupId}/blog-postings
      1. Replace groupId with the one you get
      2. Check the response
      1. Navigate to headless api page http://localhost:8080/o/headless-delivery/v1.0/openapi.json
      2. Invoke the following codes in /v1.0/sites/${siteId}/blog-postings
        {
          "articleBody": "<p>Blogs Entry Content</p>",
          "headline": "Blog Entry Title",
          "viewableBy": "Anyone"
        }
        

       Actual result:
      Could not add blog entry via headless api, internal server error occurs:

      {
        "status" : "INTERNAL_SERVER_ERROR"
      }
      

      Error Thrown in server console

      2021-11-01 20:56:16.748 ERROR [WebContainer : 5][ExceptionMapper:52] java.lang.ArrayIndexOutOfBoundsException
      java.lang.ArrayIndexOutOfBoundsException: null
      	at java.lang.reflect.Executable.getAllGenericParameterTypes(Executable.java:329) ~[?:1.8.0]
      	at java.lang.reflect.Executable.getAnnotatedParameterTypes(Executable.java:695) ~[?:1.8.0]
      	at java.lang.reflect.Parameter.getAnnotatedType(Parameter.java:248) ~[?:1.8.0]
      	at org.hibernate.validator.internal.properties.javabean.JavaBeanParameter.getAnnotatedType(JavaBeanParameter.java:56) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findCascadingMetaData(AnnotationMetaDataProvider.java:627) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getParameterMetaData(AnnotationMetaDataProvider.java:432) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findExecutableMetaData(AnnotationMetaDataProvider.java:308) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getMetaData(AnnotationMetaDataProvider.java:292) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getConstructorMetaData(AnnotationMetaDataProvider.java:273) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.retrieveBeanConfiguration(AnnotationMetaDataProvider.java:131) ~[?:?]
      	at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfiguration(AnnotationMetaDataProvider.java:120) ~[?:?]
      	at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.getBeanConfigurationForHierarchy(BeanMetaDataManagerImpl.java:234) ~[?:?]
      	at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.createBeanMetaData(BeanMetaDataManagerImpl.java:201) ~[?:?]
      	at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.getBeanMetaData(BeanMetaDataManagerImpl.java:165) ~[?:?]
      	at org.hibernate.validator.internal.engine.ValidatorImpl.buildNewLocalExecutionContext(ValidatorImpl.java:772) ~[?:?]
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedAnnotatedObjectForCurrentGroup(ValidatorImpl.java:627) ~[?:?]
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:590) ~[?:?]
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:409) ~[?:?]
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:172) ~[?:?]
      	at com.liferay.portal.vulcan.internal.jaxrs.validation.ValidationUtil.validate(ValidationUtil.java:38) ~[?:?]
      

       Expected result:
      The blog entry should be shown in response. Like getSiteBlogsPostingPage and deleteBlogPosting do.

      {
        "actions": {
          "subscribe": {
            "method": "PUT",
            "href": "http://localhost:8080/o/headless-delivery/v1.0/sites/40243/blog-postings/subscribe"
          },
          "unsubscribe": {
            "method": "PUT",
            "href": "http://localhost:8080/o/headless-delivery/v1.0/sites/40243/blog-postings/unsubscribe"
          },
          "create": {
            "method": "POST",
            "href": "http://localhost:8080/o/headless-delivery/v1.0/sites/40243/blog-postings"
          }
        },
        "facets": [],
        "items": [
          {
            "actions": {
              "get-rendered-content-by-display-page": {
                "method": "GET",
                "href": "http://localhost:8080/o/headless-delivery/v1.0/blog-postings/40281/rendered-content-by-display-page/{displayPageKey}"
              },
              "get": {
                "method": "GET",
                "href": "http://localhost:8080/o/headless-delivery/v1.0/blog-postings/40281"
              },
              "replace": {
                "method": "PUT",
                "href": "http://localhost:8080/o/headless-delivery/v1.0/blog-postings/40281"
              },
              "update": {
                "method": "PATCH",
                "href": "http://localhost:8080/o/headless-delivery/v1.0/blog-postings/40281"
              },
              "delete": {
                "method": "DELETE",
                "href": "http://localhost:8080/o/headless-delivery/v1.0/blog-postings/40281"
              }
            },
            "alternativeHeadline": "",
            "articleBody": "<p>Content</p>",
            "creator": {
              "additionalName": "",
              "contentType": "UserAccount",
              "familyName": "Test",
              "givenName": "Test",
              "id": 20128,
              "name": "Test Test"
            },
            "customFields": [],
            "dateCreated": "2021-11-04T06:54:25Z",
            "dateModified": "2021-11-04T06:54:25Z",
            "datePublished": "2021-11-04T06:54:00Z",
            "description": "Content",
            "encodingFormat": "text/html",
            "externalReferenceCode": "40281",
            "friendlyUrlPath": "blog-title",
            "headline": "Blog Title",
            "id": 40281,
            "keywords": [],
            "numberOfComments": 0,
            "relatedContents": [],
            "renderedContents": [],
            "siteId": 40243,
            "taxonomyCategoryBriefs": []
          }
        ],
        "lastPage": 1,
        "page": 1,
        "pageSize": 20,
        "totalCount": 1
      }
      

       Note: This issue also happens on add other entities such as wiki, web content.

      Attachments

        Issue Links

          Activity

            People

              support-lep@liferay.com SE Support
              lu.liu Lu Liu
              Felipe Lins Felipe Lins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                1 year, 1 day ago

                Packages

                  Version Package