Hi Roy, No idea of what could cause the code to freeze, though I suspect it's something in your data rather than just the size of the document (JiBX is commonly used with multimegabyte documents, and perhaps even larger). The code sample that you give is not going to handle character encodings properly, and that could be a source of problems. You should change your code to specify an encoding (such as "UTF-8") when converting the String to an array of bytes, or just pass a StringReader to unmarshalDocument() rather than the input stream.
- Dennis Dennis M. Sosnoski SOA, Web Services, and XML Training and Consulting http://www.sosnoski.com - http://www.sosnoski.co.nz Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117 Roy wrote: > Hello, > > I use jibx to retrieve from catalog names. The response binding > contains a collection field of user objects. Every user has 10 > fields (names, addresses,phone numbers etc). A simple form of the > response i this below: > > <UserList> > <Users> > <user> > <name></name> > <lastname></lastname> > ...... > ..... > </user> > <user> > <name></name> > <lastname></lastname> > ...... > ..... > </user> > .... > ... > </Users> > </UserList> > > The problem when the response contains lot of users. For example i > tried with 3 users and the document unmarshalled fine. I tried with > more than 5 and the process freezes during the unmarshalling. > > This is the class i use for unmarshalling: The stringXml var contains > the response. > > public static Object xmlToObj(String xmlString) throws JiBXException{ > Object responseObj = new Object(); > > ByteArrayInputStream bin = new ByteArrayInputStream > (xmlString.getBytes ()); > IBindingFactory bfact = > BindingDirectory.getFactory(ResponseMessage.class); > IUnmarshallingContext uctx = > bfact.createUnmarshallingContext(); > responseObj = uctx.unmarshalDocument(bin, null); > > return responseObj; > } > > When i use a lot of data the process freezes in the > uctx.unmarshalDocument(bin, null); command. > > Any ideas about this problem? > > Thank you, > Roy > > > > __________________________________________________ > Χρησιμοποιείτε Yahoo!; > Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail διαθέτει την > καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων > http://mail.yahoo.gr > > ------------------------------------------------------------------------ > > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users