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.*"})