Re: [Simple-support] Persister write exception
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-08-06 00:41:03
|
I ant tell, I need the full stack trace.
--- On Fri, 5/8/11, Courtney, Phil <Phi...@sr...> wrote:
From: Courtney, Phil <Philip_Courtney@sra.c>
Subject: [Simple-support] Persister write exception
To: sim...@li...
Received: Friday, 5 August, 2011, 10:03 AM
I am getting the following error when I attempt to write an XML document: ERROR/SolutionPackageDeploymentDescriptor(335): serializer.write exception Element 'providerInformation' not defined in class com.sra.rtapp.spdd.SolutionPackageDeploymentType My test scenario is to read an xml document into a set of classes using Simple framework annotations. The document parses successfully and the classes created are correct. I then attempt to write that set of classes and get the exception. Code excerpts from the SolutionPackageDeploymentDescriptor classes are shown below: public class SolutionPackageDeploymentDescriptor{ … private SolutionPackageDeploymentType itsSolutionPackageDeployment; // the root element public SolutionPackageDeploymentDescriptor( InputStream aInputStream ) throws Exception { Serializer serializer = new Persister(); try {
itsSolutionPackageDeployment = serializer.read( SolutionPackageDeploymentType.class, aInputStream, false ); } catch (Exception exception) { Log.e( TAG, exception.getMessage() ); throw( exception ); } } … public String toString() { Serializer serializer = new Persister(); StringWriter xmlWriter = new StringWriter(); try { serializer.write( itsSolutionPackageDeployment, xmlWriter ); } catch (Exception exception) { Log.e( TAG, "serializer.write exception " + exception.getMessage() ); xmlWriter.append( "serializer.write exception " + exception.getMessage() ); } return xmlWriter.toString(); }} Code excerpts from the SolutionPackageDeploymentType are included below: public class
SolutionPackageDeploymentType extends UniversallyIdentifiedType{ @Element(name = "ProviderInformation", required = true) protected ProviderInformationType providerInformation; … /** * Gets the value of the providerInformation property. * * @return * possible object is * {@link ProviderInformationType } * */ public ProviderInformationType getProviderInformation() { return providerInformation; } /** * Sets the value of the providerInformation property. * * @param value * allowed object is * {@link ProviderInformationType } * */ public void setProviderInformation(ProviderInformationType value) { this.providerInformation = value; } …} Inspecting the variables with a debugger I confirmed that
itsSolutionPackageDeployment providerInformation does contain an instance of ProviderInformationType and its contents are correct. What is causing the write exception? Why can’t the Persister write method recognize providerInformation? Your help is appreciated,Phil
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|