Package org.apache.xindice.util

Examples of org.apache.xindice.util.XindiceException


            }
            try {
                // In case home has been specified as relative path convert it to absolute path
                dbrootDir = new File(home, dbroot).getCanonicalFile();
            } catch (IOException e) {
                throw new XindiceException("Can't get canonical path", e);
            }
        }
        setCollectionRoot(dbrootDir);
        if (log.isInfoEnabled()) {
            log.info("Database points to " + dbrootDir.getAbsolutePath());
        }

        // Put a lock (at least attempt to) on the database
        File lock = new File(getCollectionRoot(), "db.lock");
        try {
            this.lock = new FileOutputStream(lock);

            if (this.lock.getChannel().tryLock() != null) {
                this.lock.write(new Date().toString().getBytes());
            } else {
                throw new IOException("Unable to acquire file lock.");
            }
        } catch (IOException e) {
            throw new XindiceException("Unable to open lock file " + lock + ". " +
                                       "Make sure database is not open by another process.",
                                       e);
        }

        // Now we are ready to open it up
View Full Code Here


    public DOMParser() throws XindiceException {
        try {
            sp = getSAXParser();
        } catch (Exception e) {
            log.warn("Failed to create SAXParser", e);
            throw new XindiceException("Error creating parser", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(input);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(xml);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(value);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(source);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(input);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

        try {
            DOMParser dp = new DOMParser();
            dp.parse(xml);
            return dp.getDocument();
        } catch (Exception e) {
            throw new XindiceException("Error parsing Document", e);
        }
    }
View Full Code Here

                }
            }

            setFile(new File(collection.getCollectionRoot(), name));
        } catch (Exception e) {
            throw new XindiceException(e);
        }
    }
View Full Code Here

    public void process(String[] args) throws XindiceException {
        try {
            parseArguments(args);
            execute();
        } catch (IllegalArgumentException e) {
            throw new XindiceException("ERROR : " + e.getMessage() + " Try -h for help.", e);
        } catch (NoSuchElementException e) {
            throw new NoSuchElementException("ERROR : " + e + " Switch found. Parameter missing. Try -h for help.");
        } catch (NullPointerException e) {
            throw new NullPointerException("ERROR : " + e + " Try -h for help.");
        } catch (Exception e) {
            throw new XindiceException("ERROR : " + e.getMessage() + " Try -h for help.", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xindice.util.XindiceException

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.