[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-users
Subject:    [jibx-users] JibX hanging during unmarshalling
From:       Ugo Enyioha <donniebr2k () yahoo ! com>
Date:       2005-06-09 15:11:23
Message-ID: 20050609151123.82336.qmail () web60513 ! mail ! yahoo ! com
[Download RAW message or body]

Hey Dennis,

I'm having some problems unmarshalling documents from
a ByteArrayInputStream.

This is my unmarshalling code.

public class RecordXMLUnmarshaller {

	IBindingFactory bindingFactory = null;
	IUnmarshallingContext unmarshallingContext = null;
	CommonEventRecordType cer = null;
	Object obj = null;

	public ArgusRecordXMLUnmarshaller()	{
		try {
			bindingFactory BindingDirectory.getFactory(CommonEventRecordType.class);
			unmarshallingContext bindingFactory.createUnmarshallingContext();
		} catch (JiBXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public Object readXMLRecord(InputStream is)	{
		try {
			obj = unmarshallingContext.unmarshalDocument(is,
null);
		} catch (JiBXException e) {
			e.printStackTrace();
		}
		System.out.println("Unmarshalled object: " +
obj.toString());
		return obj;
	}
}


The input stream passed to readXMLRecord comes
directly from an outputStream genrerated by JibX that
was converted to an input stream.

// add record to queue
aq.add(bos);
xmlArray = (aq.remove()).toByteArray();
bis = new ByteArrayInputStream(xmlArray);

arum.readXMLRecord(bis))

AFAICT the unmarshalling code is the proper way to do
this. Or is there something I've overlooked.

Thanks so much.

--Ugo

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r 
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic