Closed singicus closed 3 years ago
FOUND IT! I am not sure it there is another way but this works: Annotate QBXML.java class with
@XmlRootElement(name = "QBXML")
You'll need to add this import: import javax.xml.bind.annotation.XmlRootElement;
so that your class looks like this (provided a screen shot as well): import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "QBXML")
public class QBXML {
public QBXMLMsgsRs QBXMLMsgsRs;
}
Thanks @singicus, are you deploying this to tomcat or it's a direct run from the code? I have seen that error before too when the Quickbooks Desktop client runs sometimes, so definitely this will be updated.
Best :)
I deployed to Tomcat, ran “Update Selected” from the QBWebConnector, and was debugging in NetBeans using the attached debugger (NetBeans deployment).
From: Edgar Moran notifications@github.com Sent: Monday, November 16, 2020 10:22 PM To: emoran/QuickBooksDesktopService QuickBooksDesktopService@noreply.github.com Cc: singicus sandra@webcatgraphics.com; Mention mention@noreply.github.com Subject: Re: [emoran/QuickBooksDesktopService] JAXB unmarshalling error (#2)
Thanks @singicus https://github.com/singicus , are you deploying this to tomcat or it's a direct run from the code? I have seen that error before too when the Quickbooks Desktop client runs sometimes, so definitely this will be updated.
Best :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/emoran/QuickBooksDesktopService/issues/2#issuecomment-728661107 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AARMRBTEDJ3BWQMR6GSJJK3SQHT4JANCNFSM4TXZZX7Q . https://github.com/notifications/beacon/AARMRBWYBOXOXYEANGSQMRTSQHT4JA5CNFSM4TXZZX72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFNXHY4Y.gif
Is there anything I should be doing to not receive this error:
(QBXML) jaxbUnmarshaller.unmarshal(new StringReader(receiveResponseXML.getResponse())) = >Exception occurred in target VM: unexpected element (uri:"", local:"QBXML"). Expected elements are (none)
This error occurs in the skeleton class. Your example project has: JAXBContext jaxbContext = JAXBContext.newInstance(QBXML.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
QBXML mainDocument = (QBXML) jaxbUnmarshaller.unmarshal(new StringReader(receiveResponseXML.getResponse()));
The error I get is: (QBXML) jaxbUnmarshaller.unmarshal(new StringReader(receiveResponseXML.getResponse())) = >Exception occurred in target VM: unexpected element (uri:"", local:"QBXML"). Expected elements are (none)
Here's the XML request followed by XML response: