List of usage examples for java.lang ClassNotFoundException toString
public String toString()
From source file:com.cloud.agent.AgentShell.java
private void launchAgentFromClassInfo(String resourceClassNames) throws ConfigurationException { String[] names = resourceClassNames.split("\\|"); for (String name : names) { Class<?> impl;/*from w w w .j a v a2 s . co m*/ try { impl = Class.forName(name); final Constructor<?> constructor = impl.getDeclaredConstructor(); constructor.setAccessible(true); ServerResource resource = (ServerResource) constructor.newInstance(); launchAgent(getNextAgentId(), resource); } catch (final ClassNotFoundException e) { throw new ConfigurationException("Resource class not found: " + name + " due to: " + e.toString()); } catch (final SecurityException e) { throw new ConfigurationException( "Security excetion when loading resource: " + name + " due to: " + e.toString()); } catch (final NoSuchMethodException e) { throw new ConfigurationException( "Method not found excetion when loading resource: " + name + " due to: " + e.toString()); } catch (final IllegalArgumentException e) { throw new ConfigurationException( "Illegal argument excetion when loading resource: " + name + " due to: " + e.toString()); } catch (final InstantiationException e) { throw new ConfigurationException( "Instantiation excetion when loading resource: " + name + " due to: " + e.toString()); } catch (final IllegalAccessException e) { throw new ConfigurationException( "Illegal access exception when loading resource: " + name + " due to: " + e.toString()); } catch (final InvocationTargetException e) { throw new ConfigurationException( "Invocation target exception when loading resource: " + name + " due to: " + e.toString()); } } }
From source file:egovframework.oe1.cms.sys.service.impl.EgovOe1ConsentManageServiceImpl.java
/** * ? ? ? ? . ??//w w w.j a v a 2s . com * ? callback . * @param submitVO * * @throws Exception * @see egovframework.mgt.cmm.consent.service.EgovConsentManageService#cancelSanctionSubmit(egovframework.mgt.cmm.consent.service.SanctionSubmitVO) */ public void cancelSanctionSubmit(EgovOe1SanctionSubmitVO submitVO) throws Exception { String currentDate = EgovDateUtil.getCurrentDateAsString() + EgovDateUtil.getCurrentHourAsString() + EgovDateUtil.getCurrentMinuteAsString() + EgovDateUtil.getCurrentSecondAsString(); submitVO.setConfmDt(currentDate); submitVO.setDrftSttusCode("4"); // ? int result1 = consentManageDAO.updateDraftingStatusCode(submitVO); int result2 = consentManageDAO.updateSanctionConfirmDate(submitVO); log.debug(this.getClass() + " result1 : " + result1); log.debug(this.getClass() + " result2 : " + result2); // Callback Method try { ApplicationContext ctx = getApplicationContext(); EgovOe1ConsentCallbackService callbackService = (EgovOe1ConsentCallbackService) ctx .getBean(submitVO.getJobClass()); callbackService.cancelSubmit(submitVO); } catch (ClassNotFoundException e) { log.error(this.getClass() + " Callback - ? ? : " + e.toString()); } catch (Exception e) { log.info(this.getClass() + " Callback : " + e.toString()); } }
From source file:egovframework.oe1.cms.sys.service.impl.EgovOe1ConsentManageServiceImpl.java
/** * ? ? . ??// w w w . j a va2 s . c om * callback . * @param submitVO * * @throws Exception * @see egovframework.mgt.cmm.consent.service.EgovConsentManageService#returnSanctionSubmit(egovframework.mgt.cmm.consent.service.SanctionSubmitVO) */ public void returnSanctionSubmit(EgovOe1SanctionSubmitVO submitVO) throws Exception { EgovOe1SanctionConsentVO sanctionConsentVO = new EgovOe1SanctionConsentVO(); sanctionConsentVO.setConfmResultCode("2"); sanctionConsentVO.setDrftSn(submitVO.getDrftSn()); sanctionConsentVO.setConfmOrdr(submitVO.getConfmOrdr()); sanctionConsentVO.setConfmOpinion(submitVO.getConfmOpinion()); String currentDate = EgovDateUtil.getCurrentDateAsString() + EgovDateUtil.getCurrentHourAsString() + EgovDateUtil.getCurrentMinuteAsString() + EgovDateUtil.getCurrentSecondAsString(); sanctionConsentVO.setConfmDt(currentDate); sanctionConsentVO.setDrftDt(currentDate); submitVO.setDrftSttusCode("3"); // submitVO.setDrftSn(sanctionConsentVO.getDrftSn()); consentManageDAO.updateDraftingStatusCode(submitVO); int returnResult = consentManageDAO.updateSanctionConfirmReturn(sanctionConsentVO); int saveComplete = consentManageDAO.updateSanctionConfirmComplete(sanctionConsentVO); log.debug(this.getClass() + " returnResult : " + returnResult + ", saveComplete : " + saveComplete); // Callback Method try { ApplicationContext ctx = getApplicationContext(); EgovOe1ConsentCallbackService callbackService = (EgovOe1ConsentCallbackService) ctx .getBean(submitVO.getJobClass()); callbackService.returnConsent(submitVO); } catch (ClassNotFoundException e) { log.error(this.getClass() + " Callback - ? ? : " + e.toString()); } catch (Exception e) { log.info(this.getClass() + " Callback : " + e.toString()); } }
From source file:org.apache.pig.piggybank.storage.AllLoader.java
@Override public void prepareToRead(@SuppressWarnings("rawtypes") RecordReader reader, PigSplit split) throws IOException { AllReader allReader = (AllReader) reader; if (currentPath == null || !(currentPath.equals(allReader.path))) { currentPathPartitionKeyMap = (partitionColumns == null) ? null : pathPartitionerHelper.getPathPartitionKeyValues(allReader.path.toString()); currentPath = allReader.path;/*from w w w . ja va 2 s . c o m*/ } childLoadFunc = allReader.prepareLoadFuncForReading(split); String projectProperty = getUDFContext().getProperty(PROJECTION_ID); if (projectProperty != null) { // load the required field list from the current UDF context ByteArrayInputStream input = new ByteArrayInputStream( Base64.decodeBase64(projectProperty.getBytes("UTF-8"))); ObjectInputStream objInput = new ObjectInputStream(input); try { requiredFieldList = (RequiredFieldList) objInput.readObject(); } catch (ClassNotFoundException e) { throw new FrontendException(e.toString(), e); } finally { IOUtils.closeStream(objInput); } if (childLoadFunc.getClass().isAssignableFrom(LoadPushDown.class)) { supportPushDownProjection = true; ((LoadPushDown) childLoadFunc).pushProjection(requiredFieldList); } else { if (requiredFieldList != null) { requiredFieldHashSet = new TreeSet<Integer>(); for (RequiredField requiredField : requiredFieldList.getFields()) { requiredFieldHashSet.add(requiredField.getIndex()); } } } } }
From source file:com.redhat.rhn.common.localization.LocalizationService.java
/** * Get a localized version of a string with the specified locale. * @param messageId The key of the message we are fetching * @param locale The locale to use when fetching the string * @param args arguments for message./*from w w w . jav a 2s .c om*/ * @return Translated String */ public String getMessage(String messageId, Locale locale, Object... args) { log.debug("getMessage() called with messageId: " + messageId + " and locale: " + locale); // Short-circuit the rest of the method if the messageId is null // See bz 199892 if (messageId == null) { return getMissingMessageString(messageId); } String userLocale = locale == null ? "null" : locale.toString(); if (msgLogger.isDebugEnabled()) { msgLogger.debug("Resolving message \"" + messageId + "\" for locale " + userLocale); } String mess = null; Class z = null; try { // If the keyMap doesn't contain the requested key // then there is no hope and we return. if (!keyToBundleMap.containsKey(messageId)) { return getMissingMessageString(messageId); } z = Class.forName(keyToBundleMap.get(messageId)); // If we already determined that there aren't an bundles // for this Locale then we shouldn't repeatedly fail // attempts to parse the bundle. Instead just force a // call to the default Locale. mess = XmlMessages.getInstance().format(z, locale, messageId, args); } catch (MissingResourceException e) { // Try again with DEFAULT_LOCALE if (msgLogger.isDebugEnabled()) { msgLogger.debug("Resolving message \"" + messageId + "\" for locale " + userLocale + " failed - trying again with default " + "locale " + DEFAULT_LOCALE.toString()); } try { mess = XmlMessages.getInstance().format(z, DEFAULT_LOCALE, messageId, args); } catch (MissingResourceException mre) { if (msgLogger.isDebugEnabled()) { msgLogger.debug("Resolving message \"" + messageId + "\" " + "for default locale " + DEFAULT_LOCALE.toString() + " failed"); } return getMissingMessageString(messageId); } } catch (ClassNotFoundException ce) { String message = "Class not found when trying to fetch a message: " + ce.toString(); log.error(message, ce); throw new LocalizationException(message, ce); } return getDebugVersionOfString(mess); }
From source file:egovframework.oe1.cms.sys.service.impl.EgovOe1ConsentManageServiceImpl.java
/** * ? - ?/* w w w.j av a 2 s . c o m*/ * @param submitVO * ?? * @return ? * @throws Exception * @see egovframework.mgt.cmm.consent.service.EgovConsentManageService#actionSanctionDrafting(egovframework.mgt.cmm.consent.service.SanctionSubmitVO) */ public String actionSanctionDrafting(EgovOe1SanctionSubmitVO submitVO) throws Exception { String drftSn = egovIdGnrService.getNextStringId(); log.debug(this.getClass() + " actionSanctionDrafting() submitVO : " + submitVO.toString()); String currentDate = EgovDateUtil.getCurrentDateAsString() + EgovDateUtil.getCurrentHourAsString() + EgovDateUtil.getCurrentMinuteAsString() + EgovDateUtil.getCurrentSecondAsString(); submitVO.setDrftDt(currentDate); submitVO.setDrftSn(drftSn); consentManageDAO.insertSanctionDraftWriting(submitVO); // ? Table? log.debug(this.getClass() + submitVO.getSanctnRouteId()); StringTokenizer stRouteId = new StringTokenizer(submitVO.getSanctnRouteId(), "|"); int routeIdCnt = stRouteId.countTokens(); String receiver[] = new String[routeIdCnt]; for (int i = 0; stRouteId.hasMoreTokens(); i++) receiver[i] = stRouteId.nextToken(); StringTokenizer stRouteSeCode = new StringTokenizer(submitVO.getSanctnRouteSeCode(), "|"); int routeSeCodeCnt = stRouteSeCode.countTokens(); String aprvlGb[] = new String[routeSeCodeCnt]; for (int i = 0; stRouteSeCode.hasMoreTokens(); i++) aprvlGb[i] = stRouteSeCode.nextToken(); log.debug(this.getClass() + " routeIdCnt is " + routeIdCnt); boolean firstConfirm = false; for (int i = 0; i < routeIdCnt; i++) { EgovOe1SanctionConsentVO sanctionConsentVO = new EgovOe1SanctionConsentVO(); sanctionConsentVO.setDrftSn(drftSn); sanctionConsentVO.setConfmOrdr(i + 1); if (aprvlGb[i].equals("1")) { // sanctionConsentVO.setDrftDt(currentDate); // sanctionConsentVO.setConfmDt(currentDate); // ? sanctionConsentVO.setConfmOpinion(submitVO.getDrftOpinion()); sanctionConsentVO.setSanctnTrgtYn("N"); } else if (aprvlGb[i].equals("2")) { if (!firstConfirm) { firstConfirm = true; sanctionConsentVO.setDrftDt(currentDate); sanctionConsentVO.setSanctnTrgtYn("Y"); } else { sanctionConsentVO.setDrftDt(""); sanctionConsentVO.setSanctnTrgtYn("N"); } sanctionConsentVO.setConfmDt(""); sanctionConsentVO.setConfmOpinion(""); } else { sanctionConsentVO.setDrftDt(""); sanctionConsentVO.setConfmDt(""); sanctionConsentVO.setConfmOpinion(""); sanctionConsentVO.setSanctnTrgtYn("N"); } sanctionConsentVO.setConfmResultCode(""); sanctionConsentVO.setConfmer(receiver[i]); sanctionConsentVO.setConfmSeCode(aprvlGb[i]); sanctionConsentVO.setConfmComptYn("N"); sanctionConsentVO.setDeleteYn("N"); sanctionConsentVO.setAtchFileId(""); consentManageDAO.insertSanctionConsent(sanctionConsentVO); } // Callback Method try { /* * ApplicationContext ctx = new * ClassPathXmlApplicationContext(new * String[] * {"egovframework/spring/context-*.xml"}); */ ApplicationContext ctx = getApplicationContext(); EgovOe1ConsentCallbackService callbackService = (EgovOe1ConsentCallbackService) ctx .getBean(submitVO.getJobClass()); callbackService.draftingConsent(submitVO); } catch (ClassNotFoundException e) { log.error(this.getClass() + " Callback - ? ? : " + e.toString()); } catch (Exception e) { log.info(this.getClass() + " Callback : " + e.toString()); } return String.valueOf(drftSn); }
From source file:egovframework.oe1.cms.sys.service.impl.EgovOe1ConsentManageServiceImpl.java
/** * ? - /*from w ww.ja v a2 s .com*/ * @param submitVO * ?? * @return ? * @throws Exception * @see egovframework.mgt.cmm.consent.service.EgovConsentManageService#actionSanctionDraftingUpdt(egovframework.mgt.cmm.consent.service.SanctionSubmitVO) */ public String actionSanctionDraftingUpdt(EgovOe1SanctionSubmitVO submitVO) throws Exception { String currentDate = EgovDateUtil.getCurrentDateAsString() + EgovDateUtil.getCurrentHourAsString() + EgovDateUtil.getCurrentMinuteAsString() + EgovDateUtil.getCurrentSecondAsString(); submitVO.setDrftDt(currentDate); int resultUpdateSanctionDraftWriting = consentManageDAO.updateSanctionDraftWriting(submitVO); int resultdeleteSanctionConsent = consentManageDAO.deleteSanctionConsent(submitVO.getDrftSn()); log.debug(this.getClass() + " resultUpdateSanctionDraftWriting : " + resultUpdateSanctionDraftWriting); log.debug(this.getClass() + " resultdeleteSanctionConsent : " + resultdeleteSanctionConsent); // ? Table? log.debug(this.getClass() + " submitVO.getSanctnRouteId() : " + submitVO.getSanctnRouteId()); StringTokenizer stRouteId = new StringTokenizer(submitVO.getSanctnRouteId(), "|"); int routeIdCnt = stRouteId.countTokens(); String receiver[] = new String[routeIdCnt]; for (int i = 0; stRouteId.hasMoreTokens(); i++) receiver[i] = stRouteId.nextToken(); StringTokenizer stRouteSeCode = new StringTokenizer(submitVO.getSanctnRouteSeCode(), "|"); int routeSeCodeCnt = stRouteSeCode.countTokens(); String aprvlGb[] = new String[routeSeCodeCnt]; for (int i = 0; stRouteSeCode.hasMoreTokens(); i++) aprvlGb[i] = stRouteSeCode.nextToken(); log.debug(this.getClass() + " routeIdCnt : " + routeIdCnt); boolean firstConfirm = false; for (int i = 0; i < routeIdCnt; i++) { EgovOe1SanctionConsentVO sanctionConsentVO = new EgovOe1SanctionConsentVO(); sanctionConsentVO.setDrftSn(submitVO.getDrftSn()); sanctionConsentVO.setConfmOrdr(i + 1); if (aprvlGb[i].equals("1")) { // sanctionConsentVO.setDrftDt(currentDate); // sanctionConsentVO.setConfmDt(currentDate); // ? sanctionConsentVO.setConfmOpinion(submitVO.getDrftOpinion()); sanctionConsentVO.setSanctnTrgtYn("N"); } else if (aprvlGb[i].equals("2")) { if (!firstConfirm) { firstConfirm = true; sanctionConsentVO.setDrftDt(currentDate); sanctionConsentVO.setSanctnTrgtYn("Y"); } else { sanctionConsentVO.setDrftDt(""); sanctionConsentVO.setSanctnTrgtYn("N"); } sanctionConsentVO.setConfmDt(""); sanctionConsentVO.setConfmOpinion(""); } else { sanctionConsentVO.setDrftDt(""); sanctionConsentVO.setConfmDt(""); sanctionConsentVO.setConfmOpinion(""); sanctionConsentVO.setSanctnTrgtYn("N"); } sanctionConsentVO.setConfmResultCode(""); sanctionConsentVO.setConfmer(receiver[i]); sanctionConsentVO.setConfmSeCode(aprvlGb[i]); sanctionConsentVO.setConfmComptYn("N"); sanctionConsentVO.setDeleteYn("N"); sanctionConsentVO.setAtchFileId(""); consentManageDAO.insertSanctionConsent(sanctionConsentVO); } // Callback Method try { /* * EgovConsentCallbackService * callbackService = * (EgovConsentCallbackService) * EgovObjectUtil * .instantiate(submitVO.getJobClass()); */ ApplicationContext ctx = getApplicationContext(); EgovOe1ConsentCallbackService callbackService = (EgovOe1ConsentCallbackService) ctx .getBean(submitVO.getJobClass()); callbackService.draftingConsent(submitVO); } catch (ClassNotFoundException e) { log.error(this.getClass() + " Callback - ? ? : " + e.toString()); } catch (Exception e) { log.info(this.getClass() + " Callback : " + e.toString()); } return String.valueOf(submitVO.getDrftSn()); }
From source file:ezbake.data.mongo.MongoDriverHandler.java
public ResultsWrapper aggregate_driver(String collection, EzAggregationRequest ezAggregationRequest, EzSecurityToken token) throws TException, EzMongoDriverException { collection = appName + "_" + collection; appLog.debug("aggregate_driver() from collection: {}", collection); // + ezFindRequest); TokenUtils.validateSecurityToken(token, handler.getConfigurationProperties()); ResultsWrapper rw = new ResultsWrapper(); try {/*from w w w . j a va 2s.co m*/ List<DBObject> pipeline = (List<DBObject>) new ObjectInputStream( new ByteArrayInputStream(ezAggregationRequest.getPipeline())).readObject(); for (DBObject p : pipeline) { Object o = p.get("$out"); if (o != null) { String dollarOut = appName + "_" + (String) o; appLog.debug("newDollarOut: {}", dollarOut); p.put("$out", dollarOut); break; } } AggregationOptions options = (AggregationOptions) new ObjectInputStream( new ByteArrayInputStream(ezAggregationRequest.getOptions())).readObject(); ReadPreference readPref = (ReadPreference) new ObjectInputStream( new ByteArrayInputStream(ezAggregationRequest.getReadPref())).readObject(); HashMap<String, String> auditParamsMap = new HashMap<>(); auditParamsMap.put("action", "aggregate_driver"); auditParamsMap.put("collectionName", collection); auditParamsMap.put("pipeline", handler.printMongoObject(pipeline)); auditParamsMap.put("options", handler.printMongoObject(options)); auditParamsMap.put("readPref", handler.printMongoObject(readPref)); handler.auditLog(token, AuditEventType.FileObjectAccess, auditParamsMap); List<DBObject> mutablePipelineList = new ArrayList<DBObject>(pipeline); // apply $redact if necessary for (int i = 0; i < mutablePipelineList.size();) { DBObject pipelineCommand = mutablePipelineList.get(i++); // if there is a $match operator (are any others needed to check?), add a $redact operator right after it. if (pipelineCommand.get("$match") != null) { DBObject redact = RedactHelper .createRedactOperator(handler.getMongoFindHelper().getSecurityExpressionViz(), token); mutablePipelineList.add(i, redact); } } Cursor cursor = handler.db.getCollection(collection).aggregate(mutablePipelineList, options, readPref); // NOTE: the "response" is not set in the QueryResultIterator since the "aggregate" method // in DBCollectionImpl.java does not use the QRI constructor that sets the "response". // The QRI constructor calls "initFromCursorDocument". appLog.debug("cursor: {}", cursor); List<DBObject> results = null; if (cursor instanceof QueryResultIterator) { int originalHashcode = cursor.hashCode(); ((QueryResultIterator) cursor).setOriginalHashCode(originalHashcode); handler.setResponseObjectWithCursor(rw, cursor); results = putIntoITmap((QueryResultIterator) cursor, originalHashcode); } else { handler.setResponseObjectWithCursor(rw, cursor); results = new ArrayList<DBObject>(); while (cursor.hasNext()) { DBObject o = cursor.next(); appLog.debug("DBObject: {}", o); results.add(o); } } rw.setResultSet(handler.addDBCursorResult(results).toByteArray()); } catch (ClassNotFoundException e) { appLog.error(e.toString()); EzMongoDriverException eme = new EzMongoDriverException(); eme.setEx(ser(e)); throw eme; } catch (IOException e) { appLog.error(e.toString()); EzMongoDriverException eme = new EzMongoDriverException(); eme.setEx(ser(e)); throw eme; } return rw; }
From source file:com.redhat.rhn.common.localization.LocalizationService.java
/** Add the keys from the specified class to the Service's Map. */ private void addKeysToMap(String className) { try {/*from www .j av a2s .c om*/ Class z = Class.forName(className); // All the keys must exist in the en_US XML files first. The other // languages may have subsets but no unique keys. If this is a // problem // refactoring will need to take place. Enumeration<String> e = XmlMessages.getInstance().getKeys(z, Locale.US); while (e.hasMoreElements()) { String key = e.nextElement(); keyToBundleMap.put(key, className); } } catch (ClassNotFoundException ce) { String message = "Class not found when trying to initalize " + "the LocalizationService: " + ce.toString(); log.error(message, ce); throw new LocalizationException(message, ce); } }
From source file:org.ireland.jnetty.dispatch.servlet.ServletConfigImpl.java
/** * Sets the servlet class. Servlet Class *//*from w w w .j av a 2 s . com*/ public void setServletClass(String servletClassName) { _servletClassName = servletClassName; ClassLoader loader = _webApp.getClassLoader(); try { _servletClass = (Class<? extends Servlet>) Class.forName(servletClassName, false, loader); } catch (ClassNotFoundException e) { log.debug(e.toString(), e); } }