Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- //some code here for service call
- }catch(SocketTimeoutException e)
- {
- //not able to come here even though cause of the PrivilegedActionException is SocketTimeoutException
- }
- catch(Exception e)
- {
- //directly coming here OF COURSE
- }
- java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
- com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
- try{
- }catch(PrivilegedActionException e){
- Throwable tmp = e;
- while(tmp != null){
- if(tmp instanceof SocketTimeoutException){
- SocketTimeoutException cause = (SocketTimeoutException) tmp;
- //Do what you need to do here.
- break;
- }
- tmp = tmp.getCause();
- }
- }
- catch(Exception e){
- if(e instanceof PrivilegedActionException){
- //while loop here
- }
- }
Add Comment
Please, Sign In to add comment