simple-support Mailing List for Simple (Page 19)
Brought to you by:
niallg
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(13) |
May
(13) |
Jun
(27) |
Jul
(4) |
Aug
(14) |
Sep
(7) |
Oct
|
Nov
(6) |
Dec
(24) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(21) |
Mar
(10) |
Apr
(15) |
May
(24) |
Jun
(24) |
Jul
(30) |
Aug
(5) |
Sep
(19) |
Oct
(27) |
Nov
(16) |
Dec
(24) |
| 2009 |
Jan
(34) |
Feb
(24) |
Mar
(35) |
Apr
(26) |
May
(8) |
Jun
(17) |
Jul
(28) |
Aug
(31) |
Sep
(36) |
Oct
(35) |
Nov
(20) |
Dec
(16) |
| 2010 |
Jan
(40) |
Feb
(21) |
Mar
(47) |
Apr
(45) |
May
(34) |
Jun
(68) |
Jul
(46) |
Aug
(39) |
Sep
(47) |
Oct
(20) |
Nov
(42) |
Dec
(13) |
| 2011 |
Jan
(41) |
Feb
(16) |
Mar
(32) |
Apr
(44) |
May
(28) |
Jun
(35) |
Jul
(37) |
Aug
(33) |
Sep
(60) |
Oct
(20) |
Nov
(35) |
Dec
(23) |
| 2012 |
Jan
(34) |
Feb
(23) |
Mar
(34) |
Apr
(21) |
May
(48) |
Jun
(24) |
Jul
(31) |
Aug
(39) |
Sep
(25) |
Oct
(10) |
Nov
(27) |
Dec
(28) |
| 2013 |
Jan
(32) |
Feb
(24) |
Mar
(24) |
Apr
(9) |
May
(4) |
Jun
(6) |
Jul
(2) |
Aug
(5) |
Sep
|
Oct
(5) |
Nov
(1) |
Dec
(12) |
| 2014 |
Jan
(14) |
Feb
(16) |
Mar
(5) |
Apr
(3) |
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(6) |
Oct
|
Nov
(6) |
Dec
|
| 2015 |
Jan
(3) |
Feb
(15) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2016 |
Jan
|
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Dennis B. <bij...@gm...> - 2012-04-21 12:16:07
|
Hi Kyle, I created a SED script to convert java source genererated with xjc to simple framework, I reported this a while ago to this list: See: http://old.nabble.com/xjc-created-jaxb-source-from-XML-schema-to-simpleframework-td32442003.html I succesfully used this on Android for hundreds of differently-typed objects. Kind regards, Dennis Bijwaard * kyle polich <kyl...@gm...> [700101 01:00]: > Hi All, > > I had been doing development using Jaxb for a desktop Java application. The > XML schema I am using has an XSD file which defines over 200 objects. I used > the xjc application to create all the class files I needed. I want to port my > application to Android, and discovered there is no support for Jaxb there. > Many posts pointed me to the wonderfully light weight SimpleXML library. > > My problem is that SimpleXML does not support the annotations used in the class > files created by xjc. Is there an equivalent tool for SimpleXML which can > produce compatible classes from an XSD file? Alternatively, is there any tool > for translating the annotations I have now into ones SimpleXML will like? > > Thanks, > > Kyle > |
|
From: Robert M. <rob...@gm...> - 2012-04-21 07:24:01
|
No there is not. But there has been alot of interest in writing a translator from JAXB annotations to Simple XML ones for exactly this reason. Maybe somebody will do it soon but currently there are no options other than to do this manually. You might have some luck with find-and-replace code. Robert On Sat, Apr 21, 2012 at 4:47 PM, kyle polich <kyl...@gm...> wrote: > Hi All, > > I had been doing development using Jaxb for a desktop Java application. > The XML schema I am using has an XSD file which defines over 200 objects. > I used the xjc application to create all the class files I needed. I want > to port my application to Android, and discovered there is no support for > Jaxb there. Many posts pointed me to the wonderfully light weight > SimpleXML library. > > My problem is that SimpleXML does not support the annotations used in the > class files created by xjc. Is there an equivalent tool for SimpleXML > which can produce compatible classes from an XSD file? Alternatively, is > there any tool for translating the annotations I have now into ones > SimpleXML will like? > > Thanks, > > Kyle > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > > |
|
From: kyle p. <kyl...@gm...> - 2012-04-21 06:47:50
|
Hi All, I had been doing development using Jaxb for a desktop Java application. The XML schema I am using has an XSD file which defines over 200 objects. I used the xjc application to create all the class files I needed. I want to port my application to Android, and discovered there is no support for Jaxb there. Many posts pointed me to the wonderfully light weight SimpleXML library. My problem is that SimpleXML does not support the annotations used in the class files created by xjc. Is there an equivalent tool for SimpleXML which can produce compatible classes from an XSD file? Alternatively, is there any tool for translating the annotations I have now into ones SimpleXML will like? Thanks, Kyle |
|
From: azan <mic...@ho...> - 2012-04-14 10:46:34
|
Thanks now it works ^^ , simple is really a great tool :p and have a great
comunity :p
I haven't see those type of element for collection ^^' my bad .
azan wrote:
>
> Hi ,
> I'm trying to deserialise a class that simple have well serialized , the
> prob is that it doesnt return any error but the class is in fact badly
> deserialized everytime i try to access a variable or a my int table the
> program fail but Simple doesnt give me any error so ... i'm a little lost.
>
> Here is the code of my class :
> (i precise that i have used constructor injection ... it doesnt work) if
> someone have a solution :)
>
> @Root
> public class Training {
>
>
> public Training(){
> super();
> }
>
> public Training(int[] p ,int [] r ,int c){
>
> setRunning( r );
> setPause(p);
> setCycleNumber (c);
>
> }
>
> @Element(name="running")
> private int[] running;
>
> public int[] getRunning() {
> return running;
> }
>
> public void setRunning(int[] running) {
> this.running = running;
> }
>
>
> @Element(name="pause")
> private int[] pause;
>
> public int[] getPause() {
> return pause;
> }
>
> public void setPause(int[] pause) {
> this.pause = pause;
> }
>
> @Element(name="cycleNumber")
> private int cycleNumber;
>
> public int getCycleNumber() {
> return cycleNumber;
> }
>
> public void setCycleNumber(int cycleNumber) {
> this.cycleNumber = cycleNumber;
> }
>
>
>
--
View this message in context: http://old.nabble.com/Problem-with-deserialization-tp33685933p33686404.html
Sent from the Simple XML Serialization mailing list archive at Nabble.com.
|
|
From: Niall G. <gal...@ya...> - 2012-04-14 09:53:31
|
Perhaps use @ElementArray rather than @Element. I am not sure what the issue could be here, can u create a TestCase to illustrate the error. Then I can take a look. Thanks Niall.
--- On Sat, 14/4/12, azan <mic...@ho...> wrote:
From: azan <mic...@ho...>
Subject: [Simple-support] Problem with deserialization
To: sim...@li...
Received: Saturday, 14 April, 2012, 12:53 AM
Hi ,
I'm trying to deserialise a class that simple have well serialized , the
prob is that it doesnt return any error but the class is in fact badly
deserialized everytime i try to access a variable or a my int table the
program fail but Simple doesnt give me any error so ... i'm a little lost.
Here is the code of my class :
(i precise that i have used constructor injection ... it doesnt work) if
someone have a solution :)
@Root
public class Training {
public Training(){
super();
}
public Training(int[] p ,int [] r ,int c){
setRunning( r );
setPause(p);
setCycleNumber (c);
}
@Element(name="running")
private int[] running;
public int[] getRunning() {
return running;
}
public void setRunning(int[] running) {
this.running = running;
}
@Element(name="pause")
private int[] pause;
public int[] getPause() {
return pause;
}
public void setPause(int[] pause) {
this.pause = pause;
}
@Element(name="cycleNumber")
private int cycleNumber;
public int getCycleNumber() {
return cycleNumber;
}
public void setCycleNumber(int cycleNumber) {
this.cycleNumber = cycleNumber;
}
--
View this message in context: http://old.nabble.com/Problem-with-deserialization-tp33685933p33685933.html
Sent from the Simple XML Serialization mailing list archive at Nabble.com.
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: azan <mic...@ho...> - 2012-04-14 07:53:17
|
Hi ,
I'm trying to deserialise a class that simple have well serialized , the
prob is that it doesnt return any error but the class is in fact badly
deserialized everytime i try to access a variable or a my int table the
program fail but Simple doesnt give me any error so ... i'm a little lost.
Here is the code of my class :
(i precise that i have used constructor injection ... it doesnt work) if
someone have a solution :)
@Root
public class Training {
public Training(){
super();
}
public Training(int[] p ,int [] r ,int c){
setRunning( r );
setPause(p);
setCycleNumber (c);
}
@Element(name="running")
private int[] running;
public int[] getRunning() {
return running;
}
public void setRunning(int[] running) {
this.running = running;
}
@Element(name="pause")
private int[] pause;
public int[] getPause() {
return pause;
}
public void setPause(int[] pause) {
this.pause = pause;
}
@Element(name="cycleNumber")
private int cycleNumber;
public int getCycleNumber() {
return cycleNumber;
}
public void setCycleNumber(int cycleNumber) {
this.cycleNumber = cycleNumber;
}
--
View this message in context: http://old.nabble.com/Problem-with-deserialization-tp33685933p33685933.html
Sent from the Simple XML Serialization mailing list archive at Nabble.com.
|
|
From: Niall G. <gal...@ya...> - 2012-04-10 12:02:47
|
File should work automatically, what happens when u use @Element or @Attribute?
--- On Tue, 10/4/12, Aaron Digulla <di...@he...> wrote:
From: Aaron Digulla <di...@he...>
Subject: Re: [Simple-support] XML file path in deserialized objects
To: sim...@li...
Received: Tuesday, 10 April, 2012, 3:07 AM
Zitat von Jens Wurster <jw...@to...>:
> how can I get the xml file path (or object) in deserialized objects?
Write a helper/factory method that calls serializer.read(), sets the
field and then returns the new instance.
Regards,
> For example:
>
> Test obj = serializer.read(Test.class, new File("test.xml"));
>
> @Root
> public class Test implements Serializable {
>
> @Attribute
> private String id;
>
> @File
> private File file; // This should contain the file path or object
> of the xml file
>
> public String getId() {
> return id;
> }
> }
>
> Thanks and
> best regards
>
> Jens
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
>
--
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/ http://blog.pdark.de/
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Aaron D. <di...@he...> - 2012-04-10 10:08:01
|
Zitat von Jens Wurster <jw...@to...>:
> how can I get the xml file path (or object) in deserialized objects?
Write a helper/factory method that calls serializer.read(), sets the
field and then returns the new instance.
Regards,
> For example:
>
> Test obj = serializer.read(Test.class, new File("test.xml"));
>
> @Root
> public class Test implements Serializable {
>
> @Attribute
> private String id;
>
> @File
> private File file; // This should contain the file path or object
> of the xml file
>
> public String getId() {
> return id;
> }
> }
>
> Thanks and
> best regards
>
> Jens
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
>
--
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
http://www.pdark.de/ http://blog.pdark.de/
|
|
From: Jens W. <jw...@to...> - 2012-04-10 09:35:50
|
Hi there,
how can I get the xml file path (or object) in deserialized objects?
For example:
Test obj = serializer.read(Test.class, new File("test.xml"));
@Root
public class Test implements Serializable {
@Attribute
private String id;
@File
private File file; // This should contain the file path or object of the xml file
public String getId() {
return id;
}
}
Thanks and
best regards
Jens
|
|
From: Eddy U. <edd...@we...> - 2012-04-03 22:17:10
|
sorry, just forgot to paste the full error stack: http://pastebin.com/7Nrk1esD - eddy 2012/4/4 Eddy Unruh <edd...@we...> > Hello everybody, > > > I am trying to use the Simple XML library with Android and getting some > errors with it, where the main error is this: > "org.eclipse.persistence.indirection.IndirectList in loader > dalvik.system.PathClassLoader..." > > The Model which has to be deserialized is also used by a rest-server to > produce the necessary XML, there are also some JPA-annotations like the > following: > @OneToMany > @ElementList(required = false) > private List<Substance> substances = new ArrayList<>(); > > this line produces the following xml output: > <substances class="org.eclipse.persistence.indirection.IndirectList"> > ... > </substances> > > Here I see now where the error is coming from - Android is not aware of > org.eclipse.persistence! > But my question is now: Why is the line class="...IndirectList" produced > and how can I change that to avoid the errors in the Android application? > > > Best regards > eddy > > |
|
From: Eddy U. <edd...@we...> - 2012-04-03 22:14:35
|
Hello everybody, I am trying to use the Simple XML library with Android and getting some errors with it, where the main error is this: "org.eclipse.persistence.indirection.IndirectList in loader dalvik.system.PathClassLoader..." The Model which has to be deserialized is also used by a rest-server to produce the necessary XML, there are also some JPA-annotations like the following: @OneToMany @ElementList(required = false) private List<Substance> substances = new ArrayList<>(); this line produces the following xml output: <substances class="org.eclipse.persistence.indirection.IndirectList"> ... </substances> Here I see now where the error is coming from - Android is not aware of org.eclipse.persistence! But my question is now: Why is the line class="...IndirectList" produced and how can I change that to avoid the errors in the Android application? Best regards eddy |
|
From: Niall G. <gal...@ya...> - 2012-04-03 14:38:50
|
See @ElementUnion, @ElementListUnion, @ElementMapUnion, I think this might solve your problem, you just need to ensure the Apply class can cope with different operators and parameters using different classes, I think it should work. --- On Mon, 2/4/12, Dave Murray-Rust <D.M...@ed...> wrote: From: Dave Murray-Rust <D.M...@ed...> Subject: [Simple-support] SimpleXML and MathML To: sim...@li... Received: Monday, 2 April, 2012, 4:29 AM Hi, I'd like to use SimpleXML to build class hierarchies from MathML - I've been using simple for a while, and I don't like having to go back to the standard XML ways of doing things. However, it seems like MathML is difficult to deal with. Each element can contain arbitrary MathML structures, and the element names change depending on what the element is. So as an example: <m:apply> <m:minus/> <m:cn>3</m:cn> <m:ci>x</m:ci> </m:apply> This should be 3-x. The issue I'm having is: * an apply can have any number of children * the children can all have different names I can deal with the element names and namespaces in isolation, so I can manage linking <m:ci> with a Variable class. I can't figure out any annotations I could add to an Apply class, though, which would let it pick up a bunch of different elements. <m:minus> could be all sorts of other things, <m:cn> could be another <m:apply> with it's own set of content etc. I'm starting to feel that this is so far outside what Simple deals with, that it will get too complicated. But, if there's a nice elegant solution, that would be fantastic. Cheers, dave -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Dave Murray-R. <D.M...@ed...> - 2012-04-02 11:30:08
|
Hi, I'd like to use SimpleXML to build class hierarchies from MathML - I've been using simple for a while, and I don't like having to go back to the standard XML ways of doing things. However, it seems like MathML is difficult to deal with. Each element can contain arbitrary MathML structures, and the element names change depending on what the element is. So as an example: <m:apply> <m:minus/> <m:cn>3</m:cn> <m:ci>x</m:ci> </m:apply> This should be 3-x. The issue I'm having is: * an apply can have any number of children * the children can all have different names I can deal with the element names and namespaces in isolation, so I can manage linking <m:ci> with a Variable class. I can't figure out any annotations I could add to an Apply class, though, which would let it pick up a bunch of different elements. <m:minus> could be all sorts of other things, <m:cn> could be another <m:apply> with it's own set of content etc. I'm starting to feel that this is so far outside what Simple deals with, that it will get too complicated. But, if there's a nice elegant solution, that would be fantastic. Cheers, dave -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
|
From: Eddy U. <edd...@we...> - 2012-03-28 18:29:11
|
Hi, any new hints about that problem? =/ I'm still struggling around with it... regards eddy ~~~ www.eduardunruh.de 2012/3/19 Eddy Unruh <edd...@we...> > Hi, > > sorry for the late response. What do you mean exactly by "...writing XML > out"? Wrinting it to the console? > (I'm german and my english is not the best - sorry :-/ ) > > > regards > eddy > > ~~~ > www.eduardunruh.de > > > 2012/3/14 Niall Gallagher <gal...@ya...> > >> Hi, >> >> I took a quick look, and it seems this error could only happen when >> writing the XML out, is this when it happens? >> >> Thanks, >> Niall >> >> >> >> --- On *Wed, 14/3/12, Eddy Unruh <edd...@we...>* wrote: >> >> >> From: Eddy Unruh <edd...@we...> >> Subject: Re: [Simple-support] Stackoverflow in Simple XML >> To: "Niall Gallagher" <gal...@ya...> >> Cc: sim...@li... >> Received: Wednesday, 14 March, 2012, 5:42 AM >> >> >> Hi, >> >> how do I check this property? Iam using glassfish 3.1.1... executed this >> line of >> code: XMLInputFactory.newInstance().getProperty(XMLInputFactory.IS_NAMESPACE_AWARE) >> >> which returned "true"; >> >> Here is one example-console-output of the error: >> >> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> >> <shoppinglistItem> >> <id>0</id> >> <article> >> <id>16</id> >> <name>Schwartau Erdbeer Marmelade</name> >> <price>1.12</price> >> <description>EXTRA Konfitüre Erdbeer Gönnen Sie sich das erste >> Extra des Tages mit Schwartau Extra. Schwartau Für Schwartau Extra sind nur >> ausgesuchte Früchte gut genug.</description> >> <picture> >> http://localhost:8081/capstore/images/articles/schwartau-erdbeer.png >> </picture> >> <ean>124</ean> >> <substances class="java.util.ArrayList"/> >> <comments class="java.util.ArrayList"/> >> <ratings class="java.util.ArrayList"/> >> <stores class="java.util.ArrayList"> >> <store> >> <id>4</id> >> <name>Rewe</name> >> <picture> >> http://localhost:8081/capstore/images/stores/store3.jpg</picture> >> <address> >> <id>9</id> >> <street>Kurfürstenallee</street> >> <number>32</number> >> <plz>28211</plz> >> <city>Bremen</city> >> <gpsLatitude>53.082477</gpsLatitude> >> <gpsLongitude>8.84614</gpsLongitude> >> </address> >> <openinghours>Mo. - Fr. von 10.00 - 21.00 Uhr</openinghours> >> <email>su...@re... <http://mc/compose?to=...@re...> >> </email> >> <phone>0521/2483349</phone> >> <offer>http://localhost:8081/capstore/images/offers/offer.jpg >> </offer> >> </store> >> </stores> >> </article> >> <count>1</count> >> </shoppinglistItem> >> >> at >> org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) >> at >> org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) >> at >> org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) >> at >> org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) >> at >> org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) >> at >> org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) >> at >> org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) >> at >> org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) >> at >> org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) >> at >> org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) >> ... >> >> >> regards >> eddy >> ~~~ >> www.eduardunruh.de >> >> >> 2012/3/14 Niall Gallagher <gal...@ya...<http://mc/compose?to=...@ya...> >> > >> >> Next time it happens dump out the XML it occurs with. I think this may >> have something to do with the weblogic stax parser. At any rate the XML is >> the most important part here, I think it is has a prefix without a >> reference. Or your StAX parser is NOT enabled for namespaces...Check out >> the StAX config option. >> >> javax.xml.stream.isNamespaceAware=true >> >> >> --- On *Wed, 14/3/12, Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> >> >* wrote: >> >> >> From: Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> >> > >> Subject: Re: [Simple-support] Stackoverflow in Simple XML >> To: "Niall Gallagher" <gal...@ya...<http://mc/compose?to=...@ya...> >> > >> Cc: sim...@li...<http://mc/compose?to=...@li...> >> Received: Wednesday, 14 March, 2012, 4:51 AM >> >> >> Hi, >> >> thanks for your reply! >> I've posted some code here: http://pastebin.de/24221 >> The class, which is (de)serialized and the methods... >> >> Im using no XML parser - only the SimpleXML-tools.. or what do you mean? >> >> The strange thing is, that it does not always occur and its not always >> the same object... it behaves really randomly.. >> >> >> regards >> eddy >> >> >> >> 2012/3/13 Niall Gallagher <gal...@ya...<http://mc/compose?to=...@ya...> >> > >> >> Can u provide some code to illustrate your annotated class, also what XML >> parser are u using? >> >> --- On *Tue, 13/3/12, Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> >> >* wrote: >> >> >> From: Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> >> > >> Subject: [Simple-support] Stackoverflow in Simple XML >> To: sim...@li...<http://mc/compose?to=...@li...> >> Received: Tuesday, 13 March, 2012, 3:13 AM >> >> >> Hi, >> >> I have currently a problem with the library which I am not able to solve >> on my own.. =/ >> The problem is also posted here: >> http://stackoverflow.com/questions/9676138/simple-xml-framework-weird-error >> >> >> I would be very happy if someone could help me an give me a hint... >> >> >> regards >> Eddy >> >> >> -----Inline Attachment Follows----- >> >> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-d2d >> >> -----Inline Attachment Follows----- >> >> _______________________________________________ >> Simple-support mailing list >> Sim...@li...<http://mc/compose?to=...@li...> >> https://lists.sourceforge.net/lists/listinfo/simple-support >> >> >> >> > |
|
From: Tamás B. <bar...@gm...> - 2012-03-28 07:07:34
|
Hi, And how can I set a custom converter? @ElementMap(entry="parameter", key="name", attribute=true, inline=true, required=false) @Convert(MapConverter.class) protected Map<String, Object> parameters = new HashMap<String, Object>(); Methods of MapConverter aren't called. Tamás On 28 March 2012 06:46, Niall Gallagher <gal...@ya...> wrote: > Hi, > > I would have to take a look at the TreeStrategy to see what is happening. > In the meantime you can always write a custom Converter to handle this > particular map. > > Niall > > --- On *Tue, 27/3/12, Tamás Barta <bar...@gm...>* wrote: > > > From: Tamás Barta <bar...@gm...> > Subject: [Simple-support] Question > To: sim...@li... > Received: Tuesday, 27 March, 2012, 7:07 AM > > Hi, > > I would like to serialize a properties map like this: > > @ElementMap(entry="parameter", key="name", attribute=true, > inline=true, required=false) > protected Map<String, Object> parameters; > > If this map has an Integer or String object then everything is ok. > If I put a String[] object to the map then I got the following exception: > > 03-27 16:01:46.283: java.lang.NullPointerException > 03-27 16:01:46.283: at > org.simpleframework.xml.strategy.TreeStrategy.write(TreeStrategy.java:191) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Source.setOverride(Source.java:394) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Traverser.write(Traverser.java:235) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.CompositeValue.write(CompositeValue.java:189) > 03-27 16:01:46.283: at > > org.simpleframework.xml.core.CompositeInlineMap.write(CompositeInlineMap.java:250) > 03-27 16:01:46.283: at > > org.simpleframework.xml.core.CompositeInlineMap.write(CompositeInlineMap.java:225) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.write(Composite.java:1042) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.write(Composite.java:1019) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Traverser.write(Traverser.java:236) > 03-27 16:01:46.283: at > > org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:268) > 03-27 16:01:46.283: at > > org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:245) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.write(Composite.java:1042) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Composite.write(Composite.java:1019) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Traverser.write(Traverser.java:236) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Traverser.write(Traverser.java:208) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Traverser.write(Traverser.java:186) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1187) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1169) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1147) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1266) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1248) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1229) > 03-27 16:01:46.283: at > org.simpleframework.xml.core.Persister.write(Persister.java:1208) > > > It seems that the TreeStrategy.writeArray method returns null when try > to call Class<Objecŧ>.getComponentType. > > Is there a solution to serialize a String array or a collection inside > this map? > > Thanks, > Tamas > > > > -- > Tamás > > ----------------------------------- > Check it: http://bartat.hu > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Simple-support mailing list > Sim...@li...<http://mc/compose?to=...@li...> > https://lists.sourceforge.net/lists/listinfo/simple-support > > -- Tamás ----------------------------------- Check it: http://bartat.hu |
|
From: Niall G. <gal...@ya...> - 2012-03-28 04:46:48
|
Hi, I would have to take a look at the TreeStrategy to see what is happening. In the meantime you can always write a custom Converter to handle this particular map. Niall --- On Tue, 27/3/12, Tamás Barta <bar...@gm...> wrote: From: Tamás Barta <bar...@gm...> Subject: [Simple-support] Question To: sim...@li... Received: Tuesday, 27 March, 2012, 7:07 AM Hi, I would like to serialize a properties map like this: @ElementMap(entry="parameter", key="name", attribute=true, inline=true, required=false) protected Map<String, Object> parameters; If this map has an Integer or String object then everything is ok. If I put a String[] object to the map then I got the following exception: 03-27 16:01:46.283: java.lang.NullPointerException 03-27 16:01:46.283: at org.simpleframework.xml.strategy.TreeStrategy.write(TreeStrategy.java:191) 03-27 16:01:46.283: at org.simpleframework.xml.core.Source.setOverride(Source.java:394) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:235) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeValue.write(CompositeValue.java:189) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineMap.write(CompositeInlineMap.java:250) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineMap.write(CompositeInlineMap.java:225) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1042) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1019) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:236) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:268) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:245) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1042) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1019) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:236) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:208) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:186) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1187) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1169) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1147) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1266) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1248) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1229) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1208) It seems that the TreeStrategy.writeArray method returns null when try to call Class<Objecŧ>.getComponentType. Is there a solution to serialize a String array or a collection inside this map? Thanks, Tamas -- Tamás ----------------------------------- Check it: http://bartat.hu ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Tamás B. <bar...@gm...> - 2012-03-27 14:08:24
|
Hi, I would like to serialize a properties map like this: @ElementMap(entry="parameter", key="name", attribute=true, inline=true, required=false) protected Map<String, Object> parameters; If this map has an Integer or String object then everything is ok. If I put a String[] object to the map then I got the following exception: 03-27 16:01:46.283: java.lang.NullPointerException 03-27 16:01:46.283: at org.simpleframework.xml.strategy.TreeStrategy.write(TreeStrategy.java:191) 03-27 16:01:46.283: at org.simpleframework.xml.core.Source.setOverride(Source.java:394) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:235) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeValue.write(CompositeValue.java:189) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineMap.write(CompositeInlineMap.java:250) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineMap.write(CompositeInlineMap.java:225) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1042) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1019) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:236) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:268) 03-27 16:01:46.283: at org.simpleframework.xml.core.CompositeInlineList.write(CompositeInlineList.java:245) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1331) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElement(Composite.java:1314) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeUnion(Composite.java:1194) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeElements(Composite.java:1165) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.writeSection(Composite.java:1071) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1042) 03-27 16:01:46.283: at org.simpleframework.xml.core.Composite.write(Composite.java:1019) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:236) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:208) 03-27 16:01:46.283: at org.simpleframework.xml.core.Traverser.write(Traverser.java:186) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1187) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1169) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1147) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1266) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1248) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1229) 03-27 16:01:46.283: at org.simpleframework.xml.core.Persister.write(Persister.java:1208) It seems that the TreeStrategy.writeArray method returns null when try to call Class<Objecŧ>.getComponentType. Is there a solution to serialize a String array or a collection inside this map? Thanks, Tamas -- Tamás ----------------------------------- Check it: http://bartat.hu |
|
From: Niall G. <gal...@ya...> - 2012-03-27 13:26:09
|
Use non-strict parsing, with Persister.read(Class, InputStream, boolean), set the boolean to false. It will then only read the XML elements matching annotations. --- On Mon, 26/3/12, Uriel Frankel <uri...@gm...> wrote: From: Uriel Frankel <uri...@gm...> Subject: [Simple-support] how to deserialize part of XML file To: sim...@li... Received: Monday, 26 March, 2012, 4:38 AM Hi I have a very big xml file with only a few things that i am interested in. how can I deserialize only part of the file? thank you Uriel Frankel -----Inline Attachment Follows----- ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Uriel F. <uri...@gm...> - 2012-03-26 11:39:18
|
Hi I have a very big xml file with only a few things that i am interested in. how can I deserialize only part of the file? thank you Uriel Frankel |
|
From: Christian P. <Chr...@ca...> - 2012-03-21 10:38:12
|
Hi,
problem is solved thanks to Onno's post. Turned out to be perfectly applicable. Thanks!
Christian
Von: Niall Gallagher [mailto:gal...@ya...]
Gesendet: Mittwoch, 21. März 2012 04:23
An: sim...@li...; Christian Paul
Betreff: Re: [Simple-support] deserializing inheritance in differently shaped XML
Hi,
Can u provide the stack trace? Also, has the class got a no argument constructor?
Niall
--- On Tue, 20/3/12, Christian Paul <Chr...@ca...> wrote:
From: Christian Paul <Chr...@ca...>
Subject: [Simple-support] deserializing inheritance in differently shaped XML
To: sim...@li...
Received: Tuesday, 20 March, 2012, 10:53 AM
Hello,
I'm using simple and I want to parse an xml file that looks something like this:
..
<pages name="page1">
<widgets xsi:type="thisModel:Button" name="btn1"/>
</pages>
..
"Button" subclasses the abstract "Widget".
My problem is: how can I make simple understand that? Serialized with Simple itself it would probably be sth. like: <widgets class="thisModel:Button" name="btn1" > .
But in the presented way, I get the error: "Cannot instantiate class thisModel.Widget for class thisModel.Widget".
What can I do? I'm really thankful for every hint.
Christian
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Christian P. <Chr...@ca...> - 2012-03-21 08:58:19
|
Hi,
thanks for the quick response! The constructor should not be the source of the problem, as first, "Widget" is an abstract class, and second, when I serialized the class structure with simple, the deserialization worked fine. I now wonder, is there a way to make simple realize that <widgets xsi:type="thisModel:Button" name="btn1"/> means that a subclass of widget, a button, needs to be created? Or is the only solution to make the abstract class concrete and give it an attribute named "type"?
The stack trace:
org.simpleframework.xml.core.InstantiationException: Cannot instantiate class thismodel.Widget for class thismodel.Widget
at org.simpleframework.xml.core.ObjectFactory.getInstance(ObjectFactory.java:68)
at org.simpleframework.xml.core.Composite.read(Composite.java:141)
at org.simpleframework.xml.core.Traverser.read(Traverser.java:92)
at org.simpleframework.xml.core.CompositeInlineList.read(CompositeInlineList.java:190)
at org.simpleframework.xml.core.CompositeInlineList.read(CompositeInlineList.java:167)
at org.simpleframework.xml.core.CompositeInlineList.read(CompositeInlineList.java:124)
at org.simpleframework.xml.core.Composite.readVariable(Composite.java:687)
at org.simpleframework.xml.core.Composite.readInstance(Composite.java:635)
at org.simpleframework.xml.core.Composite.readUnion(Composite.java:610)
at org.simpleframework.xml.core.Composite.readElement(Composite.java:593)
at org.simpleframework.xml.core.Composite.readElements(Composite.java:506)
at org.simpleframework.xml.core.Composite.readSection(Composite.java:388)
at org.simpleframework.xml.core.Composite.read(Composite.java:367)
at org.simpleframework.xml.core.Composite.readDefault(Composite.java:262)
at org.simpleframework.xml.core.Composite.read(Composite.java:232)
at org.simpleframework.xml.core.Composite.read(Composite.java:202)
at org.simpleframework.xml.core.Composite.read(Composite.java:150)
at org.simpleframework.xml.core.Traverser.read(Traverser.java:92)
at org.simpleframework.xml.core.CompositeInlineList.read(CompositeInlineList.java:190)
at org.simpleframework.xml.core.CompositeInlineList.read(CompositeInlineList.java:167)
at org.simpleframework.xml.core.CompositeInlineList.read(CompositeInlineList.java:124)
at org.simpleframework.xml.core.Composite.readVariable(Composite.java:687)
at org.simpleframework.xml.core.Composite.readInstance(Composite.java:635)
at org.simpleframework.xml.core.Composite.readUnion(Composite.java:610)
at org.simpleframework.xml.core.Composite.readElement(Composite.java:593)
at org.simpleframework.xml.core.Composite.readElements(Composite.java:506)
at org.simpleframework.xml.core.Composite.readSection(Composite.java:388)
at org.simpleframework.xml.core.Composite.read(Composite.java:367)
at org.simpleframework.xml.core.Composite.read(Composite.java:234)
at org.simpleframework.xml.core.Composite.read(Composite.java:202)
at org.simpleframework.xml.core.Composite.read(Composite.java:150)
at org.simpleframework.xml.core.Traverser.read(Traverser.java:92)
at org.simpleframework.xml.core.Persister.read(Persister.java:632)
at org.simpleframework.xml.core.Persister.read(Persister.java:613)
at org.simpleframework.xml.core.Persister.read(Persister.java:591)
at org.simpleframework.xml.core.Persister.read(Persister.java:550)
at org.simpleframework.xml.core.Persister.read(Persister.java:528)
at org.simpleframework.xml.core.Persister.read(Persister.java:433)
at test.deserialise(test.java:29)
at test.main(test.java:16)
Exception in thread "main" java.lang.NullPointerException
at test.main(test.java:17)
Thanks so much.
Christian
Von: Niall Gallagher [mailto:gal...@ya...]
Gesendet: Mittwoch, 21. März 2012 04:23
An: sim...@li...; Christian Paul
Betreff: Re: [Simple-support] deserializing inheritance in differently shaped XML
Hi,
Can u provide the stack trace? Also, has the class got a no argument constructor?
Niall
--- On Tue, 20/3/12, Christian Paul <Chr...@ca...> wrote:
From: Christian Paul <Chr...@ca...>
Subject: [Simple-support] deserializing inheritance in differently shaped XML
To: sim...@li...
Received: Tuesday, 20 March, 2012, 10:53 AM
Hello,
I'm using simple and I want to parse an xml file that looks something like this:
..
<pages name="page1">
<widgets xsi:type="thisModel:Button" name="btn1"/>
</pages>
..
"Button" subclasses the abstract "Widget".
My problem is: how can I make simple understand that? Serialized with Simple itself it would probably be sth. like: <widgets class="thisModel:Button" name="btn1" > .
But in the presented way, I get the error: "Cannot instantiate class thisModel.Widget for class thisModel.Widget".
What can I do? I'm really thankful for every hint.
Christian
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
-----Inline Attachment Follows-----
_______________________________________________
Simple-support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simple-support
|
|
From: Niall G. <gal...@ya...> - 2012-03-21 03:23:19
|
Hi, Can u provide the stack trace? Also, has the class got a no argument constructor? Niall --- On Tue, 20/3/12, Christian Paul <Chr...@ca...> wrote: From: Christian Paul <Chr...@ca...> Subject: [Simple-support] deserializing inheritance in differently shaped XML To: sim...@li... Received: Tuesday, 20 March, 2012, 10:53 AM Hello, I'm using simple and I want to parse an xml file that looks something like this: ..<pages name="page1"> <widgets xsi:type="thisModel:Button" name="btn1"/> </pages>.. "Button" subclasses the abstract "Widget". My problem is: how can I make simple understand that? Serialized with Simple itself it would probably be sth. like: <widgets class="thisModel:Button" name="btn1" > . But in the presented way, I get the error: "Cannot instantiate class thisModel.Widget for class thisModel.Widget". What can I do? I'm really thankful for every hint. Christian -----Inline Attachment Follows----- ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Onno H. <on...@aq...> - 2012-03-20 22:42:05
|
Hi Christian, assuming I understood your problem, I may have a hint for you. You can read my solution here: http://sourceforge.net/mailarchive/message.php?msg_id=28693296 I hope I could help, Onno (auch mal bei der CAS gewesen) Am 20.03.2012 um 18:53 schrieb Christian Paul: > Hello, > > I'm using simple and I want to parse an xml file that looks something like this: > > .. > <pages name="page1"> > <widgets xsi:type="thisModel:Button" name="btn1"/> > </pages> > .. > > "Button" subclasses the abstract "Widget". > > My problem is: how can I make simple understand that? Serialized with Simple itself it would probably be sth. like: <widgets class="thisModel:Button" name="btn1" > . > > But in the presented way, I get the error: "Cannot instantiate class thisModel.Widget for class thisModel.Widget". > > What can I do? I'm really thankful for every hint. > > Christian > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure_______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support |
|
From: Christian P. <Chr...@ca...> - 2012-03-20 18:06:24
|
Hello,
I'm using simple and I want to parse an xml file that looks something
like this:
..
<pages name="page1">
<widgets xsi:type="thisModel:Button" name="btn1"/>
</pages>
..
"Button" subclasses the abstract "Widget".
My problem is: how can I make simple understand that? Serialized with
Simple itself it would probably be sth. like: <widgets
class="thisModel:Button" name="btn1" > .
But in the presented way, I get the error: "Cannot instantiate class
thisModel.Widget for class thisModel.Widget".
What can I do? I'm really thankful for every hint.
Christian
|
|
From: Eddy U. <edd...@we...> - 2012-03-18 23:45:13
|
Hi, sorry for the late response. What do you mean exactly by "...writing XML out"? Wrinting it to the console? (I'm german and my english is not the best - sorry :-/ ) regards eddy ~~~ www.eduardunruh.de 2012/3/14 Niall Gallagher <gal...@ya...> > Hi, > > I took a quick look, and it seems this error could only happen when > writing the XML out, is this when it happens? > > Thanks, > Niall > > > > --- On *Wed, 14/3/12, Eddy Unruh <edd...@we...>* wrote: > > > From: Eddy Unruh <edd...@we...> > Subject: Re: [Simple-support] Stackoverflow in Simple XML > To: "Niall Gallagher" <gal...@ya...> > Cc: sim...@li... > Received: Wednesday, 14 March, 2012, 5:42 AM > > > Hi, > > how do I check this property? Iam using glassfish 3.1.1... executed this > line of > code: XMLInputFactory.newInstance().getProperty(XMLInputFactory.IS_NAMESPACE_AWARE) > > which returned "true"; > > Here is one example-console-output of the error: > > <?xml version="1.0" encoding="UTF-8" standalone="yes"?> > <shoppinglistItem> > <id>0</id> > <article> > <id>16</id> > <name>Schwartau Erdbeer Marmelade</name> > <price>1.12</price> > <description>EXTRA Konfitüre Erdbeer Gönnen Sie sich das erste Extra > des Tages mit Schwartau Extra. Schwartau Für Schwartau Extra sind nur > ausgesuchte Früchte gut genug.</description> > <picture> > http://localhost:8081/capstore/images/articles/schwartau-erdbeer.png > </picture> > <ean>124</ean> > <substances class="java.util.ArrayList"/> > <comments class="java.util.ArrayList"/> > <ratings class="java.util.ArrayList"/> > <stores class="java.util.ArrayList"> > <store> > <id>4</id> > <name>Rewe</name> > <picture> > http://localhost:8081/capstore/images/stores/store3.jpg</picture> > <address> > <id>9</id> > <street>Kurfürstenallee</street> > <number>32</number> > <plz>28211</plz> > <city>Bremen</city> > <gpsLatitude>53.082477</gpsLatitude> > <gpsLongitude>8.84614</gpsLongitude> > </address> > <openinghours>Mo. - Fr. von 10.00 - 21.00 Uhr</openinghours> > <email>su...@re... <http://mc/compose?to=...@re...> > </email> > <phone>0521/2483349</phone> > <offer>http://localhost:8081/capstore/images/offers/offer.jpg > </offer> > </store> > </stores> > </article> > <count>1</count> > </shoppinglistItem> > > at > org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) > at > org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) > at > org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) > at > org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) > at > org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) > at > org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) > at > org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) > at > org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) > at > org.simpleframework.xml.stream.PrefixResolver.getPrefix(PrefixResolver.java:123) > at > org.simpleframework.xml.stream.PrefixResolver.resolvePrefix(PrefixResolver.java:183) > ... > > > regards > eddy > ~~~ > www.eduardunruh.de > > > 2012/3/14 Niall Gallagher <gal...@ya...<http://mc/compose?to=...@ya...> > > > > Next time it happens dump out the XML it occurs with. I think this may > have something to do with the weblogic stax parser. At any rate the XML is > the most important part here, I think it is has a prefix without a > reference. Or your StAX parser is NOT enabled for namespaces...Check out > the StAX config option. > > javax.xml.stream.isNamespaceAware=true > > > --- On *Wed, 14/3/12, Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> > >* wrote: > > > From: Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> > > > Subject: Re: [Simple-support] Stackoverflow in Simple XML > To: "Niall Gallagher" <gal...@ya...<http://mc/compose?to=...@ya...> > > > Cc: sim...@li...<http://mc/compose?to=...@li...> > Received: Wednesday, 14 March, 2012, 4:51 AM > > > Hi, > > thanks for your reply! > I've posted some code here: http://pastebin.de/24221 > The class, which is (de)serialized and the methods... > > Im using no XML parser - only the SimpleXML-tools.. or what do you mean? > > The strange thing is, that it does not always occur and its not always the > same object... it behaves really randomly.. > > > regards > eddy > > > > 2012/3/13 Niall Gallagher <gal...@ya...<http://mc/compose?to=...@ya...> > > > > Can u provide some code to illustrate your annotated class, also what XML > parser are u using? > > --- On *Tue, 13/3/12, Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> > >* wrote: > > > From: Eddy Unruh <edd...@we...<http://mc/compose?to=...@we...> > > > Subject: [Simple-support] Stackoverflow in Simple XML > To: sim...@li...<http://mc/compose?to=...@li...> > Received: Tuesday, 13 March, 2012, 3:13 AM > > > Hi, > > I have currently a problem with the library which I am not able to solve > on my own.. =/ > The problem is also posted here: > http://stackoverflow.com/questions/9676138/simple-xml-framework-weird-error > > > I would be very happy if someone could help me an give me a hint... > > > regards > Eddy > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > > -----Inline Attachment Follows----- > > _______________________________________________ > Simple-support mailing list > Sim...@li...<http://mc/compose?to=...@li...> > https://lists.sourceforge.net/lists/listinfo/simple-support > > > > |