Details

    • Type: Bug
    • Status: Merged (View workflow)
    • Priority: unspecified
    • Resolution: Ready for Release
    • Affects Version/s: platform-4.2.4
    • Fix Version/s: platform-4.3.0
    • Component/s: None
    • Labels:
      None
    • Tested Version/s:
      None
    • Sprint:
      17.17

      Description

      There are bugs regarding old endpoint handling when transition from JAX-RS1 to JAX-RS2 was done using latest develop branch.

      This code does not work as intended when connecting to old endpoint, because 404 is now an exception ResponseProcessingException:

              Response response = webResource.request(MediaType.APPLICATION_XML_TYPE)
                      .put(Entity.entity(resource, MediaType.APPLICATION_XML_TYPE));
              if (RestUtil.isNotFound(response)) {
                  // fallback to old endpoint
                  response.close();
                  String idNoSlash = RestUtil.convertToDocumentURIId(docId);
                  webResource = getBaseServiceResource(client)
                          .path("r")
                          .path(idNoSlash)
                          .queryParam("ext", extensions.toArray())
                          .queryParam("copyTrans", String.valueOf(copyTrans));
                  response = webResource.request(MediaType.APPLICATION_XML_TYPE)
                          .put(Entity.entity(resource, MediaType.APPLICATION_XML_TYPE));
              }
      

      It should be something like:

              try {
              	Response response = webResource.request(MediaType.APPLICATION_XML_TYPE)
                      .get();
              	return response.readEntity(Resource.class);
              } catch (ResponseProcessingException e) {
              	if (RestUtil.isNotFound(e.getResponse())) {
      	            // fallback to old endpoint
      	            String idNoSlash = RestUtil.convertToDocumentURIId(docId);
      	            webResource =
      	                    getBaseServiceResource(client)
      	                            .path("r")
      	                            .path(idNoSlash)
      	                            .queryParam("ext", extensions.toArray());
      	            return webResource.request(MediaType.APPLICATION_XML_TYPE)
      	                    .get(Resource.class);
      	        }
              	throw e;
              }
      

      SourceDocResourceClient.java: getResource
      SourceDocResourceClient.java: putResource
      SourceDocResourceClient.java: deleteResource
      TransDocResourceClient.java: getTranslations
      AsyncProcessClient.java: startSourceDocCreationOrUpdateWithDocId
      AsyncProcessClient.java: startTranslatedDocCreationOrUpdateWithDocId

        Attachments

          Activity

            People

            • Assignee:
              aeng Alex Eng
              Reporter:
              matej.spiller Matej Spiller Muys
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: