Package net.fp.rp.common.exception

Examples of net.fp.rp.common.exception.RpException


                        //handling to be done
                        return con.getInputStream();
                        */
                        Logger.getRootLogger().debug("Specified https uri is not supported by the system " +
                            uri);
                        throw new RpException("app.location.web.error",
                            new Object[] { uri });
                    } else {
                        /*
                        Logger.getRootLogger().info("Thread the location " +
                            uri + " as web (ftp://) ");
                        */

                        return conn.getInputStream();
                    }
                } catch (IOException e) {
                    Logger.getRootLogger().debug("I/OException getting the reader for uri:" +
                        uri);
                    throw new RpException("app.location.web.notavailable",
                        new Object[] { uri });
                } catch (Throwable t) {
                    Logger.getRootLogger().debug("Error in getting the reader for the web location:" +
                        uri);
                    throw new RpException("app.location.web.error",
                        new Object[] { uri });
                }
            } else {
                /*
                Logger.getRootLogger().info("Thread the location " + uri +
                    " locally (file:///) ");
                */
                try {
                    return new BufferedInputStream(u.openStream());
                } catch (FileNotFoundException e) {
                    Logger.getRootLogger().debug("Specified file not exists:" +
                        uri);
                    throw new RpException("app.location.file.notavailable",
                        new Object[] { uri });
                } catch (Throwable t) {
                    Logger.getRootLogger().debug("Error in getting the stream for the local location:" +
                        uri);
                    throw new RpException("app.location.file.error",
                        new Object[] { uri });
                }
            }
        } catch (MalformedURLException e) {
            Logger.getRootLogger().debug("Not a valid url location :" + uri);
            throw new RpException("app.location.nourl", new Object[] { uri });
        }
    }
View Full Code Here


     */
    public static ICategoryStore getCategoryStores() throws RpException {
        if (categoryStores != null) {
            return categoryStores;
        } else {
            throw new RpException("pluginmanager.plugins.nocategorystore");
        }
    }
View Full Code Here

          log.info("Serializing rules to file " + serialPath
              + " for later use");
          serializeRulesToFile(returnRules, serialPath);

        } else {
          throw new RpException(
              "Unable to find Rules in any form (Serial,Drl,Excel) at any location (file,classpath)");
        }

      }
    }
View Full Code Here

          log.info("Saving tmpCopy to " + drlPathTmp);
          outputDrlToFile(drl, drlPathTmp);

        } else {
          throw new RpException(
              "Problem creating new rule base from Excel");
        }
      } else {
        throw new RpException("Problem loading Excel Decision Tables");
      }

    } catch (IOException ie) {
      // Wrap Exception and throw it
      log.debug("Rethrowing", ie);
      throw new RpException(ie);
    } catch (SAXException saxe) {
      // Wrap Exception and throw it
      throw new RpException(saxe);
    } catch (IntegrationException ie) {
      // Wrap Exception and throw it
      throw new RpException(ie);
    } catch (DroolsParserException dpe) {
      // Wrap Exception and throw it
      throw new RpException(dpe);
    } catch (RpException rpe) {
      // just rethrow
      throw rpe;
    } catch (Exception e) {
      // Handling generic 'Exception' is forced upon us by
      // RuleBase.addPackage
      // Wrap Exception and throw it
      log.warn(e);
      throw new RpException(e);
    }

    // Return the excel rules that we have set
    return this.getRuleBase();
View Full Code Here

      FileWriter out = new FileWriter(fileName, false);
      out.write(drl);
      out.close();
      log.debug("Put copy of DRL in file:" + fileName);
    } catch (IOException ie) {
      throw new RpException(ie);
    }

  }
View Full Code Here

      if (pkg != null) {
        returnRuleBase = RuleBaseFactory.newRuleBase();
        returnRuleBase.addPackage(pkg);
      }
    } catch (IOException ie) {
      throw new RpException(ie);
    } catch (DroolsParserException dpe) {
      throw new RpException(dpe);
    } catch (Exception e) {
      throw new RpException(e);
    }

    return returnRuleBase;

  }
View Full Code Here

            //parse the input and notify the handler
            saxParser.parse(input, builder);
        } catch (SAXException e) {
            logger.debug("SAXException in processing location" + info.getUri(),
                e);
            throw new RpException("extractor.xml.filenotvalid",
                new Object[] { info.getUri() });
        } catch (Throwable t) {
            logger.debug("Exception in processing the location" +
                info.getUri(), t);
            throw new RpException("app.extract.error",
                new Object[] { info.getUri() });
        } finally {
            try {
                if (in != null) {
                    in.close();
View Full Code Here

                doc.setCategoryLocation(info.getCategoryLocation());

                //store and reindex document
                PluginManager.storeAndAddDocument(doc);
            } catch (IOException e) {
                throw new RpException("app.extract.error",
                    new Object[] { info.getUri() });
            } finally {
                try {
                    if (din != null) {
                        din.close();
View Full Code Here

        cachedConnection = DriverManager.getConnection(
            connectionString, userName, password);
      }
    } catch (SQLException sqle) {
      sqle.printStackTrace();
      throw new RpException(sqle);
    } catch (ClassNotFoundException cnfe) {
      throw new RpException(cnfe);
    }

  }
View Full Code Here

      if (cachedConnection != null) {
        cachedConnection.close();
        cachedConnection = null;
      }
    } catch (SQLException sqle) {
      throw new RpException(sqle);
    }

  }
View Full Code Here

TOP

Related Classes of net.fp.rp.common.exception.RpException

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.