public BonitaException(String message, Throwable cause) { super(message + " cause:" + Misc.LINE_SEPARATOR + cause.getMessage() + Misc.LINE_SEPARATOR + Misc.getStackTraceFrom(cause)); }
public BonitaException(String message, Throwable cause) { super(message + "cause:" + cause.getMessage() + Misc.LINE_SEPARATOR + Misc.getStackTraceFrom(cause)); }
public BonitaException(String message, Throwable cause) { super(message + " cause:" + Misc.LINE_SEPARATOR + cause.getMessage() + Misc.LINE_SEPARATOR + Misc.getStackTraceFrom(cause)); }
@Override public void writeTo(final byte[] t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { try { entityStream.write(t); } catch (final IOException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while serializing the object: " + Misc.getStackTraceFrom(e)); } } }
@Override public void writeTo(final byte[] t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { try { entityStream.write(t); } catch (final IOException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while serializing the object: " + Misc.getStackTraceFrom(e)); } } }
@Override public void run() { try { if (environmentFactory != null) { environmentFactory.close(); environmentFactory = null; } } catch (final Exception ee) { LOG.severe(Misc.getStackTraceFrom(ee)); } } }
@Override public void writeTo(final BusinessArchive t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { try { entityStream.write(Misc.serialize(t)); } catch (final ClassNotFoundException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while serializing the object: " + Misc.getStackTraceFrom(e)); } } catch (final IOException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while serializing the object: " + Misc.getStackTraceFrom(e)); } } }
@Override public void writeTo(final BusinessArchive t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { try { entityStream.write(Misc.serialize(t)); } catch (final ClassNotFoundException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while serializing the object: " + Misc.getStackTraceFrom(e)); } } catch (final IOException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while serializing the object: " + Misc.getStackTraceFrom(e)); } } }
@Override public void writeTo(final Object t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { final XStream xstream = XStreamUtil.getDefaultXstream(); try { xstream.toXML(t, entityStream); } catch (final Exception e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while writing in the OutputStream: " + Misc.getStackTraceFrom(e)); } } }
@Override public void writeTo(final Object t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException { final XStream xstream = XStreamUtil.getDefaultXstream(); try { xstream.toXML(t, entityStream); } catch (final Exception e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while writing in the OutputStream: " + Misc.getStackTraceFrom(e)); } } }
@Override public void run() { try { if (environmentFactories != null) { for (EnvironmentFactory environmentFactory : environmentFactories.values()) { if (environmentFactory != null) { environmentFactory.close(); } } environmentFactories.clear(); } } catch (final Exception ee) { LOG.severe(Misc.getStackTraceFrom(ee)); } } }
private String getContent(final InputStream entityStream) throws IOException { BufferedReader reader = null; final StringBuilder builder = new StringBuilder(); try { reader = new BufferedReader(new InputStreamReader(entityStream, "UTF-8")); String line = reader.readLine(); while (line != null) { builder.append(line).append("\n"); line = reader.readLine(); } } catch (final Exception e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while reading the InputStream: " + Misc.getStackTraceFrom(e)); } } finally { if (reader != null) { reader.close(); } } final String result = builder.toString(); return result.trim(); }
private String getContent(final InputStream entityStream) throws IOException { BufferedReader reader = null; final StringBuilder builder = new StringBuilder(); try { reader = new BufferedReader(new InputStreamReader(entityStream, "UTF-8")); String line = reader.readLine(); while (line != null) { builder.append(line).append("\n"); line = reader.readLine(); } } catch (final Exception e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while reading the InputStream: " + Misc.getStackTraceFrom(e)); } } finally { if (reader != null) { reader.close(); } } final String result = builder.toString(); return result.trim(); }
@Override public void run() { try { eventExecutor.getCommandService().execute(cmd); } catch (final Throwable e) { LOG.severe("Exception in event block: " + Misc.getStackTraceFrom(e)); } }
@Override public void event(final Object source, final String eventName, final Object info) { if (WireContext.EVENT_CLOSE.equals(eventName)) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("closing hibernate session factory"); } try { sessionFactory.close(); } catch (final HibernateException e) { if ("could not destruct listeners".equals(e.getMessage())) { LOG.severe("Unable to destruct listener: " + Misc.getStackTraceFrom(e)); } else { throw e; } } } } }
@Override public BusinessArchive readFrom(final Class<BusinessArchive> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException { final ByteArrayOutputStream out = new ByteArrayOutputStream(); Serializable serializable = null; try { readFromInputStream(entityStream, out); serializable = Misc.deserialize(out.toByteArray()); } catch (final ClassNotFoundException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while reading the InputStream: " + Misc.getStackTraceFrom(e)); } } catch (final IOException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while reading the InputStream: " + Misc.getStackTraceFrom(e)); } } finally { out.close(); } BusinessArchive businessArchive = null; if (serializable instanceof BusinessArchive) { businessArchive = (BusinessArchive) serializable; } return businessArchive; }
sb.append(e.getMessage()); sb.append(Misc.LINE_SEPARATOR); sb.append(Misc.getStackTraceFrom(e)); Misc.LOG.warning(sb.toString()); return e;
@Override public BusinessArchive readFrom(final Class<BusinessArchive> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException { final ByteArrayOutputStream out = new ByteArrayOutputStream(); Serializable serializable = null; try { readFromInputStream(entityStream, out); serializable = Misc.deserialize(out.toByteArray()); } catch (final ClassNotFoundException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while reading the InputStream: " + Misc.getStackTraceFrom(e)); } } catch (final IOException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while reading the InputStream: " + Misc.getStackTraceFrom(e)); } } finally { out.close(); } BusinessArchive businessArchive = null; if (serializable instanceof BusinessArchive) { businessArchive = (BusinessArchive) serializable; } return businessArchive; }
} catch (final Exception e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error while decoding " + content + ": " + Misc.getStackTraceFrom(e));
private void preprocessInputParametersDependingOnMethodName(final Object[] args, final Method m) { // get current ClassLoader final ClassLoader baseClassLoader = Thread.currentThread().getContextClassLoader(); try { final ClassLoader localClassLoader = null; if (isSetVariableMethod(args, m)) { processSetVariableMethods(args); } else if (isExecuteMethod(m, args)) { processExecuteMethod(args, localClassLoader); } else if (isInstantiateProcessMethod(m, args)) { processInstantiateProcessMethod(args); } else if (isGetModifiedObjectMethod(m, args)) { processGetModifiedObjectMethod(args); } } catch (final Exception e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.severe("Error on RESTServerInterceptor: " + Misc.getStackTraceFrom(e)); } } finally { Thread.currentThread().setContextClassLoader(baseClassLoader); } }