Buggy code:
@ RequiresAuthentication @ Api ( value = "AlarmCallbacks" , description = "Manage<seq2seq4repair_space>stream<seq2seq4repair_space>alarm<seq2seq4repair_space>callbacks" ) @ Path ( "//streams//{streamid}//alarmcallbacks" ) public class AlarmCallbackResource extends RestResource { private static final Logger LOG = LoggerFactory . getLogger ( AlarmCallbackResource . class ) ; private final AlarmCallbackConfigurationService alarmCallbackConfigurationService ; private final StreamService streamService ; private final Set < AlarmCallback > availableAlarmCallbacks ; @ Inject public AlarmCallbackResource ( AlarmCallbackConfigurationService alarmCallbackConfigurationService , StreamService streamService , Set < AlarmCallback > availableAlarmCallbacks ) { } @ GET @ Timed @ ApiOperation ( "Get<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>all<seq2seq4repair_space>alarm<seq2seq4repair_space>callbacks<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>stream" ) @ Produces ( MediaType . APPLICATION_JSON ) public Map < String , Object > get ( @ ApiParam ( name = "streamid" , value = "The<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>stream<seq2seq4repair_space>whose<seq2seq4repair_space>alarm<seq2seq4repair_space>callbacks<seq2seq4repair_space>we<seq2seq4repair_space>want." , required = true ) @ PathParam ( "streamid" ) String streamid ) throws NotFoundException { } @ GET @ Path ( "//{alarmCallbackId}" ) @ Timed @ ApiOperation ( "Get<seq2seq4repair_space>a<seq2seq4repair_space>single<seq2seq4repair_space>specified<seq2seq4repair_space>alarm<seq2seq4repair_space>callback<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>stream" ) @ Produces ( MediaType . APPLICATION_JSON ) public Map < String , Object > get ( @ ApiParam ( name = "streamid" , value = "The<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>stream<seq2seq4repair_space>whose<seq2seq4repair_space>alarm<seq2seq4repair_space>callbacks<seq2seq4repair_space>we<seq2seq4repair_space>want." , required = true ) @ PathParam ( "streamid" ) String streamid , @ ApiParam ( name = "alarmCallbackId" , value = "The<seq2seq4repair_space>alarm<seq2seq4repair_space>callback<seq2seq4repair_space>id<seq2seq4repair_space>we<seq2seq4repair_space>are<seq2seq4repair_space>getting" , required = true ) @ PathParam ( "alarmCallbackId" ) String alarmCallbackId ) throws NotFoundException { } @ POST @ Timed @ ApiOperation ( "Create<seq2seq4repair_space>an<seq2seq4repair_space>alarm<seq2seq4repair_space>callback" ) @ Consumes ( MediaType . APPLICATION_JSON ) @ Produces ( MediaType . APPLICATION_JSON ) public Response create ( @ ApiParam ( name = "streamid" , value = "The<seq2seq4repair_space>stream<seq2seq4repair_space>id<seq2seq4repair_space>this<seq2seq4repair_space>new<seq2seq4repair_space>alarm<seq2seq4repair_space>callback<seq2seq4repair_space>belongs<seq2seq4repair_space>to." , required = true ) @ PathParam ( "streamid" ) String streamid , @ ApiParam ( name = "JSON<seq2seq4repair_space>body" , required = true ) CreateAlarmCallbackRequest cr ) throws NotFoundException { checkPermission ( STREAMS_EDIT , streamid ) ; final Stream stream = streamService . load ( streamid ) ; final AlarmCallbackConfiguration alarmCallbackConfiguration = alarmCallbackConfigurationService . create ( streamid , cr , getCurrentUser ( ) . getName ( ) ) ; alarmCallbackConfiguration . setStream ( stream ) ; final String id ; try { id = alarmCallbackConfigurationService . save ( alarmCallbackConfiguration ) ; } catch ( ValidationException e ) { AlarmCallbackResource . LOG . error ( "Validation<seq2seq4repair_space>error." , e ) ; throw new javax . ws . rs . BadRequestException ( e ) ; } final Map < String , String > result = ImmutableMap . of ( "alarmcallback_id" , id ) ; <START_BUG> final URI alarmCallbackUri = UriBuilder . fromResource ( AlarmCallbackResource . class ) . path ( "{alarmCallbackId}" ) . build ( id ) ; <END_BUG> return Response . created ( alarmCallbackUri ) . entity ( result ) . build ( ) ; } @ GET @ Path ( "//available" ) @ Timed @ ApiOperation ( "Get<seq2seq4repair_space>a<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>all<seq2seq4repair_space>alarm<seq2seq4repair_space>callback<seq2seq4repair_space>types" ) @ Produces ( MediaType . APPLICATION_JSON ) public Map < String , Map < String , Object > > available ( @ ApiParam ( name = "streamid" , value = "The<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>stream<seq2seq4repair_space>whose<seq2seq4repair_space>alarm<seq2seq4repair_space>callbacks<seq2seq4repair_space>we<seq2seq4repair_space>want." , required = true ) @ PathParam ( "streamid" ) String streamid ) { } @ DELETE @ Path ( "//{alarmCallbackId}" ) @ Timed @ ApiOperation ( "Delete<seq2seq4repair_space>an<seq2seq4repair_space>alarm<seq2seq4repair_space>callback" ) @ ApiResponses ( { @ ApiResponse ( code = 404 , message = "Alarm<seq2seq4repair_space>callback<seq2seq4repair_space>not<seq2seq4repair_space>found." ) , @ ApiResponse ( code = 400 , message = "Invalid<seq2seq4repair_space>ObjectId." ) } ) public void delete ( @ ApiParam ( name = "streamid" , value = "The<seq2seq4repair_space>stream<seq2seq4repair_space>id<seq2seq4repair_space>this<seq2seq4repair_space>new<seq2seq4repair_space>rule<seq2seq4repair_space>belongs<seq2seq4repair_space>to." , required = true ) @ PathParam ( "streamid" ) String streamid , @ ApiParam ( name = "alarmCallbackId" , required = true ) @ PathParam ( "alarmCallbackId" ) String alarmCallbackId ) throws NotFoundException { } No newline ; at end ; of file ; }

Fix:
final URI alarmCallbackUri = UriBuilder . fromResource ( AlarmCallbackResource . class ) . path ( "{alarmCallbackId}" ) . build ( streamid , id ) ;