Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
ODE-928: e.printStackTrace()s removed, backport from 1.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
vanto committed Jun 9, 2015
1 parent 8e25a06 commit 8538f00
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 13 deletions.
Expand Up @@ -170,7 +170,7 @@ protected void generateWSDL(String serviceName, String fileName) throws AxisFaul
try {
fos = new FileOutputStream(fileName);
} catch (FileNotFoundException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
configContext.getAxisConfiguration().getService(serviceName).printWSDL(fos);
}
Expand Down
Expand Up @@ -43,7 +43,7 @@
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.AxisEngine;
import org.apache.axis2.receivers.AbstractMessageReceiver;
import org.apache.axis2.util.Utils;
import org.apache.axis2.util.MessageContextBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.axis2.hooks.ODEAxisService;
Expand Down Expand Up @@ -123,7 +123,7 @@ public DynamicMessageReceiver(T service) {

public void invokeBusinessLogic(MessageContext messageContext) throws AxisFault {
DynamicService<T> service = new DynamicService<T>(_service);
MessageContext outMsgContext = Utils.createOutMessageContext(messageContext);
MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(messageContext);
outMsgContext.getOperationContext().addMessageContext(outMsgContext);
SOAPFactory soapFactory = getSOAPFactory(messageContext);
SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
Expand Down
Expand Up @@ -54,7 +54,7 @@ public TransactionManager getTransactionManager() {
Context ctx = new InitialContext(env);
tm = (TransactionManager) ctx.lookup("javax.transaction.TransactionManager");
} catch (NamingException e) {
e.printStackTrace();
throw new RuntimeException( "Error while looking up TransactionManager", e);
}

return tm;
Expand Down
Expand Up @@ -185,7 +185,7 @@ public Map toMap() {
try {
serviceNS = _eprElmt.getOwnerDocument().lookupNamespaceURI(prefix);
} catch (Exception e) {
e.printStackTrace();
__log.error(e.getMessage(), e);
}
// Lookup failed, checking directly on our element
if (serviceNS == null) {
Expand Down
Expand Up @@ -183,7 +183,7 @@ public void load() throws IOException {
try {
fis.close();
} catch (Exception ex) {
ex.printStackTrace();
__log.error(ex.getMessage(), ex);
}
}
} else {
Expand Down
Expand Up @@ -240,7 +240,7 @@ private static String dateFilter(String filter) {
try {
dt = ISO8601DateParser.parse(date);
} catch (ParseException e) {
e.printStackTrace();
__log.error(e.getMessage(), e);
}
Timestamp ts = new Timestamp(dt.getTime());
return op + " '" + ts.toString() + "'";
Expand Down
Expand Up @@ -148,7 +148,7 @@ private static String dateFilter(String filter) {
try {
dt = ISO8601DateParser.parse(date);
} catch (ParseException e) {
e.printStackTrace();
__log.error(e.getMessage(), e);
}
Timestamp ts = new Timestamp(dt.getTime());
return op + " '" + ts.toString() + "'";
Expand Down
Expand Up @@ -117,7 +117,7 @@ private List<TActivityInfo> getFailedActivities(TInstanceInfo instance) {
collectFailedActivities(scopeInfo, failedActivites);
}
} catch (Exception e) {
e.printStackTrace();
__log.error(e.getMessage(), e);
}
return failedActivites;
}
Expand All @@ -131,7 +131,7 @@ private TScopeInfo getScopeInfo(TScopeRef scopeRef) {
return scopeInfoDoc.getScopeInfo();
}
} catch (Exception e) {
e.printStackTrace();
__log.error(e.getMessage(), e);
}
}
return null;
Expand Down
2 changes: 0 additions & 2 deletions jca-ra/src/main/java/org/apache/ode/ra/OdeConnectionImpl.java
Expand Up @@ -100,10 +100,8 @@ public Object invoke(Object proxy, Method method, Object[] args)
String methodSig = Reflect.generateMethodSignature(method);
return mc().getTransport().invokeConnectionMethod(methodSig, args);
} catch (RuntimeException pe) {
pe.printStackTrace();
throw new OdeConnectionException("Unexpected RuntimeException", pe);
} catch (RemoteException re) {
re.printStackTrace();
throw new OdeConnectionException("Unexpected RemoteException.", re);
} catch (InvocationTargetException ite) {
throw ite.getTargetException();
Expand Down
Expand Up @@ -104,7 +104,7 @@ public static void main(String[] args) {
// This is really quite unexpected, so we should
// print the stack trace to stderr.
consoleErr(t.getMessage());
t.printStackTrace();
__log.error(t.getMessage(), t);
System.exit(-2);
}
System.exit(0);
Expand Down

0 comments on commit 8538f00

Please sign in to comment.