org.eclipse.persistence.internal.helper.Helper.printStackTraceToString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(14.0k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中org.eclipse.persistence.internal.helper.Helper.printStackTraceToString()方法的一些代码示例,展示了Helper.printStackTraceToString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.printStackTraceToString()方法的具体详情如下:
包路径:org.eclipse.persistence.internal.helper.Helper
类名称:Helper
方法名:printStackTraceToString

Helper.printStackTraceToString介绍

[英]Return a String containing the printed stacktrace of an exception.
[中]返回包含异常的打印堆栈跟踪的字符串。

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.sdo

  1. LOGGER.fine("Failed to retrieve application name in runtime " + appRuntimes[i].toString() + ":\n" + Helper.printStackTraceToString(ex));
  2. LOGGER.warning("Failed to add notification listener for application " + applicationName + ":\n" + Helper.printStackTraceToString(x));

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. public static CommunicationException errorInInvocation(Exception exception) {
  2. Object[] args = { Helper.printStackTraceToString(exception) };
  3. CommunicationException communicationException = new CommunicationException(ExceptionMessageGenerator.buildMessage(CommunicationException.class, ERROR_IN_INVOCATION, args), exception);
  4. communicationException.setErrorCode(ERROR_IN_INVOCATION);
  5. return communicationException;
  6. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. public static CommunicationException errorInInvocation(Exception exception) {
  2. Object[] args = { Helper.printStackTraceToString(exception) };
  3. CommunicationException communicationException = new CommunicationException(ExceptionMessageGenerator.buildMessage(CommunicationException.class, ERROR_IN_INVOCATION, args), exception);
  4. communicationException.setErrorCode(ERROR_IN_INVOCATION);
  5. return communicationException;
  6. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(Command command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logWarning("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(byte[] command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logDebug("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }
  21. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(Command command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logWarning("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(Command command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logDebug("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. public static CommunicationException errorInInvocation(Exception exception) {
  2. Object[] args = { Helper.printStackTraceToString(exception) };
  3. CommunicationException communicationException = new CommunicationException(ExceptionMessageGenerator.buildMessage(CommunicationException.class, ERROR_IN_INVOCATION, args), exception);
  4. communicationException.setErrorCode(ERROR_IN_INVOCATION);
  5. return communicationException;
  6. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(Command command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logDebug("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }
  21. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(Command command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logDebug("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(byte[] command) throws RemoteException {
  9. try {
  10. this.rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. this.rcm.logWarning("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }
  21. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(byte[] command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logDebug("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }
  21. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(Command command) throws RemoteException {
  9. try {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. rcm.logWarning("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }
  21. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. /**
  2. * INTERNAL:
  3. * Helper method that processes a byte[] command. This method is called bye the CORBA implementation class
  4. * that implements the method byte[] executeCommand(byte[] command)
  5. *
  6. */
  7. public static byte[] processCommand(byte[] command, RemoteCommandManager aRCM) {
  8. try {
  9. // deserialize byte [] to Command object
  10. Command deserializedCmd = (Command)SerializationHelper.deserialize(command);
  11. aRCM.processCommandFromRemoteConnection(deserializedCmd);
  12. } catch (Exception e) {
  13. // Log the problem encountered during deserialization or rcm processing command
  14. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  15. aRCM.logWarning("error_executing_remote_command", args);
  16. // Return the byte[] of exception String in case the exception doesn't exist on the other side
  17. return e.toString().getBytes();
  18. }
  19. // Success - return null
  20. return null;
  21. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * No support currently exists for returning the result of the command execution.
  4. * Currently only null is returned on success. On failure an error string is
  5. * returned (to avoid returning an object/exception that may not exist on the
  6. * sending side).
  7. */
  8. public Object executeCommand(byte[] command) throws RemoteException {
  9. try {
  10. this.rcm.processCommandFromRemoteConnection(command);
  11. } catch (Exception e) {
  12. // Log the problem
  13. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  14. this.rcm.logWarning("error_executing_remote_command", args);
  15. // Return the string in case the exception doesn't exist on the other side
  16. return e.toString();
  17. }
  18. // Success - return null
  19. return null;
  20. }
  21. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * Helper method that processes a byte[] command. This method is called bye the CORBA implementation class
  4. * that implements the method byte[] executeCommand(byte[] command)
  5. *
  6. */
  7. public static byte[] processCommand(byte[] command, RemoteCommandManager rcm) {
  8. try {
  9. if (rcm.getSerializer() != null) {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } else {
  12. // deserialize byte [] to Command object
  13. Command deserializedCmd = (Command)SerializationHelper.deserialize(command);
  14. rcm.processCommandFromRemoteConnection(deserializedCmd);
  15. }
  16. } catch (Exception e) {
  17. // Log the problem encountered during deserialization or rcm processing command
  18. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  19. rcm.logWarning("error_executing_remote_command", args);
  20. // Return the byte[] of exception String in case the exception doesn't exist on the other side
  21. return e.toString().getBytes();
  22. }
  23. // Success - return null
  24. return null;
  25. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * Helper method that processes a byte[] command. This method is called bye the CORBA implementation class
  4. * that implements the method byte[] executeCommand(byte[] command)
  5. *
  6. */
  7. public static byte[] processCommand(byte[] command, RemoteCommandManager rcm) {
  8. try {
  9. if (rcm.getSerializer() != null) {
  10. rcm.processCommandFromRemoteConnection(command);
  11. } else {
  12. // deserialize byte [] to Command object
  13. Command deserializedCmd = (Command)SerializationHelper.deserialize(command);
  14. rcm.processCommandFromRemoteConnection(deserializedCmd);
  15. }
  16. } catch (Exception e) {
  17. // Log the problem encountered during deserialization or rcm processing command
  18. Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
  19. rcm.logWarning("error_executing_remote_command", args);
  20. // Return the byte[] of exception String in case the exception doesn't exist on the other side
  21. return e.toString().getBytes();
  22. }
  23. // Success - return null
  24. return null;
  25. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. /**
  2. * PUBLIC:
  3. * <p>
  4. * Log a SessionLogEntry
  5. * </p><p>
  6. *
  7. * @param entry SessionLogEntry that holds all the information for a TopLink logging event
  8. * </p>
  9. */
  10. public void log(SessionLogEntry entry) {
  11. if (!shouldLog(entry.getLevel())) {
  12. return;
  13. }
  14. String message = getSupplementDetailString(entry);
  15. if (entry.hasException()) {
  16. if (entry.getLevel() == SEVERE) {
  17. message += Helper.printStackTraceToString(entry.getException());
  18. } else if (entry.getLevel() <= WARNING) {
  19. if (shouldLogExceptionStackTrace()) {
  20. message += Helper.printStackTraceToString(entry.getException());
  21. } else {
  22. message += entry.getException();
  23. }
  24. }
  25. } else {
  26. message += formatMessage(entry);
  27. }
  28. basicLog(entry.getLevel(), message);
  29. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * PUBLIC:
  3. * <p>
  4. * Log a SessionLogEntry
  5. * </p><p>
  6. *
  7. * @param entry SessionLogEntry that holds all the information for a TopLink logging event
  8. * </p>
  9. */
  10. public void log(SessionLogEntry entry) {
  11. if (!shouldLog(entry.getLevel())) {
  12. return;
  13. }
  14. String message = getSupplementDetailString(entry);
  15. if (entry.hasException()) {
  16. if (entry.getLevel() == SEVERE) {
  17. message += Helper.printStackTraceToString(entry.getException());
  18. } else if (entry.getLevel() <= WARNING) {
  19. if (shouldLogExceptionStackTrace()) {
  20. message += Helper.printStackTraceToString(entry.getException());
  21. } else {
  22. message += entry.getException();
  23. }
  24. }
  25. } else {
  26. message += formatMessage(entry);
  27. }
  28. basicLog(entry.getLevel(), entry.getNameSpace(), message);
  29. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * PUBLIC:
  3. * <p>
  4. * Log a SessionLogEntry
  5. * </p><p>
  6. *
  7. * @param entry SessionLogEntry that holds all the information for a TopLink logging event
  8. * </p>
  9. */
  10. public void log(SessionLogEntry entry) {
  11. if (!shouldLog(entry.getLevel())) {
  12. return;
  13. }
  14. String message = getSupplementDetailString(entry);
  15. if (entry.hasException()) {
  16. if (entry.getLevel() == SEVERE) {
  17. message += Helper.printStackTraceToString(entry.getException());
  18. } else if (entry.getLevel() <= WARNING) {
  19. if (shouldLogExceptionStackTrace()) {
  20. message += Helper.printStackTraceToString(entry.getException());
  21. } else {
  22. message += entry.getException();
  23. }
  24. }
  25. } else {
  26. message += formatMessage(entry);
  27. }
  28. basicLog(entry.getLevel(), entry.getNameSpace(), message);
  29. }

相关文章

Helper类方法