Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JAXB

0 views
Skip to first unread message

Lou Blick

unread,
Nov 27, 2001, 9:08:42 AM11/27/01
to
I am trying to use JAXB with a servlet that returns XML. When I pass
the InputStream returned from the servlet into the unmarshal() method,
I receieve the following exception:

java.lang.IllegalArgumentException: Non-positive line number: -1
at javax.xml.marshal.StreamScanPosition.<init>(StreamScanPosition.java:59)
at javax.xml.marshal.StreamScanner.position(StreamScanner.java:377)
at javax.xml.marshal.StreamScanner.next(StreamScanner.java:62)
at javax.xml.marshal.StreamScanner.<init>(StreamScanner.java:46)
at javax.xml.marshal.XMLScanner.open(XMLScanner.java:138)
at examples.binding.model.login.Request.unmarshal(Request.java:110)
at examples.binding.driver.BindingApp.submitRequest(BindingApp.java:333)
at examples.binding.driver.BindingApp.login(BindingApp.java:154)
at examples.binding.driver.BindingApp.<init>(BindingApp.java:120)Class:
java.lang.IllegalArgumentException
at examples.binding.driver.BindingApp.main(BindingApp.java:401)

Here is the code:

InputStream serverIn = httpConn.getInputStream();
Dispatcher dis = Request.newDispatcher();
Request results = ( Request )dis.unmarshal( serverIn );

I have saved the contents of the InputStream using standard the Java
IO libraries, so I know the stream contains valid XML.

Thanks,
Lou

0 new messages