List of usage examples for java.lang ClassNotFoundException printStackTrace
public void printStackTrace()
From source file:com.zergiu.tvman.shows.ShowsProviderFactoryBean.java
private ShowProvider getProvider(BeanDefinition beanDefinition) { try {/*w ww . j a v a 2 s .c o m*/ Class<?> providerClass = Class.forName(beanDefinition.getBeanClassName()); log.debug("found show provider " + providerClass); return (ShowProvider) providerClass.newInstance(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return null; }
From source file:com.example.imageZoom.ActivityPlugin.java
public void startActivity(String className, String ImageURL) { try {// www . j a v a 2 s .co m Intent intent = new Intent().setClass(this.cordova.getActivity(), Class.forName(className)); intent.putExtra("imageURL", ImageURL); LOG.d(TAG, "Starting activity %s", className); this.cordova.getActivity().startActivity(intent); } catch (ClassNotFoundException e) { e.printStackTrace(); LOG.e(TAG, "Error starting activity %s", className); } }
From source file:nz.co.senanque.madura.bundle.BundledSpringFactoryBean.java
public void setInterface(String class1) { m_interfaceName = class1; try {//from ww w . j av a 2s. com m_class = Class.forName(class1); } catch (ClassNotFoundException e) { e.printStackTrace(); throw new RuntimeException(e); } }
From source file:edu.umass.cs.gigapaxos.PaxosConfig.java
private static Class<?> getClassSuppressExceptions(String className) { Class<?> clazz = null;/*from w w w . j a v a2 s . co m*/ try { if (className != null && !"null".equals(className)) { clazz = Class.forName(className); } } catch (ClassNotFoundException e) { e.printStackTrace(); } return clazz; }
From source file:ch.epfl.leb.sass.ijplugin.IJPluginModel.java
/** * Loads a model from a file.//from w w w . j a v a 2 s . c o m * * @param fileIn The input stream from the file. */ public static IJPluginModel read(FileInputStream fileIn) { IJPluginModel model = null; try { ObjectInputStream in = new ObjectInputStream(fileIn); model = (IJPluginModel) in.readObject(); in.close(); fileIn.close(); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException c) { c.printStackTrace(); } return model; }
From source file:org.beangle.ems.security.restrict.service.IdentifierDataResolver.java
@SuppressWarnings("unchecked") public <T> List<T> unmarshal(RestrictField field, String text) { if (null == field.getType()) { return (List<T>) CollectUtils.newArrayList(StringUtils.split(text, ",")); } else {/*from w w w . j a v a2s. c o m*/ Class<?> clazz = null; try { clazz = Class.forName(field.getType()); } catch (ClassNotFoundException e) { e.printStackTrace(); throw new RuntimeException(e); } EntityType myType = Model.getEntityType(clazz); OqlBuilder<T> builder = OqlBuilder.from(myType.getEntityName(), "restrictField"); String[] ids = StringUtils.split(text, ","); PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(clazz, field.getKeyName()); Class<?> propertyType = pd.getReadMethod().getReturnType(); List<Object> realIds = CollectUtils.newArrayList(ids.length); for (String id : ids) { Object realId = ConvertUtils.convert(id, propertyType); realIds.add(realId); } builder.where("restrictField." + field.getKeyName() + " in (:ids)", realIds).cacheable(); return entityDao.search(builder); } }
From source file:org.focusns.common.web.widget.mvc.method.WidgetModelAttributeMethodProcessor.java
@Override protected void validateIfApplicable(WebDataBinder binder, MethodParameter parameter) { ///*from w ww .ja va 2 s .c om*/ WebRequest webRequest = webRequestLocal.get(); String groupsStr = webRequest.getParameter("groups"); if (StringUtils.hasText(groupsStr)) { List<Object> hintList = new ArrayList<Object>(); String[] groups = StringUtils.commaDelimitedListToStringArray(groupsStr); for (String group : groups) { try { hintList.add(ClassUtils.forName(group, getClass().getClassLoader())); } catch (ClassNotFoundException e) { e.printStackTrace(); } } // hintList.add(Default.class); // Annotation[] annotations = parameter.getParameterAnnotations(); for (Annotation annot : annotations) { if (annot.annotationType().getSimpleName().startsWith("Valid")) { Object hints = hintList.toArray(new Object[hintList.size()]); binder.validate(hints instanceof Object[] ? (Object[]) hints : new Object[] { hints }); } } } }
From source file:com.seajas.search.utilities.remoting.JsonInvokerRequestExecutor.java
@Override protected RemoteInvocationResult readRemoteInvocationResult(InputStream is, String codebaseUrl) throws IOException { JsonParser parser = factory.createJsonParser(is); parser.setCodec(codec);//from w w w. j a v a 2 s .c o m System.err.println(parser.nextToken()); System.err.println(parser.nextToken()); if (!"type".equals(parser.getCurrentName())) throw new StreamCorruptedException("Expected type field instead of " + parser.getCurrentName()); System.err.println(parser.nextToken()); Class<?> type = null; try { type = Class.forName(parser.getText()); } catch (ClassNotFoundException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } System.err.println(parser.nextToken()); if (!"content".equals(parser.getCurrentName())) throw new StreamCorruptedException("Expected content field instead of " + parser.getCurrentName()); System.err.println(parser.nextToken()); Object content = parser.readValueAs(type); if (content instanceof Throwable) return new RemoteInvocationResult((Throwable) content); return new RemoteInvocationResult(content); }
From source file:com.seajas.search.utilities.remoting.JsonInvokerServiceExporter.java
@Override protected RemoteInvocation readRemoteInvocation(HttpExchange exchange, InputStream is) throws IOException { JsonParser parser = factory.createJsonParser(is); parser.setCodec(codec);/*from w w w. j ava2 s . co m*/ System.err.println(parser.nextToken()); openField("method", parser); String method = parser.getText(); List<Class<?>> types = new ArrayList<Class<?>>(); for (JsonToken next = openField("types", parser); next != JsonToken.END_ARRAY; next = parser.nextToken()) { try { types.add(Class.forName(parser.getText())); } catch (ClassNotFoundException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } } List<Object> arguments = new ArrayList<Object>(); openField("arguments", parser); for (Class<?> type : types) { parser.nextToken(); arguments.add(parser.readValueAs(type)); } return new RemoteInvocation(method, types.toArray(new Class[types.size()]), arguments.toArray()); }
From source file:com.ezoapp.cordova.gcm.GCMIntentService.java
private void sendNotification(Bundle msg) { mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); String mainClassName = this.getPackageManager().getLaunchIntentForPackage(this.getPackageName()) .getComponent().getClassName(); try {//from w w w . j av a 2 s . c o m Intent intent = new Intent(this, Class.forName(mainClassName)); intent.putExtra(Constants.EXTRA_GCM_DATA, msg); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(this.getApplicationInfo().icon) .setContentTitle(msg.getString(Constants.EXTRA_TITLE)) .setStyle(new NotificationCompat.BigTextStyle().bigText(msg.getString(Constants.EXTRA_MESSAGE))) .setContentText(msg.getString(Constants.EXTRA_MESSAGE)).setAutoCancel(true); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); } catch (ClassNotFoundException e) { e.printStackTrace(); } }