List of usage examples for java.lang IllegalAccessException getMessage
public String getMessage()
From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemView.java
public final boolean isCaseSensitive() { try {/*from ww w. jav a 2s. com*/ return ExtendedFieldUtils.readTypedField(caseInsensitiveField, this, Boolean.class).booleanValue(); } catch (IllegalAccessException e) { throw new IllegalStateException( "Failed (" + e.getClass().getSimpleName() + ") to read currDir: " + e.getMessage(), e); } }
From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemView.java
public final String getUsername() { try {//from w w w. j a va 2 s . c o m return ExtendedFieldUtils.readTypedField(userNameField, this, String.class); } catch (IllegalAccessException e) { throw new IllegalStateException( "Failed (" + e.getClass().getSimpleName() + ") to read userName: " + e.getMessage(), e); } }
From source file:org.apache.sshd.common.file.nativefs.ExtendedNativeFileSystemView.java
public ExtendedNativeFileSystemView(String userName, String rootDir, boolean caseInsensitive) { super(userName, caseInsensitive); try {/*from ww w . j a v a2 s . c om*/ FieldUtils.writeField(currDirField, this, Validate.notEmpty(rootDir, "No root dir specified", ArrayUtils.EMPTY_OBJECT_ARRAY)); } catch (IllegalAccessException e) { throw new IllegalStateException( "Failed (" + e.getClass().getSimpleName() + ") to override currDir: " + e.getMessage(), e); } }
From source file:org.neuro4j.workflow.FlowContext.java
public Object get(String key) { if (key == null) { return null; }//from w w w . ja va2s . com key = key.trim(); if (key.startsWith(SWFConstants.QUOTES_SYMBOL) && key.endsWith(SWFConstants.QUOTES_SYMBOL) && key.length() > 1) { return key.substring(1, key.length() - 1); } if (key.contains(".")) { int pointIndex = key.indexOf("."); String firstObj = key.substring(0, pointIndex); Object obj = parameters.get(firstObj); if (obj != null) { String utilKey = key.substring(pointIndex + 1); try { obj = PropertyUtils.getProperty(obj, utilKey); return obj; } catch (IllegalAccessException e) { Logger.error(this, e.getMessage(), e); } catch (InvocationTargetException e) { Logger.error(this, e.getMessage(), e); } catch (NoSuchMethodException e) { Logger.error(this, e.getMessage(), e); } } else { return null; } } return parameters.get(key); }
From source file:org.jboss.aerogear.cordova.oauth2.OauthGoogleServicesIntentHelper.java
private void getToken(final String accountName) { Runnable runnable = new Runnable() { public void run() { String token;// w w w .ja va2 s . c o m try { Log.i(TAG, "Retrieving token for: " + accountName); Log.i(TAG, "with scope(s): " + scopes); token = (String) METHOD_getToken.invoke(null, cordova.getActivity(), accountName, scopes); callbackContext.success(token); } catch (InvocationTargetException ite) { Throwable userRecoverableException = ite.getCause(); if (CLASS_UserRecoverableAuthException != null && CLASS_UserRecoverableAuthException.isInstance(userRecoverableException)) { try { Intent intent = (Intent) METHOD_getIntent.invoke(userRecoverableException); Log.e(TAG, "UserRecoverableAuthException: Attempting recovery..."); cordova.getActivity().startActivityForResult(intent, REQUEST_AUTHORIZATION); } catch (IllegalAccessException e) { Log.i(TAG, "error" + e.getMessage()); callbackContext.error("plugin failed to get token: " + e.getMessage()); } catch (InvocationTargetException e) { Log.i(TAG, "error" + e.getCause().getMessage()); callbackContext.error("plugin failed to get token: " + e.getCause().getMessage()); } } } catch (Exception e) { Log.i(TAG, "error" + e.getMessage()); callbackContext.error("plugin failed to get token: " + e.getMessage()); } } }; cordova.getThreadPool().execute(runnable); }
From source file:com.acbelter.directionalcarousel.CarouselPagerAdapter.java
@Override public Fragment getItem(int position) { if (mConfig.infinite) { position = position % mPagesCount; }/*w w w .j a va 2 s . c o m*/ try { PageFragment pf = (PageFragment) mPageFragmentClass.newInstance(); pf.setArguments(PageFragment.createArgs(mPageLayoutId, mItems.get(position))); return pf; } catch (IllegalAccessException e) { Log.w(TAG, e.getMessage()); } catch (InstantiationException e) { Log.w(TAG, e.getMessage()); } return null; }
From source file:com.tridion.storage.si4t.JPASearchDAOFactory.java
public void configureBundle(Configuration storageDAOBundleConfiguration) throws ConfigurationException { // first set the right value for the private field called // 'applicationContext'. try {//from w w w .jav a 2s. c o m setPrivateField(this, "applicationContext", APPLICATION_CONTEXT, log); } catch (IllegalAccessException e) { log.error(e.getMessage()); } // configure the bundle like we normally do super.configureBundle(storageDAOBundleConfiguration); }
From source file:org.mycontroller.standalone.api.jaxrs.MyControllerHandler.java
@GET @Path("/imageFiles") public Response getImageFile(@QueryParam("fileName") String fileName) throws IOException { try {//from w w w . j ava 2s. com if (fileName != null) { return RestUtils.getResponse(Status.OK, McServerFileUtils.getImageFile(fileName)); } else { return RestUtils.getResponse(Status.OK, McServerFileUtils.getImageFilesList()); } } catch (IllegalAccessException ex) { return RestUtils.getResponse(Status.FORBIDDEN, new ApiError(ex.getMessage())); } catch (Exception ex) { return RestUtils.getResponse(Status.BAD_REQUEST, new ApiError(ex.getMessage())); } }
From source file:fr.paris.lutece.plugins.workflowcore.web.task.TaskComponent.java
/** * {@inheritDoc}/*from www . ja va 2 s. c o m*/ */ @Override public String doSaveConfig(HttpServletRequest request, Locale locale, ITask task) { // In case there are no errors, then the config is created/updated boolean bCreate = false; ITaskConfig config = _taskConfigService.findByPrimaryKey(task.getId()); if (config == null) { config = _taskFactory.newTaskConfig(_taskType.getKey()); if (config != null) { config.setIdTask(task.getId()); bCreate = true; } } if (config != null) { try { BeanUtils.populate(config, request.getParameterMap()); String strApply = request.getParameter(PARAMETER_APPLY); // Check if the AdminUser clicked on "Apply" or on "Save" if (StringUtils.isEmpty(strApply)) { String strJspError = this.validateConfig(config, request); if (StringUtils.isNotBlank(strJspError)) { return strJspError; } } if (bCreate) { _taskConfigService.create(config); } else { _taskConfigService.update(config); } } catch (IllegalAccessException e) { _logger.error(e.getMessage(), e); } catch (InvocationTargetException e) { _logger.error(e.getMessage(), e); } } else { _logger.error("TaskComponent - could not instanciate a new TaskConfig for type " + _taskType.getKey()); } return null; }
From source file:org.vosao.business.impl.mq.MessageQueueImpl.java
@Override public void execute(Message message) { if (subscribers.containsKey(message.getTopic())) { for (Class subscriberClass : subscribers.get(message.getTopic())) { try { Subscriber subscriber = (Subscriber) subscriberClass.newInstance(); subscriber.onMessage(message); } catch (IllegalAccessException e) { logger.error(e.getMessage()); } catch (InstantiationException e) { logger.error(e.getMessage()); }//from w w w .j a v a 2s .co m } } if (!StringUtils.isEmpty(message.getCommandClassName())) { try { Class clazz = loadClass(message.getCommandClassName()); if (clazz != null) { Subscriber subscriber = (Subscriber) clazz.newInstance(); subscriber.onMessage(message); } else { logger.error("Command class not found: " + message.getCommandClassName()); } } catch (IllegalAccessException e) { logger.error(e.getMessage()); } catch (InstantiationException e) { logger.error(e.getMessage()); } } }