RepositoryRestMvcConfiguration can no longer be subclassed
See original GitHub issueDespite 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 d7f36b118060157e208aa044eb5c1c038b2c1dc2 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:20 (6 by maintainers)
Top Results From Across the Web
RepositoryRestMvcConfiguration (Spring Data REST 4.0.0 API)
Main application configuration for Spring Data REST. To customize how the exporter works, subclass this and override any of the configure* methods.
Read more >Extending RepositoryRestMvcConfiguration breaks Jackson ...
EDIT: I've solved the problem by annotating my LocalDateTime properties to specify what serialiser and deserialiser to use, but that feels more ......
Read more >Defining a subclass - IBM
Restriction: You cannot use multiple inheritance in your COBOL programs. Each COBOL class that you define must have exactly one immediate superclass that...
Read more >Java – @RepositoryRestController custom controller with ... - iTecNote
{RepositoryRestMvcConfiguration.class}; } @Override protected String[] ... Java's static typing system isn't really designed to support this unless the ...
Read more >Example usage for org.springframework.data.rest.webmvc ...
Introduction. In this page you can find the example usage for org.springframework.data.rest.webmvc.config RepositoryRestMvcConfiguration subclass-usage.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I managed to workaround this by using a
BeanPostProcessor
to replace the beans I wanted to override, instead of subclassingRepositoryRestMvcConfiguration
Yes it is. Confirmed using 2021.1.0-SNAPSHOT