WebSphere -> GlassFish: Invalid URL Pattern

This entry is based on Migrating WebSphere BasicCalculator example

In WebSphere 6.1, the following URL pattern in WEB-INF/web.xml

<web-app id="WebApp_1">
      ..
      <servlet-mapping id="ServletMapping_1">
         <servlet-name>BasicCalcServlet</servlet-name>
         <url-pattern>BasicCalculatorServlet</url-pattern>
      </servlet-mapping>
   </web-app>

will fail verification. GlassFish verifier will fail with an invalid URL pattern.

$ verifier was-BasicCalculator.ear
	---------------------------
	STATIC VERIFICATION RESULTS
	---------------------------

	-----------------------------------------------------
	ERRORS THAT OCCURRED WHILE RUNNING STATIC VERIFICATION
	----------------------------------------------------- 

        ----------------------------------
	NUMBER OF FAILURES/WARNINGS/ERRORS
 	----------------------------------
	# of Failures : 0
        # of Warnings : 0
	# of Errors : 1

	Error Name : Could not verify successfully.
	Error Description : java.lang.IllegalArgumentException: Invalid URL Pattern: [BasicCalculatorServlet]

To migrate to GlassFish, change the URL pattern :

<web-app>
      ..
      <servlet-mapping>
         <servlet-name>BasicCalcServlet</servlet-name>
         <url-pattern>/BasicCalculatorServlet</url-pattern>
      </servlet-mapping>
   </web-app>

Either change the URL pattern manually or use the GlassFish Migration Tool generated web.xml, which contains the URL pattern shown above.