3

I'm getting this error when I try make post request to same URL with Postman. By the way artifact was deployed successfully. Same codes are working on my teammates' develoment environment.

message org.glassfish.jersey.server.internal.process.MappableException: com.amazonaws.xray.exceptions.SubsegmentNotFoundException: Failed to end subsegment: subsegment cannot be found.

description The server encountered an internal error that prevented it from fulfilling this request.

exception javax.servlet.ServletException: org.glassfish.jersey.server.internal.process.MappableException: com.amazonaws.xray.exceptions.SubsegmentNotFoundException: Failed to end subsegment: subsegment cannot be found.
    org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
    org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    com.amazonaws.xray.javax.servlet.AWSXRayServletFilter.doFilter(AWSXRayServletFilter.java:151)

root cause    
org.glassfish.jersey.server.internal.process.MappableException: com.amazonaws.xray.exceptions.SubsegmentNotFoundException: Failed to end subsegment: subsegment cannot be found.
    org.glassfish.jersey.server.ContainerFilteringStage$ResponseFilterStage.apply(ContainerFilteringStage.java:198)
    org.glassfish.jersey.server.ContainerFilteringStage$ResponseFilterStage.apply(ContainerFilteringStage.java:163)
    org.glassfish.jersey.process.internal.Stages.process(Stages.java:171)
    org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:442)
    org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:490)
    org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334)
    org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    com.amazonaws.xray.javax.servlet.AWSXRayServletFilter.doFilter(AWSXRayServletFilter.java:151)

Would be thankful for any help.

Arif Acar
  • 1,461
  • 2
  • 19
  • 33
  • Is your teammate also using postman to invoke the service? As the information given is rather limited it is hard to spot the issue. It seems further that your teammate is doing something other as well as in his case the sub/segment is either created or the logic for closing the sub/segment is not invoked. Probably put a `AWSXRay.getCurrentSubsegmentOptional().isPresent()` before the actual sub/segment close invocation. Do you work with asynchronous tasks? – Roman Vottner May 03 '18 at 13:21

0 Answers0