java.lang.LinkageError

loader constraint violation: when resolving method "B.m()LFoo;" the class loader (instance of PreemptingClassLoader) of the current class, Task, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, B, have different Class objects for the type Foo used in the signature

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web2028

  • via JDK Bug System by Dan Smith, 11 months ago
    loader constraint violation: when resolving method "B.m()LFoo;" the class loader (instance of PreemptingClassLoader) of the current class, Task, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, B, have different Class objects for the type Foo used in the signature
  • /LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
  • /nio/NioClientBoss$1, and the class loader (instance of <bootloader>) for the method's defining class, java/nio/channels/Selector, have different Class objects for the type java/nio/channels/Selector used in the signature
  • Stack trace

    • java.lang.LinkageError: loader constraint violation: when resolving method "B.m()LFoo;" the class loader (instance of PreemptingClassLoader) of the current class, Task, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, B, have different Class objects for the type Foo used in the signature at Task.run(Task.java:5) at Test.main(Test.java:8)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.