Can not load file into XML Parser ? ?

Status
Not open for further replies.

Christine Setiawaty

Usenet Archive
Joined
Aug 11, 2002
Messages
10
Reaction score
0
I get problem while load xml file into parser? The message that appear is as follows

Exception in thread "main" java.lang.VerifyError: (class: BasicDOM, method:
<init> signature: (Ljava/lang/String;)V) Incompatible object argument for function call

This is the main class:

public static void main (String args) {
BasicDOM basicDOM = new BasicDOM ("weather.xml"); }

weather.xml file is in the same directory as java parser file

Anyone, could you help me to solve this problem?
 

Christine Setiawaty

Usenet Archive
Joined
Aug 11, 2002
Messages
10
Reaction score
0
I just find the solution for this problem.
This is because jdk1.2 and jdk1.3 conflict in my classpath

Thanks

"Christine Setiawaty" wrote:

I get problem while load xml file into parser? The message that appear is
as
follows

Exception in thread "main" java.lang.VerifyError: (class: BasicDOM,
method:
<init> signature: (Ljava/lang/String;)V) Incompatible object argument for function call

This is the main class:

public static void main (String args) {
BasicDOM basicDOM = new BasicDOM ("weather.xml"); }

weather.xml file is in the same directory as java parser file

Anyone, could you help me to solve this problem?
 

David Herron

Usenet Archive
Joined
Aug 13, 2002
Messages
1
Reaction score
0
Christine Setiawaty wrote:

I get problem while load xml file into parser? The message that appear is as follows

Exception in thread "main" java.lang.VerifyError: (class: BasicDOM, method:
<init> signature: (Ljava/lang/String;)V) Incompatible object argument for function call

This is the main class:

public static void main (String args) {
BasicDOM basicDOM = new BasicDOM ("weather.xml");
}
...

Well, the javadoc for VerifyError says:

Thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.

So it's likely you have a problem with a bad compile or something.

You can use JAXP (see http://java.sun.com/xml/javaxmlpack.html) and it includes a nice packaging of all the base XML support you could want. You would use JAXP if you haven't upgraded to 1.4(.x) yet (on my Mac OS X system at home, I'm using JAXP)

You can load stuff into a DOM, using JAXP, by:

import javax.xml.parsers.*;
import org.w3c.dom.*;
...

DocumentBuilder db =
DocumentBuilderFactory.newInstance.newDocumentBuilder;
Document doc = db.parse(new File("weather.xml"));

- David Herron
 
Status
Not open for further replies.

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
548,049
Messages
3,104,245
Members
248,133
Latest member
DujonT

Latest Threads

Top