You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.IllegalArgumentException: repeated interface: java.sql.Connection
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:597)
at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
at java.lang.reflect.WeakCache.get(WeakCache.java:127)
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
at org.jdbcdslog.ProxyUtils.proxyForCompatibleInterfaces(ProxyUtils.java:46)
at org.jdbcdslog.ProxyUtils.wrapByConnectionProxy(ProxyUtils.java:84)
at org.jdbcdslog.DataSourceProxyBase.getConnection(DataSourceProxyBase.java:48)
...
This happens because HikariDataSource provides HikariProxyConnection (implements Connection) object that inherits ProxyConnection (implements Connection).
Proposed fix for method org.jdbcdslog.ProxyUtils.findCompatibleInterfaces(Class, Class) is
/**
* Find all interfaces of clazz that is-a requiredInterface.
*
* @param clazz
* @param requiredInterface
* @return
*/
public static Class<?>[] findCompatibleInterfaces(Class<?> clazz, Class<?> requiredInterface) {
IdentityHashMap<Class<?>, Object> interfaces = new IdentityHashMap<Class<?>, Object>();
//ArrayList<Class<?>> interfaces = new ArrayList<Class<?>>();
for ( ; ! clazz.equals(Object.class) ; clazz = clazz.getSuperclass()) {
for (Class<?> iface : clazz.getInterfaces()) {
if (requiredInterface.isAssignableFrom(iface)) {
//interfaces.add(iface);
interfaces.put(iface, null);
}
}
}
//return interfaces.toArray(EMPTY_CLASS_ARRAY);
return interfaces.keySet().toArray(EMPTY_CLASS_ARRAY);
}
The text was updated successfully, but these errors were encountered:
This happens because HikariDataSource provides HikariProxyConnection (implements Connection) object that inherits ProxyConnection (implements Connection).
Proposed fix for method org.jdbcdslog.ProxyUtils.findCompatibleInterfaces(Class, Class) is
The text was updated successfully, but these errors were encountered: