Skip to main content



      Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Mitigate duplicate URL mapping
Mitigate duplicate URL mapping [message #1848549] Tue, 07 December 2021 09:42 Go to next message
Eclipse UserFriend
I've an error in eclipse stating that a duplicate URL mapping was found for a project.
This is caused by a jar dependency which has mapped a servlet using @WebServlet annotation. The project that imports this jar needs to overwrite the servlet mapping with a custom class but it needs the same url mapping. To achieve this the project configures the servlet mapping in web.xml.

I figure this works because xml configuration takes precedence over the annotations, but would it be possible to mitigate this error without disabling web.xml validation entirely?

Or is this a valid error which could cause issues on certain application servers?
I'm using jboss and wildfly where I've not had any runtime issues.
Re: Mitigate duplicate URL mapping [message #1848580 is a reply to message #1848549] Wed, 08 December 2021 10:43 Go to previous messageGo to next message
Eclipse UserFriend
That's odd. The Servlet 4.0 spec in section 12.2 states "If the effective web.xml (after merging information from fragments and
annotations) contains any url-patterns that are mapped to multiple servlets then the deployment must fail." Does it work in Tomcat?
Re: Mitigate duplicate URL mapping [message #1848631 is a reply to message #1848580] Fri, 10 December 2021 05:19 Go to previous messageGo to next message
Eclipse UserFriend
I did some testing and this also works on tomcat 9.
I also noticed that this error in eclipse doesn't occur for maven projects but only for ant and ivy projects.

The eclipse version I'm using is still 2019-12 (4.14.0) so I'm going to test this on the latest version to verify that this is a bug.
Re: Mitigate duplicate URL mapping [message #1848688 is a reply to message #1848631] Mon, 13 December 2021 23:27 Go to previous messageGo to next message
Eclipse UserFriend
Please be sure to include the dynamic web facet version if you do report it as a bug. I haven't dug into the details,
but it could matter.
Re: Mitigate duplicate URL mapping [message #1854210 is a reply to message #1848688] Sun, 07 August 2022 00:00 Go to previous message
Eclipse UserFriend
What is the possible solution for this duplication issue. I am also facing similar kind of issues right know.

Make money online and networth check this site

[Updated on: Mon, 08 August 2022 01:06] by Moderator

Previous Topic:How to configure Eclipse for tag auto- completion?
Next Topic:esversion 8 errors not understood
Goto Forum:
  


Current Time: Fri Jul 11 09:49:50 EDT 2025

Powered by FUDForum. Page generated in 0.09390 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top