Examples of ServiceException


Examples of org.apache.openejb.server.ServiceException

            String value = (String) p.get(property);

            if (property.startsWith(ServerConstants.SC_KEY_DBNAME + ".") ||
                    property.startsWith(ServerConstants.SC_KEY_DATABASE + ".")) {

                throw new ServiceException("Databases cannot be declared in the hsql.properties.  " +
                        "Instead declare a database connection in the openejb.conf file");
            }

            if ("port".equals(property)) {
                properties.setProperty(ServerConstants.SC_KEY_PORT, value);
            } else if ("bind".equals(property)) {
                properties.setProperty(ServerConstants.SC_KEY_ADDRESS, value);
            } else {
                properties.setProperty(property, value);
            }
        }
        properties.setProperty(ServerConstants.SC_KEY_NO_SYSTEM_EXIT, "true");

        boolean disabled = Boolean.parseBoolean(properties.getProperty("disabled"));
        if (!disabled) {
            NamingEnumeration<Binding> bindings = null;
            try {
                bindings = new InitialContext().listBindings("java:openejb/Resource/");
                int dbIndex = 0;
                for (Binding binding : Collections.list(bindings)) {
                    Object value = binding.getObject();
                    if (value instanceof ConnectorReference) {
                        Object connectionFactory = ((ConnectorReference)value).getObject();
                        if (connectionFactory instanceof JdbcConnectionFactory) {
                            JdbcConnectionFactory jdbc = (JdbcConnectionFactory) connectionFactory;
                            String path = getPath(jdbc);
                            if (path != null) {
                                if (dbIndex > 9) {
                                    throw new ServiceException("Hsql Server can only host 10 database connections");
                                }
                                String dbname = path.substring(path.lastIndexOf('/') + 1);
                                properties.put(ServerConstants.SC_KEY_DBNAME + "." + dbIndex, dbname);
                                properties.put(ServerConstants.SC_KEY_DATABASE + "." + dbIndex, path);
                                dbIndex++;

Examples of org.apache.tomee.loader.service.ServiceException

        final Context ctx;
        try {
            ctx = new InitialContext(ctxParams);
        } catch (NamingException e) {
            throw new ServiceException(e);
        }
        return ctx;
    }

Examples of org.apache.vinci.transport.ServiceException

      XTalkTransporter.writeInt(1, os);
      XMLReader xr;
      try {
        xr = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
      } catch (SAXException e) {
        throw new ServiceException("Error creating SAX Parser: " + e);
      } catch (ParserConfigurationException e) {
        throw new ServiceException("Error creating SAX Parser: " + e);
      }
      if (xml_os != null) {
        xml_os.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
      }
      // prevent undeclared namespace warnings.
      try {
        xr.setFeature("http://xml.org/sax/features/namespaces", false);
        handler = new XTalkHandler(os, purgeWhitespace, xml_os);
        xr.setContentHandler(handler);
        xr.setErrorHandler(handler);
        xr.parse(new InputSource(r));
        Debug.p("Final depth: " + handler.depth);
        Debug.p("Final child list size: " + handler.countList.size());
      } catch (SAXException e) {
        Debug.reportException(e);
        throw new ServiceException("XML Parse error: " + e);
      }
    } finally {
      os.close();
      if (xml_os != null) {
        xml_os.close();

Examples of org.b3log.latke.service.ServiceException

                transaction.rollback();
            }

            LOGGER.log(Level.SEVERE, "Removes a link[id=" + linkId + "] failed",
                       e);
            throw new ServiceException(e);
        }
    }

Examples of org.bigk.invoices.exceptions.ServiceException

    User user = null;
    try {
      user = usersDAO.getUser4Login(login);
    } catch (DBAccessException ex) {
      logger.error("processLogin(String, String)", ex);
      throw new ServiceException(ex);
    }
   
    if (user == null) {
      throw new ServiceException("No user found for username",
          "services.LoginServiceImpl.processLogin.no_user",
          new Object[] {login}
      );
    }
   
    String passSHA1 = null;
    try {
      passSHA1 = DigestUtils.digestSHA1(password);
    } catch (NoSuchAlgorithmException e) {
      logger.error("processLogin(String, String)", e);
      throw new ServiceException("NoSuchAlgorithmException", e,
          "services.LoginServiceImpl.processLogin.algoritm_problem",
          new Object[] {e.getMessage()}
      );     
    }
   

    if (logger.isDebugEnabled()) {
      logger.debug("processLogin(String, String) - passSHA1=" + passSHA1);
      logger.debug("processLogin(String, String) - user.getPassword()=" + user.getPassword());
    }
   
    if (!passSHA1.equalsIgnoreCase(user.getPassword())) {
      throw new ServiceException("Wrong password",
          "services.LoginServiceImpl.processLogin.wrong_password",
          null
      );
    }
   

Examples of org.broadleafcommerce.common.exception.ServiceException

                    );
                }
                allMergedProperties.put(MergedPropertyType.MAPSTRUCTUREVALUE, valueMergedProperties);
            }
        } catch (Exception e) {
            throw new ServiceException("Unable to fetch results for " + ceilingEntityFullyQualifiedClassname, e);
        }
    }

Examples of org.codehaus.enunciate.samples.genealogy.services.ServiceException

      source.setLink(URI.create("uri:some-uri"));
      source.setTitle("some-title");
      return source;
    }
    else if ("throw".equals(id)) {
      throw new ServiceException("some message", "another message");
    }
    else if ("unknown".equals(id)) {
      UnknownSourceBean bean = new UnknownSourceBean();
      bean.setSourceId("unknown");
      bean.setErrorCode(888);

Examples of org.cyclop.model.exception.ServiceException

      resPan.showResultsTableOnInit = true;
      resPan.initPage = pager.getCurrentPage();
      return resPan;
    } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
        | IllegalArgumentException | InvocationTargetException e) {
      throw new ServiceException("Cannot create QueryResultPanel instance: " + e.getMessage(), e);
    }

  }

Examples of org.eclipse.sisu.peaberry.ServiceException

          insertService(new OSGiServiceImport<T>(bundleContext, r)); // NOPMD
        }
      }

    } catch (final InvalidSyntaxException e) {
      throw new ServiceException(e); // this should never happen!
    }
  }

Examples of org.exolab.jms.service.ServiceException

        // bind each persistent destination in JNDI
        Context context;
        try {
            context = _names.getInitialContext();
        } catch (NamingException exception) {
            throw new ServiceException("Failed to get initial JNDI context",
                                       exception);
        }

        List destinations;
        try {
            destinations = _destinations.getDestinations();
        } catch (JMSException exception) {
            throw new ServiceException("Failed to get destinations",
                                       exception);
        }

        for (Iterator i = destinations.iterator(); i.hasNext();) {
            JmsDestination destination = (JmsDestination) i.next();
            if (destination.getPersistent()) {
                try {
                    ContextHelper.rebind(context, destination.getName(),
                                         destination);
                } catch (NamingException exception) {
                    throw new ServiceException("Failed to add destination "
                                               + destination.getName()
                                               + " to JNDI", exception);
                }
            }
        }
TOP
Copyright © 2018 www.massapi.com. 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.