protected WebXmlParser getWebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException { WebXmlParser webXmlParser = null; boolean hasWSLDD = archive.exists(WEBLOGIC_XML); File runtimeAltDDFile = archive.getArchiveMetaData(DeploymentProperties.RUNTIME_ALT_DD, File.class); if (runtimeAltDDFile != null && "glassfish-web.xml".equals(runtimeAltDDFile.getPath()) && runtimeAltDDFile.isFile()) { webXmlParser = new GlassFishWebXmlParser(archive); } else if (!gfDDOverWLSDD && !ignoreWLSDD && hasWSLDD) { webXmlParser = new WeblogicXmlParser(archive); } else if (archive.exists(GLASSFISH_WEB_XML)) { webXmlParser = new GlassFishWebXmlParser(archive); } else if (archive.exists(SUN_WEB_XML)) { webXmlParser = new SunWebXmlParser(archive); } else if (gfDDOverWLSDD && !ignoreWLSDD && hasWSLDD) { webXmlParser = new WeblogicXmlParser(archive); } else { // default if (gfDDOverWLSDD || ignoreWLSDD) { webXmlParser = new GlassFishWebXmlParser(archive); } else { webXmlParser = new WeblogicXmlParser(archive); } } return webXmlParser; }
/** * If WEB-INF/sun-jaxws.xml exists and is not processed in EJB context , then it returns true. * * @param annInfo * @return */ private boolean isJaxwsRIDeployment(AnnotationInfo annInfo) { boolean riDeployment = false; AnnotatedElementHandler annCtx = annInfo.getProcessingContext().getHandler(); try { ReadableArchive moduleArchive = annInfo.getProcessingContext().getArchive(); if (moduleArchive != null && moduleArchive.exists("WEB-INF/sun-jaxws.xml") && !((Class) annInfo.getAnnotatedElement()).isInterface() && ((annCtx instanceof WebBundleContext) || (annCtx instanceof WebComponentContext))) { riDeployment = true; } } catch (Exception e) { // continue, processing } return riDeployment; }
WebXmlParser(ReadableArchive archive) throws XMLStreamException, IOException { if (archive.exists(getXmlFileName())) { try (InputStream is = archive.getEntry(getXmlFileName())) { init(is); } catch (Throwable t) { String msg = localStrings.getLocalString( "web.deployment.exception_parsing_webxml", "Error in parsing {0} for archive [{1}]: {2}", getXmlFileName(), archive.getURI(), t.getMessage()); throw new RuntimeException(msg); } } }