diff --git a/src/tap/formatter/VOTableFormat.java b/src/tap/formatter/VOTableFormat.java index d5e07c8bae09e3b9150a083517e6f4a4efcc3d11..ab2e76bf96386b9ddfd347d62a2b66fd9fbf7ae6 100644 --- a/src/tap/formatter/VOTableFormat.java +++ b/src/tap/formatter/VOTableFormat.java @@ -220,7 +220,7 @@ public class VOTableFormat implements OutputFormat { out.newLine(); // Indicate that the query has been successfully processed: [REQUIRED] - out.write("<INFO name=\"QUERY_STATUS\" value=\"ERROR\">" + VOSerializer.formatText(message) + "</INFO>"); + out.write("<INFO name=\"QUERY_STATUS\" value=\"ERROR\">" + (message == null ? "" : VOSerializer.formatText(message)) + "</INFO>"); out.newLine(); // Append the PROVIDER information (if any): [OPTIONAL] diff --git a/src/tap/resource/Availability.java b/src/tap/resource/Availability.java index fc10f97252ef4a2a29e3fb626e3dfd33b4dc8f42..003db0a66c78c1b059e34842d8255a3b2114e452 100644 --- a/src/tap/resource/Availability.java +++ b/src/tap/resource/Availability.java @@ -123,7 +123,8 @@ public class Availability implements TAPResource, VOSIResource { // reason/description of the (non-)availability: pw.print("\t<note>"); - pw.print(VOSerializer.formatText(service.getAvailability())); + if (service.getAvailability() != null) + pw.print(VOSerializer.formatText(service.getAvailability())); pw.println("</note>"); pw.println("</availability>"); diff --git a/src/tap/resource/TAP.java b/src/tap/resource/TAP.java index 696d80adf939bf97c81b36f96571aa6720aebf32..cc45b25cd07f0a9267aae79f0019d9407707f28d 100644 --- a/src/tap/resource/TAP.java +++ b/src/tap/resource/TAP.java @@ -415,7 +415,7 @@ public class TAP implements VOSIResource { // TAP access: xml.append("\t<interface role=\"std\" xsi:type=\"vs:ParamHTTP\">\n"); - xml.append("\t\t<accessURL use=\"base\">").append(VOSerializer.formatText(getAccessURL())).append("</accessURL>\n"); + xml.append("\t\t<accessURL use=\"base\">").append((getAccessURL() == null) ? "" : VOSerializer.formatText(getAccessURL())).append("</accessURL>\n"); xml.append("\t</interface>\n"); // Language description: @@ -678,7 +678,7 @@ public class TAP implements VOSIResource { // Write the error in the response and return the appropriate HTTP status code: errorWriter.writeError(t, response, request, reqID, owner, resourceName); // Log the error: - getLogger().logHttp(LogLevel.ERROR, response, reqID, owner, "HTTP " + response.getStatus() + " - Can not complete the execution of the TAP resource \"" + resourceName + "\", because: " + t.getMessage(), t); + getLogger().logHttp(LogLevel.ERROR, response, reqID, owner, "HTTP " + response.getStatus() + " - Can not complete the execution of the TAP resource \"" + resourceName + "\"!", t); }finally{ // Notify the queue of the asynchronous jobs that a new connection is available: if (resourceName.equalsIgnoreCase(Sync.RESOURCE_NAME) && service.getFactory().countFreeConnections() >= 1)