Odd VerifyError (Matlab, Eclipse, xerces)

From: Zoe Stephenson (zrs1_at_uk.ac.york.reversed)
Date: 06/29/04

Date: 29 Jun 2004 14:41:26 GMT

  This one's been baffling me for a couple of days, I'm hoping there's
someone here who can point me in the right direction. I've been creating
some code using Eclipse that makes use of the xerces 1 XML system. I
have written a very simple application that parses an XML document and
then redisplays parts of it. This all works fine within Eclipse. However,
my application eventually needs to run within Matlab, so I tried it there
(I'm using Matlab's JRE within Eclipse to make sure there are as few
conflicts as possible). When run, I either get an unhelpful Matlab error
that the class can't be found, or if I indirect the call through another
class, I get a VerifyError. Here's a minimal example:


package uk.ac.york.cs.FAI.Example;

public class check {
  public check() {
  public void run() {
    empty e=new empty();


package uk.ac.york.cs.FAI.Example;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import org.apache.xerces.parsers.*;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

public class empty {
  public empty() {
  public void run(int dummy) {
    DOMParser parser=new DOMParser();
    try {
      Reader fileReader=new FileReader(filename);
      InputSource file=new InputSource(fileReader);
      try {
        parser.parse(file); // NOTE THIS LINE
      catch (Exception e) {
        System.out.println("Exception: " + e.toString());
    catch (FileNotFoundException e) {
      System.out.println("File not found");
  private static final String filename="/u2/zoe/work/Deliverables/2003/FMEATool/test.xml";


In Eclipse, this runs to completion, through a jPage containing:

check c=new check();

(Note that I'm indirecting through another class so that I see a
sensible error message if anything goes wrong in Matlab).

In Matlab, the following happens:

>> import uk.ac.york.cs.FAI.Example.*;
>> app=check
app =
>> app.run
??? Java exception occurred:
java.lang.VerifyError: (class: uk/ac/york/cs/FAI/Example/XMLcheck, method: run signature: (I)V) Incompatible object argument for function call
  at uk.ac.york.cs.FAI.Example.XMLmain.main(XMLmain.java:20)
  at uk.ac.york.cs.FAI.Example.check.run(check.java:21).


Interestingly, if the call to parser.parse(file) outlined above is replaced
with any other method call on that object, e.g. parser.reset(), then the
VerifyError doesn't occur, even though the VerifyError seems as though
it objects to something unrelated to that call.

This is all rather confusing - can anyone shed some light on where to go
from here to get this code to work?


jre 1.3.1
MATLAB Version (R13)
Eclipse Version: 2.1.2
xerces 1.4.4

 -- zoe