Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-628

PgUtil.put should find super.setId(String)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • 29.4.0, 30.0.1, 33.0.2
    • 33.0.3
    • None
    • CP: sprint 117
    • 0.5
    • Core: Platform

    Description

      Overview

      There are two schemas. Base object:
      https://github.com/folio-org/acq-models/blob/master/common/schemas/entity.json
      and another object extended from the base one:
      https://github.com/folio-org/acq-models/blob/master/mod-finance/schemas/invoice_transaction_summary.json
      As the result - java OrderTransactionSummary.class will be generated without id setter, but with this setter in parent Entity.class. Having such kind of java classes leads to error while invoking PgUtils.put(OrderTransactionSummary) method

      2020-05-21T16:41:47,234 ERROR [vert.x-worker-thread-7   ] PgUtil org.folio.rest.jaxrs.model.OrderTransactionSummary.setId(java.lang.String)
      java.lang.NoSuchMethodException: org.folio.rest.jaxrs.model.OrderTransactionSummary.setId(java.lang.String)
      	at java.lang.Class.getDeclaredMethod(Class.java:2130) ~[?:1.8.0_252]
      	at org.folio.rest.persist.PgUtil.setId(PgUtil.java:761) ~[domain-models-runtime-29.4.0.jar:?]
      	at org.folio.rest.persist.PgUtil.put(PgUtil.java:914) ~[domain-models-runtime-29.4.0.jar:?]
      	at org.folio.rest.impl.TransactionSummaryAPI.putFinanceStorageOrderTransactionSummariesById(TransactionSummaryAPI.java:130) ~[classes/:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_252]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_252]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
      	at org.folio.rest.RestVerticle.invoke(RestVerticle.java:944) ~[domain-models-runtime-29.4.0.jar:?]
      	at org.folio.rest.RestVerticle.route(RestVerticle.java:535) ~[domain-models-runtime-29.4.0.jar:?]
      	at org.folio.rest.RestVerticle.lambda$1(RestVerticle.java:287) ~[domain-models-runtime-29.4.0.jar:?]
      	at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1034) ~[vertx-web-3.9.0.jar:3.9.0]
      	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:131) ~[vertx-web-3.9.0.jar:3.9.0]
      	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:128) ~[vertx-web-3.9.0.jar:3.9.0]
      	at io.vertx.ext.web.handler.impl.BodyHandlerImpl$BHandler.doEnd(BodyHandlerImpl.java:296) ~[vertx-web-3.9.0.jar:3.9.0]
      	at io.vertx.ext.web.handler.impl.BodyHandlerImpl$BHandler.end(BodyHandlerImpl.java:276) ~[vertx-web-3.9.0.jar:3.9.0]
      	at io.vertx.ext.web.handler.impl.BodyHandlerImpl.lambda$handle$0(BodyHandlerImpl.java:87) ~[vertx-web-3.9.0.jar:3.9.0]
      	at io.vertx.core.http.impl.HttpServerRequestImpl.onEnd(HttpServerRequestImpl.java:521) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:507) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.http.impl.Http1xServerConnection.handleEnd(Http1xServerConnection.java:176) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.http.impl.Http1xServerConnection.handleContent(Http1xServerConnection.java:163) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:140) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.impl.WorkerContext.lambda$wrapTask$0(WorkerContext.java:35) ~[vertx-core-3.9.0.jar:3.9.0]
      	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) ~[vertx-core-3.9.0.jar:3.9.0]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
      	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.48.Final.jar:4.1.48.Final]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
      

      How to fix:
      Replace getDeclaredMethod by getMethod. getDeclaredMethod finds in the current class only, getMethod finds also in superclasses.

      TestRail: Results

        Attachments

          Activity

            People

              julianladisch Julian Ladisch
              siarhei_hrabko Siarhei Hrabko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                TestRail: Runs

                  TestRail: Cases