XML error

I just submitted a bug that completely boggles me as it has to do with the XML libraries.

The module can be found here:
myweb.dal.ca/mkiefte/DBWv12b02-edit

(I didn’t make it).
It complains that it cannot find the class org/apache/xerces/impl/xs/psvi/PSVIProvider which is clearly not there. Was it there in an older library? This seems to suggest that there is some incompatibility between libraries, but I don’t know why it’s occurring now.

  • M.

Thus spake “mkiefte”:

When does that happen? I can’t replicate the problem.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “mkiefte”:

Also, the class org.apache.xerces.impl.xs.psvi.PSVIProvider is in
xercesImpl.jar, so it looks like you’re having a classpath problem.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Yes, that was the problem. Strange. xercesImpl.jar was in the path, but I had to resort the libraries to get it to be recognised. I knew about this before, but it still strikes me as quite odd.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

If you’re ever able to determine why this happens, let me know.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

xercesimpl.jar conflicts with xalan-2.6.0.jar, but I can’t figure out why. xercesimpl.jar must be before xalan in the path. There are some classes that are almost the same, but differ by one letter (e.g., org.apache.xml.serialize(r).Serializer.class) but none of them are exactly the same, so I still don’t quite get it. There can’t possibly be a length limit on directory names, can there?

  • M.

2009/1/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

It would be strange for there to be a conflict between the two, as they are
shipped together with Batik.

I don’t think that’s it, as we have some paths which are longer than that.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

2009/1/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

So why are some of the class names so similar? To someone who’s naive, they look redundant.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

What class names are similar?

The only place where the two hierarchies overlap is in org.apache.xml, and
there there aren’t even any classes at that node. I don’t think it’s a
namespace conflict. Anyway, Xalan is an XSLT implmementation and Xerces
is an XML parser. Xalan depends on Xerces, so far as I know.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

2009/1/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

I was referring to org.apache.xml.serialize(r).Serializer.class for example. The only differences is the “r” in the fourth path name. Wouldn’t they be kind of redundant?

the slight difference should be enough to distinguish them. I just don’t get why a) they’re so similar and b) why there’s a conflict anywhere anyway.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

If you look at the javadoc, you’ll see that each one has a method which
the other does not:

xerces.apache.org/xerces-j/apiDo … lizer.html
xml.apache.org/xalan-j/apidocs/o … lizer.html

That’s sufficient to make neither one redundant.

What makes you so sure that the problem is a conflict?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Why else would reordering them in the path make a difference?

  • M.

Post generated using Mail2Forum (mail2forum.com)

I’ve seen this kind of problem before on other projects. My best guess is this: There’s some class that’s defined in both the xalan and the xerces Jar files. The xalan file was built with a different (older, presumably) version of xerces. Some method in xalan’s version of this duplicated class references org/apache/xerces/impl/xs/psvi/PSVIProvider, a class that’s no longer in the xerces file. The xerces file’s version of the duplicated class doesn’t reference PSVIProvider. Moving xerces to the top of classpath ensures that the correct version of the mystery class is loaded.

rk

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

Why would a class fail to be found in case of a conflict? It looks to
me like you have a class which exists in only one place failing to be found.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Rodney Kinney:

I’ve checked that is not what’s happening, at least not with PSVIProvider.

org.apache.xerces.impl.xs.psvi.PSVIProvider is present in xercesImpl.jar, and
not present in any of our other jars.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

This is never a problem except when you try to set up a new
development environment with eclipse, which, by default (and not
unreasonably) sorts the libraries alphabetically. It’s not enough to
get worked up about but perhaps a note should be made about it in the
developers corner regarding how to set up eclipse.

Brent, are you taking care of that page? We may want to update this page anyway.

As for why it happens is completely beyond me. Rodney’s suggestion
sounds reasonable, but there doesn’t appear to be any evidence that
it’s true. There’s no reason why Java cannot find that class even if
you reorder the libraries.

  • M

On 29/01/2009, Joel Uckelman uckelman@nomic.net wrote:


Michael Kiefte, Ph.D.
Associate Professor
School of Human Communication Disorders
Dalhousie University
Halifax, Nova Scotia, Canada
tel: +1 902 494 5150
fax: +1 902 494 5151


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Michael Kiefte:

There must be some reason why it happens. Are you certain that moving
xercesImpl.jar ahead of the xalan JAR is what makes it work?

J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Apparently so. Perhaps Brent who’s also using eclipse can confirm this.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Yes, that’s right. I can’t run Vassal unless XercesImpl is above (before) Xalan in the order of libraries.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

Unzip xalan-2.6.0.jar, remove META-INF/INDEX.LIST, and zip it up again.
Do the same for xercesImp.jar. Can you use them in any order now?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)