phax / phoss-directory

The official Peppol, TOOP and DE4A Directory software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP 500 response on Create or Update when calling test version

mangeg opened this issue · comments

Having issues using the test version of the directory.

When calling DELETE https://test-directory.peppol.eu/indexer/1.0/iso6523-actorid-upis%3A%3A0007%3A12345 or PUT with iso6523-actorid-upis%3A%3A0007%3A12345 as the body I get the below response.
The client certificate is passed with the requests and is a valid SMP Test certificate.

`TTP Status 500 – Internal Server Error


Type Exception Report

Message org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class com.helger.pd.indexer.clientcert.ClientCertificateValidator

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class com.helger.pd.indexer.clientcert.ClientCertificateValidator
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:410)
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.helger.servlet.filter.CharacterEncodingFilter.doHttpFilter(CharacterEncodingFilter.java:187)
com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

Root Cause
org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class com.helger.pd.indexer.clientcert.ClientCertificateValidator
org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:254)
org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:236)
org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:436)
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
org.glassfish.jersey.internal.Errors.process(Errors.java:292)
org.glassfish.jersey.internal.Errors.process(Errors.java:274)
org.glassfish.jersey.internal.Errors.process(Errors.java:244)
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.helger.servlet.filter.CharacterEncodingFilter.doHttpFilter(CharacterEncodingFilter.java:187)
com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

Root Cause
java.lang.NoClassDefFoundError: Could not initialize class com.helger.pd.indexer.clientcert.ClientCertificateValidator
com.helger.pd.indexer.rest.IndexerResource._checkClientCertificate(IndexerResource.java:71)
com.helger.pd.indexer.rest.IndexerResource.deleteParticipant(IndexerResource.java:142)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
org.glassfish.jersey.internal.Errors.process(Errors.java:292)
org.glassfish.jersey.internal.Errors.process(Errors.java:274)
org.glassfish.jersey.internal.Errors.process(Errors.java:244)
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.helger.servlet.filter.CharacterEncodingFilter.doHttpFilter(CharacterEncodingFilter.java:187)
com.helger.servlet.filter.AbstractHttpServletFilter.doFilter(AbstractHttpServletFilter.java:66)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

Note The full stack trace of the root cause is available in the server logs.


Apache Tomcat/8.5.38`

Thanks for pointing that out - that is a configuration error on the test directory. We're working to resolve this as quickly as possible. Sorry for the inconvenience.

@mangeg the problem was resolved and everything should be back to normal. Thanks for reaching out to us.

Can confirm that it no longer return a HTTP 500-response.

But it now always return a HTTP 400-response for Add/Update. It also always return a a HTTP 204-response for delete, even when called multiple times in a row with the same identifier.

Is the body expected to be of different content-type? Could not find anything in the documentation regarding that.

The requests for Add/Update:
PUT https://test-directory.peppol.eu/indexer/1.0/
Content-Type: text/html; charset=utf-8
Content-Length: 1160

Body:
iso6523-actorid-upis%3A%3A0088%3Atestscancc123

Response:
`HTTP Status 400 – Bad Request


Type Status Report

Message Bad Request

Description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).


Apache Tomcat/8.5.38`

The delete request:
DELETE https://test-directory.peppol.eu/indexer/1.0/iso6523-actorid-upis%3A%3A0088%3Atestscancc123

Response:
HTTP 204 No Content

Hi,
Http 400 means the participant identifier could not be parsed. Please don't use URL encoding in the Put body.
So use this body:
iso6523-actorid-upis::0088:testscancc123

The Delete call is okay, because there the ID is part of the URL.

Hth

OK, will try that. I was using URL-encoded identifier since the documentation specified the sample request with that.

231 Example request:
232 URL: PUT /indexer/1.0/
233 Body: iso6523-actorid-upis%3A%3A0088%3Agln1234

Thanks - that needs to be fixed. I checked the code and that is wrong - thanks for pointing that out. 👍