Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring more than one mapping results in a warning #25

Open
psimonazzi opened this issue Sep 12, 2016 · 2 comments
Open

Configuring more than one mapping results in a warning #25

psimonazzi opened this issue Sep 12, 2016 · 2 comments

Comments

@psimonazzi
Copy link

When you set more than one mapping in the "mappings" config section, Dropwizard complains with a warning log because we are using the same servlet name for all mappings:
Overriding the existing servlet registered with the name: assets

But then all mappings work correctly.

@nbauernfeind
Copy link
Member

Any chance you can provide a sample yaml or code-constructed configuration I can use to reproduce the behavior?

@psimonazzi
Copy link
Author

psimonazzi commented Sep 30, 2016

We are mapping files in a "assets" dir inside the classpath (in a jar) to the "/" url, and a "static" dir in the filesystem (at the same level of the jar) to the "/static" url.

A minimal config:

server:
  rootPath: /api/
  applicationConnectors:
    - type: http
      port: 8080
  adminConnectors:
    - type: http
      port: 8081

assets:
  mappings:
    /assets: /
    /static: /static
  overrides:
    /static: ./static

In code we just call bootstrap.addBundle(new ConfiguredAssetsBundle());

This config generates the warning, but then behaviour is correct: files inside the jar are available at the "/" url, and files inside the dir are available at "/static".

The logs we see are:

Registering ConfiguredAssetBundle with name: assets for path /*
Registering ConfiguredAssetBundle with name: assets for path /static/*
Overriding the existing servlet registered with the name: assets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants