Package org.apache.cocoon

Examples of org.apache.cocoon.ResourceNotFoundException


            programGenerator.load(this.manager, super.source, this.markupLanguage, this.programmingLanguage, this.resolver);
    } catch (ProcessingException e) {
        throw e;
    } catch (Exception e) {
        getLogger().warn("ServerPagesGenerator.generate()", e);
        throw new ResourceNotFoundException(e.getMessage(), e);
    } catch (NoClassDefFoundError e) {
        getLogger().warn("Failed to load class: " + e);
        throw new ResourceNotFoundException(e.getMessage());
    }
    generator.setup(this.resolver, this.objectModel, super.source, this.parameters);
  }
View Full Code Here


                    new InputSource(new StringReader(w.toString()));
            parser.setConsumer(this.xmlConsumer);
            parser.parse(xmlInput);
        } catch (IOException e){
            getLogger().warn("VelocityGenerator.generate()", e);
            throw new ResourceNotFoundException("Could not get Resource for VelocityGenerator", e);
        } catch (SAXException e){
            getLogger().error("VelocityGenerator.generate()", e);
            throw(e);
        } catch (ComponentException e){
            getLogger().error("Could not get parser", e);
View Full Code Here

            } else {
                DOMStreamer streamer = new DOMStreamer(this.contentHandler,this.lexicalHandler);
                streamer.stream(doc);
            }
        } catch (IOException e){
            throw new ResourceNotFoundException("Could not get resource "
                + this.inputSource.getURI(), e);
        } catch (SAXException e){
            throw e;
        } catch (Exception e){
            throw new ProcessingException("Exception in HTMLGenerator.generate()",e);
View Full Code Here

        } catch (XMLDBException e) {
            throw new ProcessingException("Could not get collection " + base + ": " + e.errorCode, e);
        }

        if(this.collection == null)
            throw new ResourceNotFoundException("Collection " + base + " does not exist");
    }
View Full Code Here

        TraversableSource inputSource = null;
        try {
            inputSource = (TraversableSource) this.resolver.resolveURI(this.source);

            if (!inputSource.isCollection()) {
                throw new ResourceNotFoundException(this.source + " is not a collection.");
            }

            this.contentHandler.startDocument();

            Stack ancestors = getAncestors(inputSource);
            addAncestorPath(inputSource, ancestors);

            this.contentHandler.endDocument();
            if (this.validity != null) {
                this.validity.close();
            }
        } catch (SourceException se) {
            throw SourceUtil.handle(se);
        } catch (IOException ioe) {
            throw new ResourceNotFoundException("Could not read collection "
                                                + this.source, ioe);
        } catch (ClassCastException ce) {
            throw new ResourceNotFoundException(this.source
                                                + " is not a traversable source");
        } finally {
            this.resolver.release(inputSource);
        }
    }
View Full Code Here

            InputSource inputSource = new InputSource(new StringReader(output.toString()));
            parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
            parser.parse(inputSource, super.xmlConsumer);
        } catch (IOException e) {
            getLogger().error("JellyGenerator.generate()", e);
            throw new ResourceNotFoundException("JellyGenerator could not find resource", e);
        } catch (SAXException e) {
            getLogger().error("JellyGenerator.generate()", e);
            throw (e);
        } catch (Exception e) {
            getLogger().error("Could not get parser", e);
View Full Code Here

            parser = (SAXParser)(this.manager.lookup(SAXParser.ROLE));
            parser.parse(xmlInput, this.xmlConsumer);
        } catch (SourceException se) {
            throw SourceUtil.handle(se);
        } catch (FileNotFoundException e) {
            throw new ResourceNotFoundException(
                "Could not load script " + this.inputSource.getURI(), e);
        } catch (BSFException e) {
            throw new ProcessingException(
                    "Exception in ScriptGenerator.generate()", e);
        } catch (Exception e) {
View Full Code Here

    Script compileScript(Context cx,
                         Environment environment,
                         String fileName) throws Exception {
        Source src = environment.resolveURI(fileName);
        if (src == null) {
            throw new ResourceNotFoundException(fileName + ": not found");
        }
        synchronized (compiledScripts) {
            ScriptSourceEntry entry =
                (ScriptSourceEntry)compiledScripts.get(src.getURI());
            Script compiledScript = null;
View Full Code Here

    private Script compileScript(Context cx, Scriptable scope,
                                 Source src) throws Exception {
        InputStream is = src.getInputStream();
        if (is == null) {
            throw new ResourceNotFoundException(src.getURI() + ": not found");
        }
        Reader reader = new BufferedReader(new InputStreamReader(is));
        Script compiledScript = cx.compileReader(scope, reader,
                                                 src.getURI(),
                                                 1, null);
View Full Code Here

                    }
                }
                cocoon.setParameters(parameters);
                Object fun = ScriptableObject.getProperty(thrScope, funName);
                if (fun == Scriptable.NOT_FOUND) {
                    throw new ResourceNotFoundException("Function \"javascript:"+funName+ "()\" not found");
                }
                ScriptRuntime.call(context, fun, thrScope,
                                   funArgs, thrScope);
            } catch (JavaScriptException ex) {
                EvaluatorException ee =
View Full Code Here

TOP

Related Classes of org.apache.cocoon.ResourceNotFoundException

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.