Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

Tarek BakrApr 11 2019

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

Comments

Post Details

Added on Apr 11 2019
0 comments
424 views