org.spockframework.mock.CannotCreateMockException: Cannot create mock for class Collaborator. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.

GitHub | loesak | 3 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    existance check of cglib versions greater than 2.2.2 fails

    GitHub | 3 months ago | loesak
    org.spockframework.mock.CannotCreateMockException: Cannot create mock for class Collaborator. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.
  2. 0

    Chapter 7: testcase on page 160 doesn't work on GGTS3.6.0/Grails2.4.2

    manning.com | 11 months ago
    org.spockframework.mock.CannotCreateMockException: Cannot create mock for class com.grailsinaction.PostService. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.
  3. 0

    GitHub comment 686#273611515

    GitHub | 3 months ago | loesak
    org.spockframework.mock.CannotCreateMockException: Cannot create mock for class Collaborator. Mocking of non-interface types requires a code generation library. Please put byte-buddy-1.4.0 or cglib-nodep-3.2 or higher on the class path.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Cannot create mock for class LoginService. Mocking of non-interface types requires the CGLIB library..?

    Stack Overflow | 3 years ago | shy dildo
    org.spockframework.mock.CannotCreateMockException: Cannot create mock for class com.zee.LoginService. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.
  6. 0

    classcast exception with grails 2.2.3 and spock 0.7

    Stack Overflow | 4 years ago | Vineel Nalla
    java.lang.ClassCastException: com.grails.User cannot be cast to net.sf.cglib.proxy.Factory

  1. johnxfly 2 times, last 1 month ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.spockframework.mock.CannotCreateMockException

    Cannot create mock for class Collaborator. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.

    at org.spockframework.mock.runtime.ProxyBasedMockFactory.create()
  2. Spock Framework - Core Module
    SpecInternals.MockImpl
    1. org.spockframework.mock.runtime.ProxyBasedMockFactory.create(ProxyBasedMockFactory.java:52)
    2. org.spockframework.mock.runtime.JavaMockFactory.create(JavaMockFactory.java:51)
    3. org.spockframework.mock.runtime.CompositeMockFactory.create(CompositeMockFactory.java:44)
    4. org.spockframework.lang.SpecInternals.createMock(SpecInternals.java:45)
    5. org.spockframework.lang.SpecInternals.createMockImpl(SpecInternals.java:281)
    6. org.spockframework.lang.SpecInternals.MockImpl(SpecInternals.java:83)
    6 frames