spring-projects / spring-projects/spring-data-rest

Not able to access html files When using @Import(RepositoryRestMvcConfiguration.class) [DATAREST-100]

Open
#483 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

type: bug
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Sujeet Gupta opened DATAREST-100 and commented

Hi,
I am working on application Spring MVC & Data Rest.
When I am using @Import(RepositoryRestMvcConfiguration.class) on class which is extending WebMvcConfigurationSupport, then I am not able to access my html files, when removing this @Import(..), I am able to access the html files, but then the repository related things doesn't work.
This is blocking me from further development.

When I diagnosed then I found the following behavior.
When using @Import(RepositoryRestMvcConfiguration.class)
then "handleNoMatch" method of RequestMappingInfoHandlerMapping class is matching patterns which are not supposed to match.

So it matches and continues to the check "if (!consumableMediaTypes.isEmpty())" where it throws HttpMediaTypeNotSupportedException which results in 406 at the browser.

I have attached the thread_dump & values of some variables in the files.
PFA


Attachments:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.