0

I'm in the process of making a prototype banking application for one of my assignments. I've successfully created the persistence API, EJBs, and all required tables. However, when I create the WebClient for my application and integrate that with the Enterprise application and try to run it, I get the following error:

java.lang.IllegalArgumentException: Servlet [RegistrationPortImpl] and Servlet [RegistrationRequesterPortImpl] have the same url pattern

The WebClient only has the default index.xhtml file on it and I have not yet integrated to managed beans with it.

I just wanted to check if my application would run after the integration with enterprise application before I make any advances.

Toby Speight
  • 27,591
  • 48
  • 66
  • 103
Minon Weerasinghe
  • 312
  • 1
  • 3
  • 13
  • Have you added any url patterns to these servlets? – muasif80 Sep 04 '17 at 22:59
  • I haven't created any serverlets, its simply using JSF. After more research came across a blog that actually fixed this issue by adding the following line in the web.xml file. metadata-complete="true" However, I don't know why this solves the issue. – Minon Weerasinghe Sep 04 '17 at 23:09

2 Answers2

2

You can add the entry metadata-complete=true in the web-app tag like this:

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  version="3.0"
  metadata-complete="true">

This post suggests something similar. This entry disabled the scan for Servlet 3.0 specific annotations and web-fragments in /WEB-INF/lib. See here, here and here.

Maybe you could check the URL patterns in your web.xml and what libraries your app use.

JuanMoreno
  • 2,498
  • 1
  • 25
  • 34
0

In the @WebServlet put a unique url path for example @WebServlet("/port") @WebServlet("/requestport")

Annotate each of your servlet like this and then i believe this issue will not occur.

muasif80
  • 5,586
  • 4
  • 32
  • 45
  • I haven't created any servlets, its simply using JSF. After more research came across a blog that actually fixed this issue by adding the following line in the web.xml file. metadata-complete="true" However, I don't know why this solves the issue. – Minon Weerasinghe Sep 04 '17 at 23:10
  • Ok right. There might be two runtimes configured for the project and duplicate libraries are added. – muasif80 Sep 04 '17 at 23:11
  • This might have the correct understanding of it https://stackoverflow.com/a/9820775/578855 – muasif80 Sep 04 '17 at 23:13
  • Can you please elaborate on what you meant by two run times? I'm quite new to this type of programming. How would I check if have two runtimes configured? – Minon Weerasinghe Sep 04 '17 at 23:47