15

I am using eclipse juno.. when i opening javascript file in eclipse it returns the error

java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)

how can i overcome this..

Aravindhan
  • 3,566
  • 7
  • 26
  • 42
  • do you have web tools platform installed? – acostache Dec 12 '12 at 13:40
  • ya when i opening first time it returns that error ....after the continuous opening opens the file in black letters(that means there is no difference coloring and all elements in black color) – Aravindhan Dec 12 '12 at 13:43
  • have you tried with a clean install of Eclipse? – acostache Dec 12 '12 at 13:52
  • are you sure you have javascript developer tools (for sure) in and/or are not missing any library? – acostache Dec 12 '12 at 14:08
  • here is a related question on the eclipse forum, maybe it will help:http://www.eclipse.org/forums/index.php/m/889148/ – acostache Dec 12 '12 at 14:12
  • Possible duplicate of [AppEngine Error \[ java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal \]](http://stackoverflow.com/questions/10234201/appengine-error-java-lang-noclassdeffounderror-org-w3c-dom-elementtraversal) – tremendows Mar 02 '16 at 11:40
  • See https://stackoverflow.com/q/51094274/421049. This seem similar to [Eclipse Bug 536928](https://bugs.eclipse.org/bugs/show_bug.cgi?id=536928). I encourage you to go vote for it so that maybe they will raise its priority and address it. – Garret Wilson Dec 11 '18 at 17:58
  • @GarretWilson the other thread is specific to Java 9+, while this thread from 2012 must have some other background. – Stephan Herrmann Dec 18 '18 at 00:09

2 Answers2

54

I had an issue when I tried using version 2.0.2, but found that when I reverted back to version 1.4.01 and everything worked again.

If you're using Maven:

<dependency> 
    <groupId>xml-apis</groupId>
    <artifactId>xml-apis</artifactId>
    <version>1.4.01</version>
</dependency>
Kenny Cason
  • 12,109
  • 11
  • 47
  • 72
  • i agree. but does anyone know what the problem is going forward? – MeBigFatGuy Mar 22 '14 at 16:19
  • 10
    1.4.01 is the _newest_ version for this lib. As it can be noticed [here](http://mvnrepository.com/artifact/xml-apis/xml-apis/2.0.2), 2.0.2 is **prior** to 1.0.b2 – Timoteo Brasil Dec 19 '14 at 20:01
  • 2
    I am coming across this error, i am using selenium webdriver with junit and maven. I have added the dependency but the problem persists. Any suggestions? – Kanishka Choudhury Nov 09 '15 at 07:40
2

You need xml-apis. Have a look at this:http://www.coderanch.com/t/534171/XML/org-dom-ElementTraversal

Biao
  • 129
  • 2
  • 9