1
0
-1

Hi There

I am using DX Cloud and have installed the API Builder plugin.

I have created a simple API and when accessing via the API Builder's OAS3 Document page, I get a 200 response containing the correct JSON result.

However when accessing the the API directly via Postman, DX Cloud is returning a 500 error response.

There seems to be nothing in reported either the application or system logs.


Does the DX Cloud support the API Builder, and if so what can I do to get around the 500 error?


Cheers

Dave


    CommentAdd your comment...

    4 answers

    1.  
      1
      0
      -1

      Hi Anders

      Yes I have an API key configured via the Manage API Key Menu.

      The 500 error seems to occur regardless of whether you do a simple GET request or a POST request with the api_id and api_key included in the header.

      Should a simple GET request generate a 401 or 403 error if no key is specified rather than a 500? 



        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Anders

        Whilst the 500 error is reproducible by viewing the following in a browser: https://kiwicivil.cloud.joget.com/jw/api/list/equipmentList

        Doing this does not generate an error in either the Web App Log or the System Log.

        However there looks to be a related error in the Web App Log from yesterday, possibly from when I installed the API plugin?


        ERROR 13 Aug 2020 03:25:34 org.apache.jsp.WEB_002dINF.jsp.error500_jsp - jwc_kiwicivil : java.lang.NullPointerException
        2573
        java.lang.NullPointerException
        2574
            at org.joget.api.service.ApiBuilder.serveApi(ApiBuilder.java:726)
        2575
            at org.joget.api.service.ApiBuilder.getBuilderResult(ApiBuilder.java:246)
        2576
            at org.joget.api.service.ApiBuilder$$FastClassBySpringCGLIB$$1633bed5.invoke(<generated>)
        2577
            at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        2578
            at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
        2579
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        2580
            at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:84)
        2581
            at org.joget.plugin.base.MultiTenantPluginAspect.securityCheck(MultiTenantPluginAspect.java:48)
        2582
            at jdk.internal.reflect.GeneratedMethodAccessor237.invoke(Unknown Source)
        2583
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        2584
            at java.base/java.lang.reflect.Method.invoke(Method.java:566)




        1. Anders

          It seems like you may be missing the API key. Did you add a Manage API Key Menu into your app to manage API keys?

        CommentAdd your comment...
      2.  
        1
        0
        -1

        Hi Anders

        Thanks for your response.

        I checked both the web app log viewer as well as the System log viewer, and neither had a record of the 500 error.


          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi, if there is a 500 error response, the exception should be logged. Did you check the Web App Log Viewer?

            CommentAdd your comment...