Simplifying the XML when using polymorphism

View: New views
8 Messages — Rating Filter:   Alert me  

Simplifying the XML when using polymorphism

by Herz, Erich :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,
 
I am using Simple for the configuration of a tool I’m developing.  While Simple was not necessarily designed for configuration, I find it easily provides me flexibility that would otherwise be difficult to implement.  For instance, defining nested objects.  I am using polymorphism in the objects that are being deserialized, but this makes writing configurations non-intuitive for users so I’d like to simplify this process.  For example, here’s a filter definition that nests two other filters with “and” logic:
 
                <filter class="full.package.path.to.AndFilter">
                        <filter1 class=”full.package.path.to.FilterA”>
                                <regex>.*blah.*</regex>
                        </filter1>
                        <filter2 class=”full.package.path.to.FilterB”>
                                <regex>.*blah.*</regex>
                        </filter2>
                </filter>
 
 
Is there any way to have Simple determine what class to instantiate based on the uniqueness of the names used?  For instance, I’d like to do something like this:
 
                <and>
                        <filterA>
                                <regex>.*blah.*</regex>
                        </filterA>
                        <filterB>
                                <regex>.*blah.*</regex>
                        </filterB>
                </and>
 
This would be much more intuitive and much easier to read.  The only solution I can think of right now is to provide shorter package paths.  Any help you can provide is appreciated.
 
Thanks,
 
-Erich
 
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Simplifying the XML when using polymorphism

by Niall Gallagher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

Yes this is very easy to do. I will post an example on the tutorial because I get quite a few questions on this very topic. Ill let the mailing list know when the tutorial is online.

Thanks,
Niall

--- On Mon, 8/3/09, Herz, Erich <Erich.Herz@...> wrote:

> From: Herz, Erich <Erich.Herz@...>
> Subject: [Simple-support] Simplifying the XML when using polymorphism
> To: "simple-support@..." <simple-support@...>
> Date: Monday, August 3, 2009, 2:55 PM
>
>
>  
>  
>
>
>
>  
>
> Hi,
>  
> I am using Simple for the configuration of a tool
> I’m developing.  While Simple was not necessarily
> designed for configuration, I find it easily provides me
> flexibility that would otherwise be difficult to
> implement.  For instance, defining nested
> objects. 
> I am using polymorphism in the objects that are being
> deserialized, but this makes writing configurations
> non-intuitive for users so I’d like to simplify this
> process.  For example, here’s a filter definition
> that nests two other filters with “and”
> logic:
>  
>                
> <filter
> class="full.package.path.to.AndFilter">
>                        
> <filter1
> class=”full.package.path.to.FilterA”>
>                                
> <regex>.*blah.*</regex>
>                        
> </filter1>
>                        
> <filter2
> class=”full.package.path.to.FilterB”>
>                                
> <regex>.*blah.*</regex>
>                        
> </filter2>
>                
> </filter>
>  
>  
> Is there any way to have Simple determine what class
> to instantiate based on the uniqueness of the names
> used?  For instance, I’d like to do something
> like this:
>  
>                
> <and>
>                        
> <filterA>
>                                
> <regex>.*blah.*</regex>
>                        
> </filterA>
>                        
> <filterB>
>                                
> <regex>.*blah.*</regex>
>                        
> </filterB>
>                
> </and>
>  
> This would be much more intuitive and much easier to
> read.  The only solution I can think of right now is to
> provide shorter package paths.  Any help you can
> provide is appreciated.
>  
> Thanks,
>  
> -Erich
>  
>  
>
>  
>
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day
> trial. Simplify your report design, integration and
> deployment - and focus on
> what you do best, core application coding. Discover what's
> new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>


     

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Simple doesn't provide enough context when an error occurs

by Rob Griffin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Niall, in general we are very happy with Simple, it works really well for what we are doing; storing quite complex system configuration.

However sometime we come across issue where Simple could be improved.

Here is one such case:

We got this exception:

org.simpleframework.xml.core.TextException: Value for @org.simpleframework.xml.Text(data=false, empty=, required=true) on field 'key' is null
        at org.simpleframework.xml.core.Composite.writeText(Composite.java:908)
        at org.simpleframework.xml.core.Composite.write(Composite.java:761)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.CompositeList.write(CompositeList.java:211)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:257)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:235)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:257)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:235)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:190)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:168)
        at org.simpleframework.xml.core.Persister.write(Persister.java:921)
        at org.simpleframework.xml.core.Persister.write(Persister.java:903)
        at org.simpleframework.xml.core.Persister.write(Persister.java:884)
        at org.simpleframework.xml.core.Persister.write(Persister.java:1000)
        at com.quest.adk.util.xml.SimpleXMLUtils.toString(SimpleXMLUtils.java:79)
        at com.quest.adk.util.xml.SimpleXMLUtils.toXML(SimpleXMLUtils.java:92)
        .... etc.

My problem with this exception is that there is insufficient context to be able to quickly pinpoint the problem. We have a large number of classes that we serialize with Simple, several of which have a key field. Could the error message be expanded to include the class whose field is incorrect? That would be really helpful.

Thanks,


Rob Griffin
Quest Software

www.quest.com




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Simple doesn't provide enough context when an error occurs

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Ya, sure Ill make sure to add this.

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Rob Griffin [mailto:rob.griffin@...]
Sent: 05 August 2009 10:15
To: simple-support@...
Subject: [Simple-support] Simple doesn't provide enough context when an error occurs

Hello,

Niall, in general we are very happy with Simple, it works really well for what we are doing; storing quite complex system configuration.

However sometime we come across issue where Simple could be improved.

Here is one such case:

We got this exception:

org.simpleframework.xml.core.TextException: Value for @org.simpleframework.xml.Text(data=false, empty=, required=true) on field 'key' is null
        at org.simpleframework.xml.core.Composite.writeText(Composite.java:908)
        at org.simpleframework.xml.core.Composite.write(Composite.java:761)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.CompositeList.write(CompositeList.java:211)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:257)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:235)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:257)
        at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:235)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:190)
        at org.simpleframework.xml.core.Traverser.write(Traverser.java:168)
        at org.simpleframework.xml.core.Persister.write(Persister.java:921)
        at org.simpleframework.xml.core.Persister.write(Persister.java:903)
        at org.simpleframework.xml.core.Persister.write(Persister.java:884)
        at org.simpleframework.xml.core.Persister.write(Persister.java:1000)
        at com.quest.adk.util.xml.SimpleXMLUtils.toString(SimpleXMLUtils.java:79)
        at com.quest.adk.util.xml.SimpleXMLUtils.toXML(SimpleXMLUtils.java:92)
        .... etc.

My problem with this exception is that there is insufficient context to be able to quickly pinpoint the problem. We have a large number of classes that we serialize with Simple, several of which have a key field. Could the error message be expanded to include the class whose field is incorrect? That would be really helpful.

Thanks,


Rob Griffin
Quest Software

www.quest.com




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

***********************************************************************************


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Simple doesn't provide enough context whenan error occurs

by Smith, Matthew (BRS) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Niall,

I just wanted to pipe up and add my support for this. I recently tried
to replace my use of JAXB with Simple, but I had to give up because it
was taking too long to figure out all the little issues I was having,
similar to what Mr. Griffin is talking about.

Having more informative errors would almost certainly give me the
courage to try again.

Keep up the stellar work.

-Matthew

-----Original Message-----
From: niall.gallagher@... [mailto:niall.gallagher@...]
Sent: Wednesday, August 05, 2009 5:43 AM
To: rob.griffin@...; simple-support@...
Subject: Re: [Simple-support] Simple doesn't provide enough context
whenan error occurs

Hi,

Ya, sure Ill make sure to add this.

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Rob Griffin [mailto:rob.griffin@...]
Sent: 05 August 2009 10:15
To: simple-support@...
Subject: [Simple-support] Simple doesn't provide enough context when an
error occurs

Hello,

Niall, in general we are very happy with Simple, it works really well
for what we are doing; storing quite complex system configuration.

However sometime we come across issue where Simple could be improved.

Here is one such case:

We got this exception:

org.simpleframework.xml.core.TextException: Value for
@org.simpleframework.xml.Text(data=false, empty=, required=true) on
field 'key' is null
        at
org.simpleframework.xml.core.Composite.writeText(Composite.java:908)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:761)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at
org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at
org.simpleframework.xml.core.CompositeList.write(CompositeList.java:211)
        at
org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at
org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at
org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at
org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at
org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineLi
st.java:257)
        at
org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineLi
st.java:235)
        at
org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at
org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at
org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at
org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at
org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineLi
st.java:257)
        at
org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineLi
st.java:235)
        at
org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
        at
org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
        at
org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:760)
        at
org.simpleframework.xml.core.Composite.write(Composite.java:736)
        at
org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
        at
org.simpleframework.xml.core.Traverser.write(Traverser.java:190)
        at
org.simpleframework.xml.core.Traverser.write(Traverser.java:168)
        at
org.simpleframework.xml.core.Persister.write(Persister.java:921)
        at
org.simpleframework.xml.core.Persister.write(Persister.java:903)
        at
org.simpleframework.xml.core.Persister.write(Persister.java:884)
        at
org.simpleframework.xml.core.Persister.write(Persister.java:1000)
        at
com.quest.adk.util.xml.SimpleXMLUtils.toString(SimpleXMLUtils.java:79)
        at
com.quest.adk.util.xml.SimpleXMLUtils.toXML(SimpleXMLUtils.java:92)
        .... etc.

My problem with this exception is that there is insufficient context to
be able to quickly pinpoint the problem. We have a large number of
classes that we serialize with Simple, several of which have a key
field. Could the error message be expanded to include the class whose
field is incorrect? That would be really helpful.

Thanks,


Rob Griffin
Quest Software

www.quest.com




------------------------------------------------------------------------
------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day trial. Simplify your report design, integration and deployment -
and focus on what you do best, core application coding. Discover what's
new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

************************************************************************
***********
The Royal Bank of Scotland plc. Registered in Scotland No 90312.
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry

out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

************************************************************************
***********


------------------------------------------------------------------------
------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008
30-Day
trial. Simplify your report design, integration and deployment - and
focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

THE INFORMATION CONTAINED IN THIS MESSAGE AND ANY ATTACHMENT MAY BE PRIVILEGED, CONFIDENTIAL, PROPRIETARY OR OTHERWISE PROTECTED FROM DISCLOSURE. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this message and any attachment is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and permanently delete it from your computer and destroy any printout thereof.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Simple doesn't provide enough context when an error occurs

by Niall Gallagher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If anyone can think of any more exceptions that are particularly cryptic then let me know and I will expand on the message.

Thanks,
Niall

--- On Wed, 8/5/09, Rob Griffin <rob.griffin@...> wrote:

> From: Rob Griffin <rob.griffin@...>
> Subject: [Simple-support] Simple doesn't provide enough context when an error occurs
> To: "simple-support@..." <simple-support@...>
> Date: Wednesday, August 5, 2009, 2:14 AM
> Hello,
>
> Niall, in general we are very happy with Simple, it works
> really well for what we are doing; storing quite complex
> system configuration.
>
> However sometime we come across issue where Simple could be
> improved.
>
> Here is one such case:
>
> We got this exception:
>
> org.simpleframework.xml.core.TextException: Value for
> @org.simpleframework.xml.Text(data=false, empty=,
> required=true) on field 'key' is null
>     at
> org.simpleframework.xml.core.Composite.writeText(Composite.java:908)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:761)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:736)
>     at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
>     at
> org.simpleframework.xml.core.CompositeList.write(CompositeList.java:211)
>     at
> org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
>     at
> org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
>     at
> org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:760)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:736)
>     at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
>     at
> org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:257)
>     at
> org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:235)
>     at
> org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
>     at
> org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
>     at
> org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:760)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:736)
>     at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
>     at
> org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:257)
>     at
> org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:235)
>     at
> org.simpleframework.xml.core.Composite.writeElement(Composite.java:983)
>     at
> org.simpleframework.xml.core.Composite.writeElement(Composite.java:964)
>     at
> org.simpleframework.xml.core.Composite.writeElements(Composite.java:854)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:760)
>     at
> org.simpleframework.xml.core.Composite.write(Composite.java:736)
>     at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:217)
>     at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:190)
>     at
> org.simpleframework.xml.core.Traverser.write(Traverser.java:168)
>     at
> org.simpleframework.xml.core.Persister.write(Persister.java:921)
>     at
> org.simpleframework.xml.core.Persister.write(Persister.java:903)
>     at
> org.simpleframework.xml.core.Persister.write(Persister.java:884)
>     at
> org.simpleframework.xml.core.Persister.write(Persister.java:1000)
>     at
> com.quest.adk.util.xml.SimpleXMLUtils.toString(SimpleXMLUtils.java:79)
>     at
> com.quest.adk.util.xml.SimpleXMLUtils.toXML(SimpleXMLUtils.java:92)
>     .... etc.
>
> My problem with this exception is that there is
> insufficient context to be able to quickly pinpoint the
> problem. We have a large number of classes that we serialize
> with Simple, several of which have a key field. Could the
> error message be expanded to include the class whose field
> is incorrect? That would be really helpful.
>
> Thanks,
>
>
> Rob Griffin
> Quest Software
>
> www.quest.com
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day
> trial. Simplify your report design, integration and
> deployment - and focus on
> what you do best, core application coding. Discover what's
> new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>


     

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Simple doesn't provide enough context when an error occurs

by patb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Niall,

> If anyone can think of any more exceptions that are particularly
> cryptic then let me know and I will expand on the message.

recently I got this exception:

---------------------
org.simpleframework.xml.core.PersistenceException: Could not find a constructor
        at org.simpleframework.xml.core.ClassCreator.getInstance(ClassCreator.java:101)
        at org.simpleframework.xml.core.Composite.readConstructor(Composite.java:272)
        at org.simpleframework.xml.core.Composite.read(Composite.java:220)
        at org.simpleframework.xml.core.Composite.read(Composite.java:186)
        at org.simpleframework.xml.core.Composite.read(Composite.java:134)
        ...
---------------------

I would be helpful if Simple could tell me for which class it can't
find a constructor.


Regards,
Timo Rumland


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Simple doesn't provide enough context when an error occurs

by Niall Gallagher-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Thanks, Ill put this on my list.

Niall

--- On Fri, 8/14/09, Timo Rumland <cr@...> wrote:

> From: Timo Rumland <cr@...>
> Subject: Re: [Simple-support] Simple doesn't provide enough context when an error occurs
> To: simple-support@...
> Date: Friday, August 14, 2009, 2:50 PM
> Hello Niall,
>
> > If anyone can think of any more exceptions that are
> particularly
> > cryptic then let me know and I will expand on the
> message.
>
> recently I got this exception:
>
> ---------------------
> org.simpleframework.xml.core.PersistenceException: Could
> not find a constructor
>         at
> org.simpleframework.xml.core.ClassCreator.getInstance(ClassCreator.java:101)
>         at
> org.simpleframework.xml.core.Composite.readConstructor(Composite.java:272)
>         at
> org.simpleframework.xml.core.Composite.read(Composite.java:220)
>         at
> org.simpleframework.xml.core.Composite.read(Composite.java:186)
>         at
> org.simpleframework.xml.core.Composite.read(Composite.java:134)
>         ...
> ---------------------
>
> I would be helpful if Simple could tell me for which class
> it can't
> find a constructor.
>
>
> Regards,
> Timo Rumland
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day
> trial. Simplify your report design, integration and
> deployment - and focus on
> what you do best, core application coding. Discover what's
> new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>


     

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support