Package org.apache.cocoon

Examples of org.apache.cocoon.ResourceNotFoundException


            if (invokeNodes(children, env, context)) {
                return true;
            } else if (!this.isLast) {
                return false;
            } else {
                throw new ResourceNotFoundException(
                        "No pipeline matched request: " + env.getURIPrefix()
                        + env.getURI());
            }
        } catch (ConnectionResetException cre) {
            // Will be reported by CocoonServlet, rethrowing
View Full Code Here


            }

            PreparedStatement statement = con.prepareStatement(getQuery());
            statement.setString(1, this.source);
            ResultSet set = statement.executeQuery();
            if (!set.next()) throw new ResourceNotFoundException("There is no resource with that key");

            Response response = ObjectModelHelper.getResponse(objectModel);
            Request request = ObjectModelHelper.getRequest(objectModel);

            if (this.modifiedSince(set, request, response)) {
                this.resource = set.getBinaryStream(1);
                if (this.typeColumn != 0) {
                    this.mimeType = set.getString(this.typeColumn);
                }

                if (this.resource == null) {
                    throw new ResourceNotFoundException("There is no resource with that key");
                }
            }

            this.doCommit = true;
        } catch (Exception e) {
            this.doCommit = false;

            throw new ResourceNotFoundException("DatabaseReader error:", e);
        }
    }
View Full Code Here

            this.doCommit = false;
        } catch (Exception e) {
            this.doCommit = false;

            throw new ResourceNotFoundException("DatabaseReader error:", e);
        }
    }
View Full Code Here

     */
    Script compileScript(Context cx,
                         String fileName) throws Exception {
        Source src = sourceResolver.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

        // no scripts applied or compileScript was called with null AspectWeaver
        if( aspectWeaver == null || ! areScriptsApplied ) {
            InputStream is = src.getInputStream();
            if (is == null) {
                throw new ResourceNotFoundException(src.getURI() + ": not found");
            }
            Reader reader = new BufferedReader(new InputStreamReader(is));
            compiledScript = cx.compileReader(scope, reader, src.getURI(), 1, null );
        }
        // script applied
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

                // on in the pipeline. Therefore we only serialize the document element.
                domStreamer.stream(doc.getDocumentElement());
            }
            this.contentHandler.endDocument();
        } 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

        Object fragment = null;
        try {
            store = (Store) this.manager.lookup(Store.TRANSIENT_STORE);
            fragment = store.get(source);
            if (fragment == null) {
                throw new ResourceNotFoundException("Could not find fragment " + source + " in store");
            }

            deserializer = (XMLDeserializer) this.manager.lookup(XMLDeserializer.ROLE);
            deserializer.setConsumer(this.xmlConsumer);
            deserializer.deserialize(fragment);
View Full Code Here

        } catch (NoClassDefFoundError e) {
            // VG: Usually indicates that page invoked with the wrong case.
            // I.e., it was compiled as "my.xsp" and inoked as "My.xsp",
            // results in different class name and an error.
            getLogger().warn("Failed to load class: " + e);
            throw new ResourceNotFoundException(e.getMessage());
        }

        // Give our own logger to the generator so that logs go in the correct category
        generator.enableLogging(getLogger());
View Full Code Here

        try {
            collection = DatabaseManager.getCollection(base + col);
            xmlResource = (XMLResource) collection.getResource(res);
            if (xmlResource == null) {
                throw new ResourceNotFoundException("Document " + col + "/" + res +
                                                    " not found");
            }

            xmlResource.getContentAsSAX(this.xmlConsumer);
            collection.close();
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.