|
1 | 1 | /* |
2 | | - * Copyright 2005-2013 the original author or authors. |
| 2 | + * Copyright 2005-2024 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
15 | 15 | */ |
16 | 16 | package org.springframework.ldap.core.support; |
17 | 17 |
|
18 | | -import org.springframework.ldap.UncategorizedLdapException; |
19 | | -import org.springframework.ldap.core.DirContextProxy; |
20 | | -import org.springframework.ldap.support.LdapUtils; |
| 18 | +import java.io.IOException; |
| 19 | +import java.lang.reflect.InvocationHandler; |
| 20 | +import java.lang.reflect.InvocationTargetException; |
| 21 | +import java.lang.reflect.Method; |
| 22 | +import java.lang.reflect.Proxy; |
| 23 | +import java.util.Hashtable; |
21 | 24 |
|
22 | 25 | import javax.naming.NamingException; |
23 | 26 | import javax.naming.directory.DirContext; |
|
26 | 29 | import javax.naming.ldap.StartTlsResponse; |
27 | 30 | import javax.net.ssl.HostnameVerifier; |
28 | 31 | import javax.net.ssl.SSLSocketFactory; |
29 | | -import java.io.IOException; |
30 | | -import java.lang.reflect.InvocationHandler; |
31 | | -import java.lang.reflect.Method; |
32 | | -import java.lang.reflect.Proxy; |
33 | | -import java.util.Hashtable; |
| 32 | + |
| 33 | +import org.springframework.ldap.UncategorizedLdapException; |
| 34 | +import org.springframework.ldap.core.DirContextProxy; |
| 35 | +import org.springframework.ldap.support.LdapUtils; |
34 | 36 |
|
35 | 37 | /** |
36 | 38 | * Abstract superclass for {@link DirContextAuthenticationStrategy} |
@@ -199,7 +201,11 @@ else if (method.getName().equals(GET_TARGET_CONTEXT_METHOD_NAME)) { |
199 | 201 | return target; |
200 | 202 | } |
201 | 203 | else { |
202 | | - return method.invoke(target, args); |
| 204 | + try { |
| 205 | + return method.invoke(target, args); |
| 206 | + } catch (InvocationTargetException ex) { |
| 207 | + throw ex.getTargetException(); |
| 208 | + } |
203 | 209 | } |
204 | 210 | } |
205 | 211 | } |
|
0 commit comments