Results 1 to 3 of 3
  1. #1
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default HtmlUnit Class Problem

    first of all sorry for bad english
    i put the following code in button
    final WebClient webClient = new WebClient();
    but when i press the button i got the following error
    I'm using linux lubuntu
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :760)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 367)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 24)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 57)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :760)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 367)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 24)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 57)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java :760)
    at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader. java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 367)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 24)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 57)
    at vist4earn.Login.jButton1ActionPerformed(Login.java :89)
    at vist4earn.Login.access$000(Login.java:21)
    at vist4earn.Login$1.actionPerformed(Login.java:45)
    at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2346)
    at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.jav a:6527)
    at javax.swing.JComponent.processMouseEvent(JComponen t.java:3321)
    at java.awt.Component.processEvent(Component.java:629 2)
    at java.awt.Container.processEvent(Container.java:223 4)
    at java.awt.Component.dispatchEventImpl(Component.jav a:4883)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2292)
    at java.awt.Component.dispatchEvent(Component.java:47 05)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4898)
    at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4533)
    at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4462)
    at java.awt.Container.dispatchEventImpl(Container.jav a:2278)
    at java.awt.Window.dispatchEventImpl(Window.java:2739 )
    at java.awt.Component.dispatchEvent(Component.java:47 05)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:746)
    at java.awt.EventQueue.access$400(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.awt.EventQueue$3.run(EventQueue.java:691)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:75)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:719)
    at java.awt.EventQueue$4.run(EventQueue.java:717)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 716)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:82)
    Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 24)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 57)
    ... 75 more
    i'm stuck here for 2 days Don't know where is the problem . i set the permmissins for the lib file of html unit but nothing is working

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: HtmlUnit Class Problem

    Presumably WebClient uses ElementTraversal somewhere, and you either have the wrong version on your classpath or you don't have it at all.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Sarmad.as is offline Member
    Join Date
    Nov 2013
    Posts
    27
    Rep Power
    0

    Default Re: HtmlUnit Class Problem

    Quote Originally Posted by Tolls View Post
    Presumably WebClient uses ElementTraversal somewhere, and you either have the wrong version on your classpath or you don't have it at all.
    Thanks i was not using the dependency libs :)

Similar Threads

  1. HtmlUnit returns the same page
    By MohseN16 in forum Networking
    Replies: 1
    Last Post: 08-07-2014, 12:04 PM
  2. Very basic HTMLUnit question
    By doughboy in forum New To Java
    Replies: 0
    Last Post: 05-26-2013, 10:33 PM
  3. using of htmlunit library
    By ahmad_javadi in forum Advanced Java
    Replies: 2
    Last Post: 07-26-2010, 11:43 AM
  4. using of htmlunit library
    By ahmad_javadi in forum New To Java
    Replies: 0
    Last Post: 07-26-2010, 11:32 AM
  5. use of pressAccessKey in htmlunit
    By ahmad_javadi in forum New To Java
    Replies: 1
    Last Post: 07-21-2010, 01:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •