0
votes

I've recently upgraded from Java 6 to Java 7, and changed the Grails version accordingly to 2.3.8. Everything compiles and runs fine from the command line.

But I'm finding my version of GGTS (3.5.1.RELEASE) won't run unit tests from within the editor. I get the error: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

I've tried completely importing the project from scratch - no joy.

The problem applies only to Grails-specific tests in GGTS, not when I run them from the command line. It happens during the Grails initialisation registerBeans() call. Which is pulled in by the @TestFor annotation (no annotation, no problem).

Looking at other error reports with the same error, I see this seems to be something to do with versions of xml-apis. I've tried putting compile('xml-apis:xml-apis:2.0.2') in the grails.project.dependency.resolution ... dependencies section of BuildConfig.groovy, but it has no effect.

Any suggestions what I might do instead?

  • Charles
1
You should exclude xml-apis completely, it hasn't been necessary since Java 5 and tends to cause more problems than it solves. - Ian Roberts
I can believe that. But the project has no references to it at all. So I'm still stuck. - CharlesW

1 Answers

0
votes

My Grails guru suggested simply moving to IntelliJ - a good, if slightly costly, approach.

But to my frustration I found a different, but similar, error in that environment too. I realised that IntelliJ imports the Eclipse editor settings for the project.

So the solution turned out to be to delete all the editor-specific files for the project, and regenerate it from the Groovy/Grails sources alone.

  • Charles