Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Steps to replicate
- Create a new Wicket Quickstart application (8.x.x as GlassFish JDK8 only...)
- Try to deploy to GlassFish instance via the Admin console
- GlassFish will fail to deploy the application with the following error:
Error occurred during deployment: Exception while deploying the app [myproject-1.0-SNAPSHOT] : org.xml.sax.SAXParseExceptionpublicId: file:/C:/apps/glassfish51/glassfish/lib/schemas/web-app_3_1.xsd; lineNumber: 26; columnNumber: 27; Deployment descriptor file WEB-INF/web.xml in archive [myproject-1.0-SNAPSHOT]. TargetNamespace.1: Expecting namespace 'http://java.sun.com/xml/ns/javaee', but the target namespace of the schema document is 'http://xmlns.jcp.org/xml/ns/javaee'.. Please see server.log for more details.
Root Cause
The namespace in the web.xml generated by Quickstart is:
http://java.sun.com/xml/ns/javaee
As per https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html
All new schemas are in the http://xmlns.jcp.org/xml/ns/javaee/ namespace. Most older schemas remain in the http://java.sun.com/xml/ns/javaee/ namespace.
The web_app_3_1.xsd referenced in the QuickStart web.xml uses the newer http://xmlns.jcp.org/xml/ns/javaee/ namespace, so when GlassFish validates the XML, the validation fails.
Proposed solution
Update the quickstart web.xml to the following:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">