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.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by loesak
, 9 months ago
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.
via manning.com by Unknown author, 1 year ago
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.
via Stack Overflow by shy dildo
, 1 year ago
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.
via GitHub by loesak
, 9 months ago
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.
via GitHub by chrylis
, 1 year ago
Cannot create mock for class com.artsquare.studio.domain.digitization.BookingPromo. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.
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(ProxyBasedMockFactory.java:52)
at org.spockframework.mock.runtime.JavaMockFactory.create(JavaMockFactory.java:51)
at org.spockframework.mock.runtime.CompositeMockFactory.create(CompositeMockFactory.java:44)
at org.spockframework.lang.SpecInternals.createMock(SpecInternals.java:45)
at org.spockframework.lang.SpecInternals.createMockImpl(SpecInternals.java:281)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Once, 2 months ago
Once, 2 weeks ago
2 times, 8 months ago
1 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.