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:com.grottworkshop.gwsviewmodellibrary.viewmodel.ViewModelHelper.java

@SuppressWarnings("unchecked")
public void onCreate(@NonNull Activity activity, @Nullable Bundle savedInstanceState,
        @NonNull Class<? extends AbstractViewModel<T>> viewModelClass) throws InstantiationException {
    if (savedInstanceState == null) {
        mScreenId = UUID.randomUUID().toString();
    } else {//  www  . jav a  2  s .com
        mScreenId = savedInstanceState.getString("identifier");
    }

    ViewModelProvider.ViewModelWrapper<T> viewModelWrapper = null;
    try {
        viewModelWrapper = getViewModelProvider(activity).getViewModelProvider().getViewModel(mScreenId,
                viewModelClass);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    mViewModel = (R) (viewModelWrapper != null ? viewModelWrapper.viewModel : null);
    assert viewModelWrapper != null;
    if (savedInstanceState != null && viewModelWrapper.wasCreated) {
        Log.e("model", "Application recreated by system - restoring viewmodel");
        mViewModel.restoreState(savedInstanceState);
    }
}

From source file:com.sire.errorhandling.ErrorMessage.java

public ErrorMessage(AppException ex) {
    try {// ww w .java  2 s .co m
        BeanUtils.copyProperties(this, ex);
    } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:edu.umass.cs.reconfiguration.reconfigurationprotocoltasks.ActiveReplicaProtocolTask.java

@SuppressWarnings("unchecked")
@Override/*from ww  w  .  j  a  v  a2  s . c o m*/
public GenericMessagingTask<NodeIDType, ?>[] handleEvent(
        ProtocolEvent<ReconfigurationPacket.PacketType, String> event,
        ProtocolTask<NodeIDType, ReconfigurationPacket.PacketType, String>[] ptasks) {

    ReconfigurationPacket.PacketType type = event.getType();
    Object returnValue = null;
    try {
        if (ReconfigurationPacket.getPacketTypeClass(type) != null)
            returnValue = this.activeReplica.getClass()
                    .getMethod(HANDLER_METHOD_PREFIX + ReconfigurationPacket.getPacketTypeClassName(type),
                            ReconfigurationPacket.getPacketTypeClass(type), ProtocolTask[].class)
                    .invoke(this.activeReplica, (BasicReconfigurationPacket<?>) event, ptasks);
        else
            assert (false);
    } catch (NoSuchMethodException nsme) {
        nsme.printStackTrace();
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    } catch (IllegalAccessException iae) {
        iae.printStackTrace();
    }
    return (GenericMessagingTask<NodeIDType, ?>[]) returnValue;
}

From source file:org.openhie.openempi.transformation.SubstringTransformationFunctionTest.java

public void testDateConversion() {
    String dateStr = "Wed Nov 13 00:00:00 EST 1901";
    Person person = new Person();
    person.setDateOfBirth(new java.util.Date());
    Object obj;//from w w w. j ava  2 s . c o m
    try {
        obj = PropertyUtils.getProperty(person, "dateOfBirth");
        log.debug("The date is: " + obj);
    } 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();
    }
}

From source file:com.square.core.model.util.FormatObjectHibernateListener.java

/**
 * Formate un objet.// w  ww  .  j  a  va2 s .co  m
 * @param objet l'objet  formater.
 */
private void udpateEntity(Object entity, EntityPersister persister, Object[] state) {
    if (classesConcernees.contains(entity.getClass())) {
        final String[] properties = persister.getPropertyNames();
        for (int i = 0; i < properties.length; i++) {
            if (!champsAExclure.contains(properties[i])) {
                if (state[i] instanceof String && state[i] != null) {
                    final String value = formaterChaine(state[i].toString()).toLowerCase();
                    state[i] = value;
                    try {
                        PropertyUtils.setSimpleProperty(entity, properties[i], value);
                    } catch (IllegalAccessException e) {
                        e.printStackTrace();
                    } catch (InvocationTargetException e) {
                        e.printStackTrace();
                    } catch (NoSuchMethodException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
}

From source file:com.huateng.ebank.business.management.operation.SaveWorklowParamEntryOperation.java

@Override
public void execute(OperationContext context) throws CommonException {
    if (log.isDebugEnabled()) {
        log.debug("enter into execute");
    }/*from www .j  a  va  2s . c om*/
    //        /** add by jornezhang 20100108 BMS-2362  ? begin */
    //        TxtNumRecordUtil.getInstance().resetGlobalDataAllBlank();
    //        /** add by jornezhang 20100108 BMS-2362  ? end */

    List delList = (List) context.getAttribute(IN_DEL);

    List insertList = (List) context.getAttribute(IN_INSERT);

    List updateList = (List) context.getAttribute(IN_UPDATE);

    //        String routeId =  (String) context.getAttribute(IN_ROUTEID);
    WorkFlowParamService workFlowParamService = WorkFlowParamService.getInstance();

    try {
        workFlowParamService.saveWorkflowParamEntry(delList, insertList, updateList);
    } catch (IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    //        context.setAttribute(OUT_PARAM_All_RESULT,result);

    if (log.isDebugEnabled()) {
        log.debug("Exit execute");
    }
}

From source file:de.weltraumschaf.maconha.server.model.Song.java

public Song(final SongEntity songById) {
    super();//from   www  . j  a va  2  s  .c om

    try {
        BeanUtils.copyProperties(this, songById);
    } catch (final IllegalAccessException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (final InvocationTargetException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:org.bdval.tools.ScanParameters.java

private void runOnce(final String[] values) {
    final StringWriter writer = new StringWriter();
    final PrintWriter pw = new PrintWriter(writer);
    pw.printf(arguments, (Object[]) values);
    pw.flush();/*from   w ww. ja  v  a2  s.  c  om*/

    final String args = writer.getBuffer().toString();
    System.err.println("Arguments: " + arguments);

    System.out.println("Args list separated");
    final List<String> runArgsList = new LinkedList<String>();
    for (final String s : args.split(" ")) {
        if (StringUtils.isNotBlank(s)) {
            runArgsList.add(s);
        }
    }
    final String[] runArguments = runArgsList.toArray(new String[runArgsList.size()]);

    try {

        final Class<?> discoverAndValidateClass = Class.forName(toolClassName);
        final WithProcessMethod instance = (WithProcessMethod) discoverAndValidateClass.newInstance();

        instance.process(runArguments);

    } catch (IllegalAccessException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    } catch (InstantiationException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    } catch (JSAPException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    } catch (ClassNotFoundException e) {
        e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    }
}

From source file:ubic.gemma.persistence.persister.RelationshipPersister.java

private Gene2GOAssociation persistGene2GOAssociation(Gene2GOAssociation association) {
    if (association == null)
        return null;
    if (!this.isTransient(association))
        return association;
    try {//w w w  .  j  av a 2s  .c o m
        FieldUtils.writeField(association, "gene", this.persistGene(association.getGene()), true);
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
    return gene2GoAssociationDao.create(association);
}

From source file:br.com.softgraf.model.command.CadastrarFornecedor.java

@Override
public String execute(HttpServletRequest request, HttpServletResponse response) {

    Fornecedor fornecedor = new Fornecedor();

    try {/*from w ww.j a  v  a  2  s  .com*/
        BeanUtils.populate(fornecedor, request.getParameterMap());

        System.out.println(fornecedor.toString());

        if (fornecedor.isValid()) {
            DAO<Fornecedor> fornecedorDao = new DAOImpl<Fornecedor>(Fornecedor.class,
                    (Session) request.getAttribute(HibernateUtil.HIBERNATE_SESSION));
            fornecedorDao.salvar(fornecedor);
            request.setAttribute("mensagem", "Fornecedor gravado com sucesso: " + fornecedor.getNome());
        } else {
            System.out.println("falta dados");
            request.setAttribute("mensagem", "Preencha os campos obrigatrios");
        }

    } catch (IllegalAccessException e) {
        request.setAttribute("mensagem", "Problemas com preenchimento do Bean");
        e.printStackTrace();

    } catch (InvocationTargetException e) {
        request.setAttribute("mensagem", "Problemas com preenchimento do Bean");
        e.printStackTrace();
    }

    return "cadastra_fornecedor.jsp";
}