java.lang.LinkageError: loader constraint violation in interface itable initialization:

18 views
Skip to first unread message

Mark Warner

unread,
Nov 20, 2015, 5:41:14 AM11/20/15
to JUnit Helper Group

I am getting this error when I try to mock JTextField.

java.lang.LinkageError: loader constraint violation in interface itable
    initialization: when resolving method
    "javax.swing.text.JTextComponent$1.dropLocationForPoint(
    Ljavax/swing/text/JTextComponent;Ljava/awt/Point;)Ljavax/
    swing/TransferHandler$DropLocation;" the class loader (instance of
    org/powermock/core/classloader/MockClassLoader) of the current
    class, javax/swing/text/JTextComponent$1, and the class loader
    (instance of <bootloader>) for interface
    sun/swing/SwingAccessor$JTextComponentAccessor have different Class
    objects for the type mponent$1.dropLocationForPoint(Ljavax/swing/text/
    JTextComponent;Ljava/awt/Point;)Ljavax/swing/TransferHandler$
    DropLocation; used in the signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at javassist.runtime.Desc.getClassObject(Desc.java:43)

I tried to use this:

@PowerMockIgnore( {"javax.management.*","javax.security.*","javax.ws.*"}) 
Reply all
Reply to author
Forward
0 new messages