0

I have a very strange behaviour of Spring Boot application (1.4.0.RELEASE)

My static content lies under /src/main/resources/static/* and one of the pages needs css and js files, but despite the fact that css files are served without problems I am getting 404 for js files:

For CSS file I see in the logs

SimpleUrlHandlerMapping  : No handler mapping found for [/admin_files/custom_admin.css]
RequestMappingHandlerMapping : Looking up handler method for path /admin_files/custom_admin.css
RequestMappingHandlerMapping : Did not find handler method for [/admin_files/custom_admin.css]
SimpleUrlHandlerMapping: Matching patterns for request [/admin_files/custom_admin.css] are [/**]
SimpleUrlHandlerMapping  : Mapping [/admin_files/custom_admin.css] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], (...)

so it looks completely fine. However for JS file it looks different:

SimpleUrlHandlerMapping  : No handler mapping found for [/admin_files/vendor/jquery/dist/jquery.min.js]
RequestMappingHandlerMapping : Did not find handler method for [/admin_files/vendor/jquery/dist/jquery.min.js]
SimpleUrlHandlerMapping  : Matching patterns for request [/admin_files/vendor/jquery/dist/jquery.min.js] are [/**]
SimpleUrlHandlerMapping  : Mapping [/admin_files/vendor/jquery/dist/jquery.min.js] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/] (...)
//
// and now something strange starts to happen BELOW
//
HttpEntityMethodProcessor  : Written [{timestamp=Tue Sep 13 23:17:12 CEST 2016, status=404, error=Not Found, message=No message available, path=/admin_files/vendor/jquery/dist/jquery.min.js}] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@29139aae]

I am really stuck as it looks like a very small glitch or something very tiny that I am missing somewhere.

My application looks like this:

@SpringBootApplication
@EnableAsync
@EnableTransactionManagement(proxyTargetClass = true)
@EnableEncryptableProperties
public class Application extends WicketBootSecuredWebApplication { }

without any custom configuration beans, etc.

tree executed in /src/main/resources:

.
├── application-dev.yml
├── application-prod.yml
├── application-staging.yml
├── application.yml
├── banner.txt
└── static
    └── admin_files
        ├── custom_admin.css
        └── vendor
            ├── jquery
            │   ├── jquery.js
            │   └── jquery.min.js
            └── metisMenu
                ├── metisMenu.css
                ├── metisMenu.js
                ├── metisMenu.min.css
                └── metisMenu.min.js

Any help appreciated!

4
  • Did you configure mvc options or left it to autoconfiguration? Commented Sep 13, 2016 at 21:35
  • @nurgasemetey No mvc related configuration in my yaml files. Commented Sep 13, 2016 at 21:43
  • Please add the porject/resource tree Commented Sep 13, 2016 at 21:43
  • @reos Done, tree output added. But something would be messed with placing static files in a proper directory, both css and js files wouldn't be served properly. Commented Sep 13, 2016 at 21:53

1 Answer 1

1

Notice that you're asking for /admin_files/vendor/jquery/dist/jquery.min.js but in your resource tree the dist directory does not exist.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.