本文整理了Java中org.eclipse.persistence.internal.helper.Helper.printStackTraceToString()
方法的一些代码示例,展示了Helper.printStackTraceToString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.printStackTraceToString()
方法的具体详情如下:
包路径:org.eclipse.persistence.internal.helper.Helper
类名称:Helper
方法名:printStackTraceToString
[英]Return a String containing the printed stacktrace of an exception.
[中]返回包含异常的打印堆栈跟踪的字符串。
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.sdo
LOGGER.fine("Failed to retrieve application name in runtime " + appRuntimes[i].toString() + ":\n" + Helper.printStackTraceToString(ex));
LOGGER.warning("Failed to add notification listener for application " + applicationName + ":\n" + Helper.printStackTraceToString(x));
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
public static CommunicationException errorInInvocation(Exception exception) {
Object[] args = { Helper.printStackTraceToString(exception) };
CommunicationException communicationException = new CommunicationException(ExceptionMessageGenerator.buildMessage(CommunicationException.class, ERROR_IN_INVOCATION, args), exception);
communicationException.setErrorCode(ERROR_IN_INVOCATION);
return communicationException;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
public static CommunicationException errorInInvocation(Exception exception) {
Object[] args = { Helper.printStackTraceToString(exception) };
CommunicationException communicationException = new CommunicationException(ExceptionMessageGenerator.buildMessage(CommunicationException.class, ERROR_IN_INVOCATION, args), exception);
communicationException.setErrorCode(ERROR_IN_INVOCATION);
return communicationException;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(Command command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logWarning("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(byte[] command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logDebug("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(Command command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logWarning("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(Command command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logDebug("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public static CommunicationException errorInInvocation(Exception exception) {
Object[] args = { Helper.printStackTraceToString(exception) };
CommunicationException communicationException = new CommunicationException(ExceptionMessageGenerator.buildMessage(CommunicationException.class, ERROR_IN_INVOCATION, args), exception);
communicationException.setErrorCode(ERROR_IN_INVOCATION);
return communicationException;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(Command command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logDebug("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(Command command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logDebug("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(byte[] command) throws RemoteException {
try {
this.rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
this.rcm.logWarning("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(byte[] command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logDebug("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(Command command) throws RemoteException {
try {
rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logWarning("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Helper method that processes a byte[] command. This method is called bye the CORBA implementation class
* that implements the method byte[] executeCommand(byte[] command)
*
*/
public static byte[] processCommand(byte[] command, RemoteCommandManager aRCM) {
try {
// deserialize byte [] to Command object
Command deserializedCmd = (Command)SerializationHelper.deserialize(command);
aRCM.processCommandFromRemoteConnection(deserializedCmd);
} catch (Exception e) {
// Log the problem encountered during deserialization or rcm processing command
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
aRCM.logWarning("error_executing_remote_command", args);
// Return the byte[] of exception String in case the exception doesn't exist on the other side
return e.toString().getBytes();
}
// Success - return null
return null;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* No support currently exists for returning the result of the command execution.
* Currently only null is returned on success. On failure an error string is
* returned (to avoid returning an object/exception that may not exist on the
* sending side).
*/
public Object executeCommand(byte[] command) throws RemoteException {
try {
this.rcm.processCommandFromRemoteConnection(command);
} catch (Exception e) {
// Log the problem
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
this.rcm.logWarning("error_executing_remote_command", args);
// Return the string in case the exception doesn't exist on the other side
return e.toString();
}
// Success - return null
return null;
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Helper method that processes a byte[] command. This method is called bye the CORBA implementation class
* that implements the method byte[] executeCommand(byte[] command)
*
*/
public static byte[] processCommand(byte[] command, RemoteCommandManager rcm) {
try {
if (rcm.getSerializer() != null) {
rcm.processCommandFromRemoteConnection(command);
} else {
// deserialize byte [] to Command object
Command deserializedCmd = (Command)SerializationHelper.deserialize(command);
rcm.processCommandFromRemoteConnection(deserializedCmd);
}
} catch (Exception e) {
// Log the problem encountered during deserialization or rcm processing command
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logWarning("error_executing_remote_command", args);
// Return the byte[] of exception String in case the exception doesn't exist on the other side
return e.toString().getBytes();
}
// Success - return null
return null;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Helper method that processes a byte[] command. This method is called bye the CORBA implementation class
* that implements the method byte[] executeCommand(byte[] command)
*
*/
public static byte[] processCommand(byte[] command, RemoteCommandManager rcm) {
try {
if (rcm.getSerializer() != null) {
rcm.processCommandFromRemoteConnection(command);
} else {
// deserialize byte [] to Command object
Command deserializedCmd = (Command)SerializationHelper.deserialize(command);
rcm.processCommandFromRemoteConnection(deserializedCmd);
}
} catch (Exception e) {
// Log the problem encountered during deserialization or rcm processing command
Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
rcm.logWarning("error_executing_remote_command", args);
// Return the byte[] of exception String in case the exception doesn't exist on the other side
return e.toString().getBytes();
}
// Success - return null
return null;
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* PUBLIC:
* <p>
* Log a SessionLogEntry
* </p><p>
*
* @param entry SessionLogEntry that holds all the information for a TopLink logging event
* </p>
*/
public void log(SessionLogEntry entry) {
if (!shouldLog(entry.getLevel())) {
return;
}
String message = getSupplementDetailString(entry);
if (entry.hasException()) {
if (entry.getLevel() == SEVERE) {
message += Helper.printStackTraceToString(entry.getException());
} else if (entry.getLevel() <= WARNING) {
if (shouldLogExceptionStackTrace()) {
message += Helper.printStackTraceToString(entry.getException());
} else {
message += entry.getException();
}
}
} else {
message += formatMessage(entry);
}
basicLog(entry.getLevel(), message);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* PUBLIC:
* <p>
* Log a SessionLogEntry
* </p><p>
*
* @param entry SessionLogEntry that holds all the information for a TopLink logging event
* </p>
*/
public void log(SessionLogEntry entry) {
if (!shouldLog(entry.getLevel())) {
return;
}
String message = getSupplementDetailString(entry);
if (entry.hasException()) {
if (entry.getLevel() == SEVERE) {
message += Helper.printStackTraceToString(entry.getException());
} else if (entry.getLevel() <= WARNING) {
if (shouldLogExceptionStackTrace()) {
message += Helper.printStackTraceToString(entry.getException());
} else {
message += entry.getException();
}
}
} else {
message += formatMessage(entry);
}
basicLog(entry.getLevel(), entry.getNameSpace(), message);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* PUBLIC:
* <p>
* Log a SessionLogEntry
* </p><p>
*
* @param entry SessionLogEntry that holds all the information for a TopLink logging event
* </p>
*/
public void log(SessionLogEntry entry) {
if (!shouldLog(entry.getLevel())) {
return;
}
String message = getSupplementDetailString(entry);
if (entry.hasException()) {
if (entry.getLevel() == SEVERE) {
message += Helper.printStackTraceToString(entry.getException());
} else if (entry.getLevel() <= WARNING) {
if (shouldLogExceptionStackTrace()) {
message += Helper.printStackTraceToString(entry.getException());
} else {
message += entry.getException();
}
}
} else {
message += formatMessage(entry);
}
basicLog(entry.getLevel(), entry.getNameSpace(), message);
}
内容来源于网络,如有侵权,请联系作者删除!