Skip to content

RepositoryRestMvcConfiguration can no longer be subclassed #1981

Closed
@alienisty

Description

@alienisty

Despite the class documentation states that "To customize how the exporter works, subclass this and override...", that that is no longer possible.
The restHandlerMapping() method returns a DelegatingHandlerMapping which has been made package private in commit d7f36b1 related to DATAREST-1540.
When subclassing RepositoryRestMvcConfiguration for customisation, I now get the following exception:

Caused by: java.lang.IllegalAccessError: failed to access class org.springframework.data.rest.webmvc.config.DelegatingHandlerMapping from class au.com.onyxtech.horus.config.RepositoryRestConfig$ExtendedRepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$186fd9d8 (org.springframework.data.rest.webmvc.config.DelegatingHandlerMapping and au.com.onyxtech.horus.config.RepositoryRestConfig$ExtendedRepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$186fd9d8 are in unnamed module of loader 'app')
	at au.com.onyxtech.horus.config.RepositoryRestConfig$ExtendedRepositoryRestMvcConfiguration$$EnhancerBySpringCGLIB$$186fd9d8.restHandlerMapping(<generated>)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 89 common frames omitted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions