Package org.apache.geronimo.xbeans.j2ee

Examples of org.apache.geronimo.xbeans.j2ee.WebAppDocument


        }
        //we found web.xml, if it won't parse that's an error.
        try {
            // parse it
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            WebAppDocument webAppDoc = convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
        } catch (XmlException xmle) {
            // Output the target path in the error to make it clearer to the user which webapp
            // has the problem.  The targetPath is used, as moduleFile may have an unhelpful
            // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir
            throw new DeploymentException("Error parsing web.xml for " + targetPath, xmle);
View Full Code Here


            // on the J2ee management object
            specDD = DeploymentUtil.readAll(specDDUrl);

            // parse it
            XmlObject parsed = SchemaConversionUtils.parse(specDD);
            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
        } catch (XmlException xmle) {
            throw new DeploymentException("Error parsing web.xml", xmle);
        } catch (Exception e) {
            return null;
        }
View Full Code Here

            throw new DeploymentException("Cannot read WEB-INF/web.xml from module directory");
        }
        FileInputStream is = new FileInputStream(dd);
        try {
            try {
                WebAppDocument doc = (WebAppDocument) XmlBeansUtil.parse(new BufferedInputStream(is), WebAppDocument.type);
                return doc.getWebApp();
            } catch (XmlException e) {
                throw new DeploymentException("Unable to parse web.xml", e);
            }
        } finally {
            try {
View Full Code Here

                URI target = warRoot.resolve(src.getName());
                if ("WEB-INF/web.xml".equals(src.getName())) {
                    byte[] buffer = getBytes(module);
                    context.addFile(target, new ByteArrayInputStream(buffer));
                    try {
                        WebAppDocument doc = (WebAppDocument) XmlBeansUtil.parse(new ByteArrayInputStream(buffer), WebAppDocument.type);
                        webApp = doc.getWebApp();
                    } catch (XmlException e) {
                        throw new DeploymentException("Unable to parse web.xml");
                    }
                } else {
                    context.addFile(target, module);
View Full Code Here

        }
        //we found web.xml, if it won't parse that's an error.
        try {
            // parse it
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
        } catch (XmlException xmle) {
            throw new DeploymentException("Error parsing web.xml", xmle);
        }
        check(webApp);
View Full Code Here

        }
        //we found web.xml, if it won't parse that's an error.
        try {
            // parse it
            XmlObject parsed = XmlBeansUtil.parse(specDD);
            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
        } catch (XmlException xmle) {
            throw new DeploymentException("Error parsing web.xml", xmle);
        }
        check(webApp);
View Full Code Here

    }

    public void testContextRootWithoutPlanButWebApp() throws Exception {

        WebAppDocument webAppDocument = WebAppDocument.Factory.newInstance();
        WebAppType webAppType = webAppDocument.addNewWebApp();
        webAppType.setId("myId");

        URL war = classLoader.getResource("deployables/war2.war");
        assertTrue(war != null);
        JarFile dummyFile = new JarFile(new File(war.getFile()));
View Full Code Here

        try {
            webXmlUrl = new URL(moduleBase, "WEB-INF/web.xml");
        } catch (MalformedURLException e) {
            return null;
        }
        WebAppDocument webAppDoc = null;
        try {
            InputStream ddInputStream = webXmlUrl.openStream();
            webAppDoc = getWebAppDocument(ddInputStream);
        } catch (IOException e) {
            return null;
        } catch (DeploymentException e) {
            return null;
        }
        if (webAppDoc == null) {
            return null;
        }

        WebAppType webApp = webAppDoc.getWebApp();
        String id = webApp.getId();
        if (id == null) {
            id = moduleBase.getFile();
            if (id.endsWith("!/")) {
                id = id.substring(0, id.length() - 2);
View Full Code Here

        try {
            dd = SchemaConversionUtils.parse(ddInputStream);
        } catch (IOException e) {
            throw new DeploymentException(e);
        }
        WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(dd);
        return webAppDoc;
    }
View Full Code Here

        }
        //we found web.xml, if it won't parse that's an error.
        try {
            // parse it
            XmlObject parsed = SchemaConversionUtils.parse(specDD);
            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
            webApp = webAppDoc.getWebApp();
        } catch (XmlException xmle) {
            throw new DeploymentException("Error parsing web.xml", xmle);
        }
        check(webApp);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.j2ee.WebAppDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.