@@ -78,8 +78,6 @@ public class MBXMLWriter implements QueryResponseWriter {
7878 */
7979 private JAXBContext context = null ;
8080 protected JAXBContext errorContext = null ;
81- private Unmarshaller unmarshaller = null ;
82- protected Marshaller marshaller = null ;
8381 protected Marshaller errorMarshaller = null ;
8482 private ObjectFactory objectfactory = null ;
8583
@@ -298,9 +296,7 @@ public void init(NamedList initArgs) {
298296 try {
299297 context = createJAXBContext ();
300298 errorContext = createJAXBErrorContext ();
301- marshaller = createMarshaller ();
302299 errorMarshaller = createErrorMarshaller ();
303- unmarshaller = context .createUnmarshaller ();
304300 } catch (JAXBException e ) {
305301 throw new RuntimeException (e );
306302 }
@@ -375,8 +371,8 @@ else if (response instanceof SolrDocumentList)
375371
376372 Metadata metadata = metadatalistwrapper .getCompletedMetadata ();
377373 metadata .setCreated (now );
378-
379374 try {
375+ Marshaller marshaller = createMarshaller ();
380376 marshaller .marshal (metadata , sw );
381377 } catch (JAXBException e ) {
382378 e .printStackTrace ();
@@ -389,7 +385,12 @@ else if (response instanceof SolrDocumentList)
389385 public void parseSolrResponse (ResultContext con , MetadataListWrapper metadatalistwrapper , SolrQueryRequest req ) throws IOException {
390386
391387 DocList doclist = con .getDocList ();
392-
388+ Unmarshaller unmarshaller = null ;
389+ try {
390+ unmarshaller = context .createUnmarshaller ();
391+ } catch (JAXBException e ) {
392+ throw new RuntimeException (e );
393+ }
393394 metadatalistwrapper .setCountAndOffset (doclist .matches (),
394395 doclist .offset ());
395396
@@ -457,6 +458,12 @@ public void parseSolrResponse(SolrDocumentList doclist, MetadataListWrapper meta
457458
458459 metadatalistwrapper .setCountAndOffset (doclist .getNumFound (),
459460 doclist .getStart ());
461+ Unmarshaller unmarshaller = null ;
462+ try {
463+ unmarshaller = context .createUnmarshaller ();
464+ } catch (JAXBException e ) {
465+ throw new RuntimeException (e );
466+ }
460467
461468 List xmlList = metadatalistwrapper .getLiveList ();
462469
0 commit comments