Buggy code:
@ MessageDriven ( activationConfig = { @ ActivationConfigProperty ( propertyName = "destinationLookup" , propertyValue = "java:jboss//exported//jms//topic//preparation" ) , @ ActivationConfigProperty ( propertyName = "destinationType" , propertyValue = "javax.jms.Topic" ) } ) public class PreparationMDB extends RunningTaskMDB { private static final Logger LOG = Logger . getLogger ( PreparationMDB . class . getName ( ) ) ; @ Resource ( lookup = "java:jboss//exported//jms//topic//training" ) private Topic trainingQueue ; @ Resource ( lookup = "java:jboss//exported//jms//topic//prediction" ) private Topic predictionQueue ; @ Inject private JMSContext jmsContext ; @ EJB ConjoinerService conjoinerService ; @ EJB TaskHandler taskHandler ; @ EJB DatasetHandler datasetHandler ; @ EJB AAService aaService ; @ Inject @ UnSecure Client client ; @ Inject @ Jackson JSONSerializer serializer ; @ Override public void onMessage ( Message msg ) { Task task = null ; try { Map < String , Object > messageBody = msg . getBody ( Map . class ) ; task = taskHandler . find ( messageBody . get ( "taskId" ) ) ; if ( task == null ) { throw new NullPointerException ( ( "FATAL:<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>task<seq2seq4repair_space>with<seq2seq4repair_space>id:" + ( messageBody . get ( "taskId" ) ) ) ) ; } init ( task . getId ( ) ) ; task . setStatus ( RUNNING ) ; task . getMeta ( ) . getComments ( ) . add ( ( "Preparation<seq2seq4repair_space>Task<seq2seq4repair_space>is<seq2seq4repair_space>now<seq2seq4repair_space>running<seq2seq4repair_space>with<seq2seq4repair_space>ID<seq2seq4repair_space>" + ( Thread . currentThread ( ) . getName ( ) ) ) ) ; task . setPercentageCompleted ( 1.0F ) ; taskHandler . edit ( task ) ; String bundleUri = ( ( String ) ( messageBody . get ( "bundle_uri" ) ) ) ; String subjectId = ( ( String ) ( messageBody . get ( "subjectid" ) ) ) ; String descriptors = ( ( String ) ( messageBody . get ( "descriptors" ) ) ) ; <START_BUG> Set descriptorSet = serializer . parse ( subjectId , Set . class ) ; <END_BUG> task . getMeta ( ) . getComments ( ) . add ( "Starting<seq2seq4repair_space>Dataset<seq2seq4repair_space>preparation..." ) ; task . setPercentageCompleted ( 6.0F ) ; taskHandler . edit ( task ) ; Dataset dataset = conjoinerService . prepareDataset ( bundleUri , subjectId , descriptorSet ) ; task . getMeta ( ) . getComments ( ) . add ( "Dataset<seq2seq4repair_space>ready." ) ; task . getMeta ( ) . getComments ( ) . add ( "Saving<seq2seq4repair_space>to<seq2seq4repair_space>database..." ) ; task . setPercentageCompleted ( 55.0F ) ; taskHandler . edit ( task ) ; MetaInfo datasetMeta = MetaInfoBuilder . builder ( ) . addSources ( bundleUri ) . addTitles ( ( ( String ) ( messageBody . get ( "title" ) ) ) ) . addDescriptions ( ( ( String ) ( messageBody . get ( "description" ) ) ) ) . addComments ( ( "Created<seq2seq4repair_space>by<seq2seq4repair_space>task<seq2seq4repair_space>" + ( task . getId ( ) ) ) ) . addCreators ( aaService . getUserFromSSO ( subjectId ) . getId ( ) ) . build ( ) ; dataset . setMeta ( datasetMeta ) ; datasetHandler . create ( dataset ) ; task . getMeta ( ) . getComments ( ) . add ( "Dataset<seq2seq4repair_space>saved<seq2seq4repair_space>successfully." ) ; task . setPercentageCompleted ( 80.0F ) ; taskHandler . edit ( task ) ; String mode = ( ( String ) ( messageBody . get ( "mode" ) ) ) ; String baseUri = ( ( String ) ( messageBody . get ( "base_uri" ) ) ) ; String datasetUri = ( ( baseUri + ( dataset . getClass ( ) . getSimpleName ( ) . toLowerCase ( ) ) ) + "//" ) + ( dataset . getId ( ) ) ; switch ( mode ) { case "TRAINING" : task . getMeta ( ) . getComments ( ) . add ( "Preparation<seq2seq4repair_space>Task<seq2seq4repair_space>is<seq2seq4repair_space>now<seq2seq4repair_space>completed." ) ; task . getMeta ( ) . getComments ( ) . add ( "Initiating<seq2seq4repair_space>Training<seq2seq4repair_space>Task..." ) ; task . setPercentageCompleted ( 90.0F ) ; taskHandler . edit ( task ) ; messageBody . put ( "dataset_uri" , datasetUri ) ; jmsContext . createProducer ( ) . setDeliveryDelay ( 1000 ) . send ( trainingQueue , messageBody ) ; break ; case "PREDICTION" : task . getMeta ( ) . getComments ( ) . add ( "Preparation<seq2seq4repair_space>Task<seq2seq4repair_space>is<seq2seq4repair_space>now<seq2seq4repair_space>completed." ) ; task . getMeta ( ) . getComments ( ) . add ( "Initiating<seq2seq4repair_space>Prediction<seq2seq4repair_space>Task..." ) ; task . setPercentageCompleted ( 91.0F ) ; taskHandler . edit ( task ) ; messageBody . put ( "dataset_uri" , datasetUri ) ; jmsContext . createProducer ( ) . setDeliveryDelay ( 1000 ) . send ( predictionQueue , messageBody ) ; break ; default : task . setStatus ( COMPLETED ) ; task . getMeta ( ) . getComments ( ) . add ( "Preparation<seq2seq4repair_space>Task<seq2seq4repair_space>is<seq2seq4repair_space>now<seq2seq4repair_space>completed." ) ; task . setResult ( ( "dataset//" + ( dataset . getId ( ) ) ) ) ; task . setHttpStatus ( 200 ) ; task . setPercentageCompleted ( 92.0F ) ; taskHandler . edit ( task ) ; break ; } task . setHttpStatus ( 200 ) ; task . setPercentageCompleted ( 100.0F ) ; } catch ( JMSException ex ) { PreparationMDB . LOG . log ( Level . SEVERE , ex . getMessage ( ) , ex ) ; task . setStatus ( ERROR ) ; task . setErrorReport ( ErrorReportFactory . internalServerError ( ex , "JMS" , "Error<seq2seq4repair_space>Accessing<seq2seq4repair_space>JMS<seq2seq4repair_space>asynchronous<seq2seq4repair_space>queues." , ex . getMessage ( ) ) ) ; } catch ( BadRequestException ex ) { PreparationMDB . LOG . log ( Level . SEVERE , null , ex ) ; task . setStatus ( ERROR ) ; task . setErrorReport ( ErrorReportFactory . badRequest ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>processing<seq2seq4repair_space>input." , ex . getMessage ( ) ) ) ; } finally { if ( ( task != null ) && ( ( task . getId ( ) ) != null ) ) { terminate ( task . getId ( ) ) ; } taskHandler . edit ( task ) ; } } }

Fix:
Set descriptorSet = serializer . parse ( descriptors , Set . class ) ;