logger
logger

Reputation: 2053

multiple url mapping for same servlet URL produce error

I am trying to map multiple url pattern to same servlet and I have been writing like this.

<servlet-mapping>
     <servlet-name>MyWebService</servlet-name>
     <url-pattern>/MyWebService</url-pattern>
     <url-pattern>/ReadWebService</url-pattern>
</servlet-mapping>

from my local tomcat I was able to run without issues and I can even make calls on my local host and get the result from both urls. However, when I tried to deploy this into websphere I got the following exception

The following exception occured. Check log for details.
com.ibm.websphere.management.application.client.AppDeploymentException:
[Root exception is 
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException:
    WEB-INF/web.xml]

I have searched this exception and did not get any useful information on what it is. Can anyone suggest why this is happening? Is my mapping wrong?

Upvotes: 1

Views: 1375

Answers (1)

wtlucy
wtlucy

Reputation: 724

You likely need to define a newer servlet version in your web.xml: only versions 2.5 and newer support multiple url-pattern in the same servlet-mapping.

See https://stackoverflow.com/a/23057920/3864977

Upvotes: 4

Related Questions