I am trying to get httpunit testing to work. I am running NekoHTML 1.9.14. I get an error
I have looked int xercesImpl and there is definitely a class "org.apache.xerces.parsers.DOMParser". This is the version 2+ of xercesImpl that was stated to be needed for nekohtml. The method message isn't clear to me. What else is missing? Why should this be so hard? If someone is trying to do httpunit testing, why not give a list or a bundle of the necessary jars?
The HttpUnit distribution includes the jars it requires--getting this list is as simple as looking at the directory. Its dependencies are also listed in its pom, or via sites like mvnrepository.com. When you start mixing-and-matching versions, you're pretty much on your own, and you'll run into errors like you've posted fairly often: you go outside the bounds of what's required, it's your responsibility to manage it.
Joined: Aug 29, 2008
Was using files from distribution. Finally found problem was that I needed to put xerxes jar BEFORE neko jar. Got that by trial and error.
One difficulty is that jar versions aren't identified sometimes. People say use same versions, but what does that mean if they aren't labeled? Found neko version using version Version.getVersion method. Not all have such.
David Newton wrote:May be in Manifest file, other times you just have to be aware what you're using, and either rename locally, or wing it. Issues like this are one reason Maven and Ant+Ivy exist.
I'm a little confused by the solution OP found here: unless HttpUnit came with an unusable version of xerces in it's own jar or something, changing the order of the classpath doesn't seem like it should fix this?
On a whim, I tried changing the order in .classpath (also using myeclipse like OP). No cigar. I tried using xercesImpl.jar that came bundled with the hapi download and also tried the latest from Apache. Yeah, I'm grasping at straws here. :)
'Any other thoughts as to why it's not finding this?
Well, for completeness', here's my exciting and wonderful .classpath:
What jdk versions are you using? Older jdks included xerces and xalan version and a lot of conflicts were experienced. Packages were renamed starting in 1.5 (com.sun.org.apache.xerces) to remove any possibility of conflicts.
Mathieu Fortin wrote:What jdk versions are you using? Older jdks included xerces and xalan version and a lot of conflicts were experienced. Packages were renamed starting in 1.5 (com.sun.org.apache.xerces) to remove any possibility of conflicts.
Thanks - my JDK is 1.6 building 1.5 compatible files to run on Weblogic 9.1 on a 1.5 JRE.
Joined: Jun 07, 2003
Update: I did get Weblogic (we're still on 9.1, BTW) to override the classpath loading order by putting this in weblogic.xml:
This, of course, caused other incompatibility issues with the app and WLS. I'm going to try it on a more current version of WLS.