Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

saxon9-dom.jar not found only when running junit

 
Juanin Lopez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,we're trying to run a junit test case for a method which is using saxon9-dom.jar.In eclipse,we just right click on the test class/run as junit (no ant script),and it throws the error "DOMSource cannot be processed: check that saxon9-dom.jar is on the classpath
The method is working when called from the main class on a normal run.The saxon9-dom.jar was/is in the project classpath(checked both,in eclipse and opening the .classpath file) .It has been added again separately under 'libraries'.It's on the 'run configurations/classpath' too.It was even put within the classpath for the 'environment variables' of the PC...nothing works,always the same result/error.

Any help would be really appreciated
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Juanin,
Welcome to CodeRanch! I've linked to the StackOverflow crosspost so people posting here can see if it has already been answered. (We ask for this so people don't waste time answering a question that's already been answered.)

On to your question. You are using the built in JUnit, right? The following shouldn't happen, but it would explain the behavior you are seeing:

Do you have the JUNIT_HOME variable set by any chance? Either within Eclipse or on the command line. If so, does the lib folder contain a competing jar?
 
Juanin Lopez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

thanks for the reply and the link.Actually I posted that one on stackOverFlow forum,but I wasn't getting any answers so I posted here too.
JUNIT_HOME variable is not set on environment variables.I haven't got a different installation for junit,just using the in built one in the plugins.
Junit4 has been added to the classpath of the project,and all the other junit tests on other classes/methods are working fine.The jar we have
is the "saxon-9.1.0.8.jar"...I can only think of getting exactly the saxon9-dom.jar,just in caseJunit4 only recognizes that one and not the one we've got...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes sense.

And crossposting is fine. Especially for hard questions like this! We just like to have the link.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic