Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8EC1218080 for ; Sat, 20 Jun 2015 15:53:00 +0000 (UTC) Received: (qmail 96037 invoked by uid 500); 20 Jun 2015 15:53:00 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 96007 invoked by uid 500); 20 Jun 2015 15:53:00 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 95994 invoked by uid 99); 20 Jun 2015 15:53:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2015 15:53:00 +0000 Date: Sat, 20 Jun 2015 15:53:00 +0000 (UTC) From: "Rebecca Searls (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-6469) schemaLocation in xsd import is not rewritten correctly in Java 8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14594656#comment-14594656 ] Rebecca Searls commented on CXF-6469: ------------------------------------- The fundamental cause of the difference between running the app with JDK 1.7 and 1.8 is the order of entries returned from HashMap and apache CXF's unintended assumption about that order. Method WSDLGetUtils.updateSchemaImports performs a depth-first processing of schema imports (i.e. schemaLocation=) in referenced WSDL and XSD files. The relative path to each schemaLocation is re-calculated relative to the root WSDL in method WSDLGetUtils.findSchemaLocation (line 459 in WSDLGetUtils.updateSchemaImports). A reference to the re-calculated schemaLocation path and its corresponding DOM element is save in a Map for reference by future passes and document display. When using JDK 1.7 the order of root WSDLs processed is -0 imported/OSSJ-OrderManagement-v1-0.wsdl -1./SmpOrderManagementBase-v1-0.wsdl -2 imported/bw-2.wsdl All schemaLocation paths found in the OSSJ-OrderManagement-v1-0 tree are compared to, vfs:/content/SmpOrderMgrWebServices.war/WEB-INF/wsdl/imported {/OSSJ-OrderManagement-v1-0.wsdl} In this file all of the schemaLocation declarations are of the form "./.xsd". This results in reference Map (variable doneSchemas) entries of OSSJ-Common-CBEBi-v1-5.xsd OSSJ-Common-CBEDatatypes-v1-5.xsd OSSJ-Common-CBECore-v1-5.xsd OSSJ-Common-CBELocation-v1-5.xsd OSSJ-Common-CBEService-v1-5.xsd OSSJ-Common-CBEParty-v1-5.xsd OSSJ-Common-v1-5.xsd OSSJ-Common-CBEProductOffering-v1-5.xsd OSSJ-Common-CBEResource-v1-5.xsd The schemaLocation declarations in SmpOrderManagementBase-v1-0.xsd are of the form "imported/.xsd". The processing of SmpOrderManagementBase-v1-0.wsdl yields entries imported/OSSJ-Common-v1-5.xsd imported/OSSJ-Common-CBEBi-v1-5.xsd imported/OSSJ-Common-CBECore-v1-5.xsd imported/OSSJ-OrderManagement-v1-0.xsd which are added to the Map. When using JDK 1.8 the order of root WSDLs processed is -0./SmpOrderManagementBase-v1-0.wsdl -1 imported/OSSJ-OrderManagement-v1-0.wsdl -2 imported/bw-2.wsdl All schemaLocation paths found in the SmpOrderManagementBase-v1-0 tree are compared to, vfs:/content/SmpOrderMgrWebServices.war/WEB-INF/wsdl/ {SmpOrderManagementBase-v1-0.wsdl} The schemaLocation declarations in SmpOrderManagementBase-v1-0.xsd are registered in Map as imported/OSSJ-Common-v1-5.xsd imported/OSSJ-Common-CBEBi-v1-5.xsd : In addition all schemaLocation declarations in OSSJ-OrderManagement-v1-0.xsd are re-calculated to also be "imported/.xsd" because of the path's relationship to vfs:/content/SmpOrderMgrWebServices.war/WEB-INF/wsdl/. This results in reference Map entries of SmpSubscriberEntity-v1-5.xsd imported/OSSJ-Common-CBEService-v1-5.xsd imported/OSSJ-Common-CBEResource-v1-5.xsd imported/OSSJ-Common-CBEProduct-v1-5.xsd imported/OSSJ-Common-CBEDatatypes-v1-5.xsd imported/OSSJ-Common-CBEParty-v1-5.xsd imported/OSSJ-Common-v1-5.xsd imported/OSSJ-Common-CBEProductOffering-v1-5.xsd imported/OSSJ-OrderManagement-v1-0.xsd SmpCommon-v1-5.xsd imported/OSSJ-Common-CBELocation-v1-5.xsd imported/OSSJ-Common-CBEBi-v1-5.xsd SmpOrderManagement-v1-0.xsd imported/OSSJ-Common-CBECore-v1-5.xsd Map, doneSchema, is use to lookup the the fragment of the URI to use when displaying the XSD. This is done in method WSDLGetUtils.mapUri. This path re-calculation with a different ref root path explains why Jan saw a different Map size when the app was run with JDK 1.7 and JDK 1.8. It also explains why the displayed xsd has differences in its schemaLocation re-calculation. > schemaLocation in xsd import is not rewritten correctly in Java 8 > ----------------------------------------------------------------- > > Key: CXF-6469 > URL: https://issues.apache.org/jira/browse/CXF-6469 > Project: CXF > Issue Type: Bug > Reporter: Rebecca Searls > Attachments: SmpOrderMgrWebServices.war > > > This issue exists for the current and all previous cxf versions that will be run with Java 8. > Java 7 and Java 8 yield different rewritten schemaLocations for an app that processes multiple > wsdls. > Using Java 7, their XSD schemaLocations are correctly expanded like this: > > > > > > > > > > But on Java 8, only the first schemaLocation is expanded, the others are not: > > > > > > > > > > To reproduce the issue, all you need to do is deploy the attached war file (SmpOrderMgrWebServices.war) and point your browser to: > http://localhost:8080/SmpOrderMgrWebServices/JVTOrderManagementSessionSOAP12?xsd=OSSJ-OrderManagement-v1-0.xsd -- This message was sent by Atlassian JIRA (v6.3.4#6332)