XMLSerializer xmlSerializer = new XMLSerializer();
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
15 replies to this topic
#1
Posted 24 January 2012 - 07:21 AM
|
|
|
#2
Posted 24 January 2012 - 11:18 PM
Guys please help me solve this problem, I'm trying to create an xml doc and later make it a json object, any suggestions any one
#3
Posted 25 January 2012 - 12:57 AM
NoClassDefFound is usually a missing library (jar).
#4
Posted 25 January 2012 - 03:30 AM
lol, thank you, let me check that out
---------- Post added at 11:30 AM ---------- Previous post was at 10:33 AM ----------
Nah, i don't know but i can't find that class, can I not instantiate XMLSerialzer the way I tryd?
Then will you please tell me how
---------- Post added at 11:30 AM ---------- Previous post was at 10:33 AM ----------
Nah, i don't know but i can't find that class, can I not instantiate XMLSerialzer the way I tryd?
Then will you please tell me how
#5
Posted 25 January 2012 - 03:48 AM
That class probably comes out of the commons-lang-2.x.jar (apache)
- Where's that XmlSerializer from?
- Is that a web project, or normal java application?
- Does it use maven?
- What IDE do you use?
- Where's that XmlSerializer from?
- Is that a web project, or normal java application?
- Does it use maven?
- What IDE do you use?
#6
Posted 26 January 2012 - 11:54 PM
maven ? I dont no what dat is, its a web appl;
The habitat of the serializer "is import net.sf.json.xml.XMLSerializer";
I am using netbeans 7
Sorry for taking so long, n tnx.
The habitat of the serializer "is import net.sf.json.xml.XMLSerializer";
I am using netbeans 7
Sorry for taking so long, n tnx.
#7
Posted 27 January 2012 - 12:04 AM
Add the attached jar to your project.
(Right click project -> properties -> libraries -> Add jar / folder -> open -> ok)
(Right click project -> properties -> libraries -> Add jar / folder -> open -> ok)
Attached Files
#8
Posted 27 January 2012 - 01:25 AM
thank you i m gonna try it nw
---------- Post added at 09:25 AM ---------- Previous post was at 09:12 AM ----------
so i added it, but i how do i reference the xml
---------- Post added at 09:25 AM ---------- Previous post was at 09:12 AM ----------
so i added it, but i how do i reference the xml
#9
Posted 27 January 2012 - 01:28 AM
1) Do you want to do XML to JSon, or JSon to xml?
2) Do you have the XML in a file or a String?
3) Look at the method summary of XMLSerializer (Overview (json-lib jdk 5 API)) The api isn't that hard. It's very clear which method to pick for each case.
2) Do you have the XML in a file or a String?
3) Look at the method summary of XMLSerializer (Overview (json-lib jdk 5 API)) The api isn't that hard. It's very clear which method to pick for each case.
#10
Posted 27 January 2012 - 04:16 AM
I want from xml to json
#11
Posted 27 January 2012 - 04:17 AM
Then use one of these:
Quote
[TABLE="width: 100%"]
[TR="class: TableRowColor, bgcolor: white"]
[TD="width: 1%, align: right"] JSON[/TD]
[TD]readFromFile(File file)
Creates a JSON value from a File.[/TD]
[/TR]
[TR="class: TableRowColor, bgcolor: white"]
[TD="width: 1%, align: right"] JSON[/TD]
[TD]readFromFile(String path)
Creates a JSON value from a File.[/TD]
[/TR]
[TR="class: TableRowColor, bgcolor: white"]
[TD="width: 1%, align: right"] JSON[/TD]
[TD]readFromStream(InputStream stream)
Creates a JSON value from an input stream.[/TD]
[/TR]
[/TABLE]
[TR="class: TableRowColor, bgcolor: white"]
[TD="width: 1%, align: right"] JSON[/TD]
[TD]readFromFile(File file)
Creates a JSON value from a File.[/TD]
[/TR]
[TR="class: TableRowColor, bgcolor: white"]
[TD="width: 1%, align: right"] JSON[/TD]
[TD]readFromFile(String path)
Creates a JSON value from a File.[/TD]
[/TR]
[TR="class: TableRowColor, bgcolor: white"]
[TD="width: 1%, align: right"] JSON[/TD]
[TD]readFromStream(InputStream stream)
Creates a JSON value from an input stream.[/TD]
[/TR]
[/TABLE]
#12
Posted 27 January 2012 - 04:45 AM
I first tryd using a string, bt dat seems rather tricky. so i created a file nw i wana create the json from an xml doc;
---------- Post added at 12:45 PM ---------- Previous post was at 12:31 PM ----------
JSONObject json = JSONObject.fromObject("{\"name\":\"json\",\"bool\":true,\"int\":1}");
i dnt no wat dat is.---------- Post added at 12:45 PM ---------- Previous post was at 12:31 PM ----------
XMLSerializer xmlSerializer = new XMLSerializer(); JSONObject json = (JSONObject) xmlSerializer.read(xmlResult);The first line is the one that's got error, the thing is i dnt get hw duz dat line throw exception.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top










