Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HessianException is not converted to RemoteAccessConnection on HTTP 400 [SPR-5897] #10566

Closed
spring-projects-issues opened this issue Jul 5, 2009 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Fabian Dankof opened SPR-5897 and commented

HessianException (and subtypes) is not converted to a RemoteAccessConnection if the server responds
with an HTTP 400 error.

In this case, a HessianConnectionException is thrown. It is encapsulated in an InvocationTargetException
but because of missing code, HessianClientInterceptor doesn't handle it and just throws the target exception.

I'd suggest the following:

catch (InvocationTargetException ex) {
			if (ex.getTargetException() instanceof HessianRuntimeException) {
				HessianRuntimeException hre = (HessianRuntimeException) ex.getTargetException();
				Throwable rootCause = (hre.getRootCause() != null ? hre.getRootCause() : hre);
				throw convertHessianAccessException(rootCause);
			}
			else if (ex.getTargetException() instanceof UndeclaredThrowableException) {
				UndeclaredThrowableException utex = (UndeclaredThrowableException) ex.getTargetException();
				throw convertHessianAccessException(utex.getUndeclaredThrowable());
			} else if (ex.getTargetException() instanceof HessianException) {
                                HessianException hex = (HessianRuntimeException) ex.getTargetException();                                
                                // handle / convert HessianException here !!!!!                                
                        }
			throw ex.getTargetException();
		}

Affects: 2.5.6

Referenced from: commits 64bf3b7

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thanks for pointing this out. I've revised HessianClientInterceptor's catch blocks accordingly, now specifically detecting HessianConnectionException.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 RC1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants