Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Mitigate duplicate URL mapping
Mitigate duplicate URL mapping [message #1848549] Tue, 07 December 2021 14:42 Go to next message
ilan stuer is currently offline ilan stuerFriend
Messages: 2
Registered: August 2021
Junior Member
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 15:43 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4438
Registered: July 2009
Senior Member

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?


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Mitigate duplicate URL mapping [message #1848631 is a reply to message #1848580] Fri, 10 December 2021 10:19 Go to previous messageGo to next message
ilan stuer is currently offline ilan stuerFriend
Messages: 2
Registered: August 2021
Junior Member
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] Tue, 14 December 2021 04:27 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4438
Registered: July 2009
Senior Member

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.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Mitigate duplicate URL mapping [message #1854210 is a reply to message #1848688] Sun, 07 August 2022 04:00 Go to previous message
BEND KAI is currently offline BEND KAIFriend
Messages: 1
Registered: August 2022
Junior Member
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


growthtakeover.com

[Updated on: Mon, 08 August 2022 05:06]

Report message to a moderator

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


Current Time: Mon May 06 03:26:15 GMT 2024

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

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

Back to the top