Problems with JDOM

A

Andrew

I am having some problems with JDOM in Builder 9 version. I ve
actually used all the latest JDOM libraries but it seems that the
RunTime environment keeps giving me JDOMExceptions whetever I do.

When I am using a SAXBuilder from the org.jdom.input.SAXBuilder like:
SAXBuilder builder = new SAXBuilder();
builder.build(new File("file.xml"));

and then try to make another builder in the same program :

SAXBuilder builder2 = new SAXBuilder();
builder.build(new File("file2.xml"));

I get a JDOMException error. What I basically want to do is to parse
more than one xml files in memory in the same application. Why is
there a problem ???


Any help would be very much appreciated

Andrew


P.S: I also get an exception when compiling using the "standard" sun
compilers.
 
S

Sudsy

Andrew said:
I am having some problems with JDOM in Builder 9 version. I ve
actually used all the latest JDOM libraries but it seems that the
RunTime environment keeps giving me JDOMExceptions whetever I do.

When I am using a SAXBuilder from the org.jdom.input.SAXBuilder like:
SAXBuilder builder = new SAXBuilder();
builder.build(new File("file.xml"));

and then try to make another builder in the same program :

SAXBuilder builder2 = new SAXBuilder();
builder.build(new File("file2.xml"));

Shouldn't this be builder2.build?
 
C

Christophe Vanfleteren

Andrew said:
I am having some problems with JDOM in Builder 9 version. I ve
actually used all the latest JDOM libraries but it seems that the
RunTime environment keeps giving me JDOMExceptions whetever I do.

When I am using a SAXBuilder from the org.jdom.input.SAXBuilder like:
SAXBuilder builder = new SAXBuilder();
builder.build(new File("file.xml"));

and then try to make another builder in the same program :

SAXBuilder builder2 = new SAXBuilder();
builder.build(new File("file2.xml"));
^^^^^^^

Could this be your problem? You are reusing the first builder. Or is it just
a copy/paste error?

And in the future, you might want to show the exact error you're getting.
Most of the time, that will make things clearer for us.
 
K

Keith A. Lewis

I am having some problems with JDOM in Builder 9 version. I ve
actually used all the latest JDOM libraries but it seems that the
RunTime environment keeps giving me JDOMExceptions whetever I do.

When I am using a SAXBuilder from the org.jdom.input.SAXBuilder like:
SAXBuilder builder = new SAXBuilder();
builder.build(new File("file.xml"));

and then try to make another builder in the same program :

SAXBuilder builder2 = new SAXBuilder();
builder.build(new File("file2.xml"));

I get a JDOMException error. What I basically want to do is to parse
more than one xml files in memory in the same application. Why is
there a problem ???

I don't have that problem. And my app re-uses the same SAXBuilder object
hundreds of times (sequentially, not concurrently). The only other
difference is that I pass in StringReader objects instead of File, but that
shouldn't matter.
P.S: I also get an exception when compiling using the "standard" sun
compilers.

That's a second problem I don't have.

It might be easier to help you if you post the entire text of the exceptions
(both compiler and runtime).

--Keith Lewis klewis {at} mitre.org
The above may not (yet) represent the opinions of my employer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top