Example usage for java.lang IllegalAccessException printStackTrace

List of usage examples for java.lang IllegalAccessException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:us.mn.state.health.lims.reports.action.implementation.RetroCIPatientAssociatedReport.java

private void setProperty(String key, String value) {
    try {//from   www .  j a v a  2  s . c  om
        PropertyUtils.setProperty(dynaForm, key, value);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:com.persistent.cloudninja.utils.ProvisionConnectionUtility.java

public Connection getConnection(String url, String db_name, String db_user, String db_user_pwd) {
    Connection connection = null;
    int index = url.indexOf("=");
    String connUrl = url.substring(0, index + 1) + db_name + ";";
    try {/*from   w ww . ja  v  a2  s  .co m*/
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
        connection = DriverManager.getConnection(connUrl, db_user, db_user_pwd);
    } catch (InstantiationException instantiationException) {
        instantiationException.printStackTrace();
    } catch (IllegalAccessException illegalAccessException) {
        illegalAccessException.printStackTrace();
    } catch (ClassNotFoundException classNotFoundException) {
        classNotFoundException.printStackTrace();
    } catch (SQLException sqlException) {
        sqlException.printStackTrace();
    }
    return connection;
}

From source file:us.mn.state.health.lims.reports.action.implementation.HaitiIndicatorReport.java

public void setRequestParameters(BaseActionForm dynaForm) {
    try {//from  ww w . j a v  a 2 s  . co m
        PropertyUtils.setProperty(dynaForm, "reportName", getNameForReportRequest());

        PropertyUtils.setProperty(dynaForm, "useLowerDateRange", Boolean.TRUE);
        PropertyUtils.setProperty(dynaForm, "useUpperDateRange", Boolean.TRUE);

        PropertyUtils.setProperty(dynaForm, "exportOptions", getExportOptions());
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:us.mn.state.health.lims.reports.action.implementation.RetroCIPatientAssociatedReport.java

@Override
public void setRequestParameters(BaseActionForm dynaForm) {
    try {/*from ww  w . j a  v a  2  s.  c o m*/
        PropertyUtils.setProperty(dynaForm, "reportName",
                StringUtil.getMessageForKey("patient.report.associated.name"));
        PropertyUtils.setProperty(dynaForm, "usePatientNumberDirect", Boolean.TRUE);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        e.printStackTrace();
    }
}

From source file:org.cartoweb.stats.BaseStats.java

protected void printUsage(String message) {
    try {//  w w  w . ja va  2s  . c o  m
        System.out.println(message);
        System.out.println();
        System.out.println("Usage:");
        System.out.println("  " + getClass().getName() + " " + GetOptions.getShortList(this));
        System.out.println();
        System.out.println("Options:");
        System.out.println(GetOptions.getLongList(this));
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    System.exit(-1);
}

From source file:org.lainsoft.forge.flow.nav.GenericCommandFactory.java

/**
 * Retrives a <code>Command</code> based on an stimulus, that is 
 * the cannonical class name of a command in the form of:<br>
 * <code>/some/package/ClassName</code>.
 * @param stimulus the stimulus to be load as a command.
 * @param helper The ViewHelper to be used by the command.
 *//*from  w  w w.  ja  v a 2s  .com*/
public Command getCommand(String stimulus, ViewHelper helper) {
    if (stimulus == null || stimulus.trim().equals("") || stimulus.trim().equals("/")) {
        return new CommandNotFoundCommand();
    }

    try {
        stimulus = stimulus.replaceAll("/", ".");
        log.debug("Loading>" + stimulus);

        if (internalCache.containsKey(stimulus)) {
            return (Command) ((Class) internalCache.get(stimulus)).newInstance();
        }

        Class tempCommand = null;
        internalCache.put(stimulus, (tempCommand = Class.forName(stimulus)));
        return (Command) tempCommand.newInstance();
    } catch (ClassNotFoundException cnfe) {
        if (cnfc == null)
            cnfc = new CommandNotFoundCommand();
        return cnfc;
    } catch (InstantiationException ie) {
        ie.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}

From source file:org.apache.tomcat.util.IntrospectionUtils.java

public static Object getProperty(Object o, String name) {
    String getter = "get" + capitalize(name);
    String isGetter = "is" + capitalize(name);

    try {//from   w w  w.  java 2 s.  co  m
        Method methods[] = findMethods(o.getClass());
        Method getPropertyMethod = null;

        // First, the ideal case - a getFoo() method
        for (int i = 0; i < methods.length; i++) {
            Class paramT[] = methods[i].getParameterTypes();
            if (getter.equals(methods[i].getName()) && paramT.length == 0) {
                return methods[i].invoke(o, (Object[]) null);
            }
            if (isGetter.equals(methods[i].getName()) && paramT.length == 0) {
                return methods[i].invoke(o, (Object[]) null);
            }

            if ("getProperty".equals(methods[i].getName())) {
                getPropertyMethod = methods[i];
            }
        }

        // Ok, no setXXX found, try a getProperty("name")
        if (getPropertyMethod != null) {
            Object params[] = new Object[1];
            params[0] = name;
            return getPropertyMethod.invoke(o, params);
        }

    } catch (IllegalArgumentException ex2) {
        log.warn("IAE " + o + " " + name, ex2);
    } catch (SecurityException ex1) {
        if (dbg > 0)
            d("SecurityException for " + o.getClass() + " " + name + ")");
        if (dbg > 1)
            ex1.printStackTrace();
    } catch (IllegalAccessException iae) {
        if (dbg > 0)
            d("IllegalAccessException for " + o.getClass() + " " + name + ")");
        if (dbg > 1)
            iae.printStackTrace();
    } catch (InvocationTargetException ie) {
        if (dbg > 0)
            d("InvocationTargetException for " + o.getClass() + " " + name + ")");
        if (dbg > 1)
            ie.printStackTrace();
    }
    return null;
}

From source file:org.fs.ghanaian.json.JsonObjectCallback.java

/**
 *
 * @param data/*from   ww  w. j  av a 2  s.  c o m*/
 * @return
 */
public T marshall(JSONObject data) {
    try {
        Method method = clazz.getMethod("fromJsonObject", JSONObject.class);
        return (T) method.invoke(null, data);
    } catch (NoSuchMethodException ne) {
        ne.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    }
    return null;
}

From source file:org.fs.ghanaian.json.JsonObjectCallback.java

/***
 *
 * @param data/*from  w w  w  . j a  va2  s. co  m*/
 * @return
 */
public T marshall(JSONArray data) {
    try {
        Method method = clazz.getMethod("fromJsonArray", JSONArray.class);
        return (T) method.invoke(null, data);
    } catch (NoSuchMethodException ne) {
        ne.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    }
    return null;
}

From source file:com.puppycrawl.tools.checkstyle.checks.xpath.AttributeAxisIterator.java

/**
 * Constructs a <code>AttributeAxisIterator</code> for a
 * DetailAST element.//from  ww  w.ja v  a  2s . c o  m
 * @param aAST the DetailAST element
 */
public AttributeAxisIterator(DetailAST aAST) {
    Map props = new HashMap();
    //use BeanUtils to get the properties
    try {
        props = BeanUtils.describe(aAST);
    } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (NoSuchMethodException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    // add attributes for the properties to a list and
    // set the iterator to an iterator over that list.
    final List attributes = new ArrayList(props.size());
    final Set values = props.keySet();
    for (Iterator iter = values.iterator(); iter.hasNext();) {
        final String name = (String) iter.next();
        final String value = (String) props.get(name);
        attributes.add(new Attribute(aAST, name, value));
    }
    mIter = attributes.iterator();
}