0 Replies Latest reply on Apr 11, 2019 11:46 AM by 2813976

    How to convert array of  oracle.jbo.Row to json object

    2813976

      Hi

      I am trying to convert the result of a adf View Object to json format

       

      @Path("/user")
      public class UserResource {
          public UserResource() {
          }
      
          @GET
          @Produces(MediaType.APPLICATION_JSON)
          public Row[] getUsers() {
              Row[] rows = null;
              ADFContext oldContext = ADFContext.initADFContext(null, null, null, null);
              try {
                  String amDef = "com.tarek.api.model.app.AppModule";
                  String config = "AppModuleLocal";
                  ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
                  ViewObject vo = am.findViewObject("AllUsers");
                  vo.executeQuery();
                  rows = vo.getAllRowsInRange();
      
                  Configuration.releaseRootApplicationModule(am, true);
      
              } finally {
                  ADFContext.resetADFContext(oldContext);
              }
      
              return rows;
          }
      

      But i get this error

       

      MessageBodyWriter not found for media type=application/json, type=class [Loracle.jbo.Row;, genericType=class [Loracle.jbo.Row;.

       

      I am using  Jdeveloper IDE 12.2

      and integrated weblogic

       

      Any suggestions