Example usage for java.lang NoSuchMethodException printStackTrace

List of usage examples for java.lang NoSuchMethodException printStackTrace

Introduction

In this page you can find the example usage for java.lang NoSuchMethodException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.photovault.swingui.color.PhotoInfoViewAdapter.java

public void setField(PhotoInfoFields field, Object newValue) {
    String propertyName = field.getName();
    try {//from  w w w.  jav  a  2  s .  c o  m
        PropertyUtils.setProperty(this, propertyName, newValue);
    } catch (NoSuchMethodException ex) {
        log.error("Cannot set property " + propertyName);
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        log.error(ex.getMessage());
    } catch (InvocationTargetException ex) {
        log.error(ex.getMessage());
    }
}

From source file:org.photovault.swingui.color.PhotoInfoViewAdapter.java

public void setFieldMultivalued(PhotoInfoFields field, boolean isMultivalued) {
    String propertyName = field.getName() + "Multivalued";
    try {/*from  ww  w .jav  a2s  . c om*/
        PropertyUtils.setProperty(this, propertyName, isMultivalued);
    } catch (NoSuchMethodException ex) {
        log.error("Cannot set property " + propertyName);
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        log.error(ex.getMessage());
    } catch (InvocationTargetException ex) {
        log.error(ex.getMessage());
    }
}

From source file:org.photovault.swingui.color.PhotoInfoViewAdapter.java

public Object getField(PhotoInfoFields field) {
    Object value = null;//w  w  w  . j  av a  2s  . co  m
    String propertyName = field.getName();
    try {
        value = PropertyUtils.getProperty(this, propertyName);
    } catch (NoSuchMethodException ex) {
        log.error("Cannot get property " + propertyName);
        ex.printStackTrace();
    } catch (IllegalAccessException ex) {
        log.error(ex.getMessage());
    } catch (InvocationTargetException ex) {
        log.error(ex.getMessage());
    }
    return value;
}

From source file:com.phonegap.plugin.mobileaccessibility.MobileAccessibility.java

/**
 * Called when the activity will start interacting with the user.
 *
 * @param multitasking        Flag indicating if multitasking is turned on for app
 *///  w ww  . j a  v  a  2 s  .c  o  m
@Override
public void onResume(boolean multitasking) {
    //Log.i("MobileAccessibility", "onResume");
    if (mIsScreenReaderRunning && !mCachedIsScreenReaderRunning) {
        //Log.i("MobileAccessibility", "Reloading page on reload because the Accessibility State has changed.");
        mCachedIsScreenReaderRunning = mIsScreenReaderRunning;
        stop();
        cordova.getActivity().runOnUiThread(new Runnable() {
            public void run() {
                WebView view;
                try {
                    view = (WebView) webView;
                    view.reload();
                } catch (ClassCastException ce) { // cordova-android 4.0+
                    try { // cordova-android 4.0+
                        Method getView = webView.getClass().getMethod("getView");
                        view = (WebView) getView.invoke(webView);
                        view.reload();
                    } catch (NoSuchMethodException e) {
                        e.printStackTrace();
                    } catch (InvocationTargetException e) {
                        e.printStackTrace();
                    } catch (IllegalAccessException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
    }
}

From source file:com.cottsoft.thrift.framework.server.ThriftMultiBinaryServerFactory.java

/**
 * ?Processor// w ww . j  av a2 s. co m
 * @return
 * @throws ThriftException
 */
public TProcessor getProcessor() throws ThriftException {
    try {
        TMultiplexedProcessor processor = new TMultiplexedProcessor();

        Set<Class<?>> thriftServiceImplClassList = ScanPackageHander
                .getPackageAllClasses(baseServiceImplPackage, true);

        for (Class<?> thriftServiceImplClass : thriftServiceImplClassList) {
            if (thriftServiceImplClass.isAnnotationPresent(ThriftService.class)) {
                ThriftService thriftServiceAnnotation = (ThriftService) thriftServiceImplClass
                        .getAnnotation(ThriftService.class);
                String thriftServiceName = thriftServiceAnnotation.service();

                Constructor<?> constructor = Class.forName(thriftServiceName + "$Processor")
                        .getConstructor(Class.forName(thriftServiceName + "$Iface"));

                Object service = SpringApplicationContext
                        .getBean(getServiceImplBeanName(thriftServiceImplClass));

                processor.registerProcessor(thriftServiceName, (TProcessor) constructor.newInstance(service));

                if (logger.isDebugEnabled()) {
                    logger.debug(">>> Thrift Service implements class: " + thriftServiceImplClass.getName());
                }
            }
        }
        return processor;
    } catch (NoSuchMethodException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (SecurityException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (ClassNotFoundException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (InstantiationException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (IllegalAccessException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (IllegalArgumentException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (InvocationTargetException e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    } catch (Exception e) {
        if (logger.isInfoEnabled()) {
            e.printStackTrace();
        }
        throw new ThriftException(e);
    }
}

From source file:uk.ac.bbsrc.tgac.miso.core.data.AbstractProject.java

public void setSamples(Collection<Sample> samples) {
    this.samples = samples;
    try {//from ww w  . j  av a2s .  com
        Collections.sort(Arrays.asList(this.samples), new AliasComparator(Sample.class));
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:uk.ac.bbsrc.tgac.miso.core.data.AbstractProject.java

public void setRuns(Collection<Run> runs) {
    this.runs = runs;
    try {/* ww  w.  j  a  v a 2s . c o m*/
        Collections.sort(Arrays.asList(this.runs), new AliasComparator(Run.class));
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:uk.ac.bbsrc.tgac.miso.core.data.AbstractProject.java

public void addSample(Sample sample) {
    this.samples.add(sample);
    try {//from  www.  ja  va2 s .  com
        Collections.sort(Arrays.asList(this.samples), new AliasComparator(Sample.class));
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:uk.ac.bbsrc.tgac.miso.core.data.AbstractProject.java

public void setStudies(Collection<Study> studies) {
    this.studies = studies;
    try {//from w ww. j  a  va 2s .c om
        Collections.sort(Arrays.asList(this.studies), new AliasComparator(Study.class));
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:org.openengsb.core.services.internal.RequestHandlerImpl.java

/**
 * TODO: OPENENGSB-1976/*from  w  w w  .  j  a  v a  2 s. c  o m*/
 *
 * This is a workaround for the mess with Aries JPA proxies.
 */
private Class<?> retrieveRealServiceClass(Object service) {
    Class<?> serviceClass = service.getClass();
    Method realTypeMethod = null;
    try {
        realTypeMethod = serviceClass.getMethod("getRealUnproxiedType");
    } catch (NoSuchMethodException e) {
        // no problem this method does not have to exist
    }
    if (realTypeMethod != null) {
        try {
            serviceClass = (Class<?>) realTypeMethod.invoke(service);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return serviceClass;
}