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

Spring 5.x DataSource proxying does not work with Oracle UCP on JDK 9+ [SPR-17003] #21541

Closed
spring-projects-issues opened this issue Jul 4, 2018 · 5 comments
Assignees
Labels
in: data type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 4, 2018

David J. M. Karlsen opened SPR-17003 and commented

See discussion and referenced-stacktrace at SO.

An AOP clash appears due to similar signatures in:

 


Affects: 5.0.7

Reference URL: https://stackoverflow.com/questions/50946614/using-spring-with-java-9-and-oracle-ucp

Issue Links:

  • #21264 AspectJ execution pointcut does not detect methods in superinterface anymore
  • #21298 AopUtils.getMostSpecificMethod should expose dynamic proxy class methods
  • #21343 AspectJ annotation pointcuts fail to evaluate against interface-based proxies

Referenced from: commits bccff73, e21db26

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2018

Juergen Hoeller commented

Which kind of proxying is attempted here? In other words, what does the DataSource setup look like specifically?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2018

David J. M. Karlsen commented

For my case (it is another user at stack-overflow) it is:


@Bean
public PoolDataSource dataSource() throws SQLException, UniversalConnectionPoolException {
 shutdown(); //needed after 12.0.2 - bug or feature - nevertheless...

 PoolDataSource poolDataSource = PoolDataSourceFactory.getPoolDataSource();
 poolDataSource.setConnectionPoolName("JFRPOOL");
 poolDataSource.setConnectionFactoryClassName(OracleDataSource.class.getName());
 poolDataSource.setMinPoolSize(minPoolSize);
 poolDataSource.setMaxPoolSize(maxPoolSize);
 poolDataSource.setInitialPoolSize(initialPoolSize);
 poolDataSource.setValidateConnectionOnBorrow(validateConnectionOnBorrow);
 poolDataSource.setMaxConnectionReuseTime(maxConnectionReuseTimeSec);
 poolDataSource.setInactiveConnectionTimeout(inactiveConnectionTimeoutSec);
 poolDataSource.setAbandonedConnectionTimeout(abandonedConnectionTimeout);
 poolDataSource.setTimeToLiveConnectionTimeout(timeToLiveConnectionTimeout);
 poolDataSource.setConnectionWaitTimeout(connectionWaitTimeout);
 poolDataSource.setONSConfiguration(ONSConfiguration);
 poolDataSource.setFastConnectionFailoverEnabled(fastConnectionFailoverEnabled);
 poolDataSource.setMaxStatements(maxStatements);

 poolDataSource.setURL(URL);
 poolDataSource.setUser(user);
 poolDataSource.setPassword(password);
 poolDataSource.setLoginTimeout(loginTimeout);

 Properties properties = new Properties();
 properties.put(OracleConnection.CONNECTION_PROPERTY_THIN_READ_TIMEOUT, readTimeoutMillis.toString());
 properties.put("DMSStatementMetrics", Boolean.TRUE.toString());
 properties.put("oracle.jdbc.DMSStatementMetrics", Boolean.TRUE.toString());
 poolDataSource.setConnectionProperties(properties);

 return poolDataSource;
}

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 4, 2018

Juergen Hoeller commented

And some AOP advice is trying to build an interface-based proxy for that PoolDataSource, I assume? Since that's the only known source of such signature conflicts in interfaces...

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 5, 2018

David J. M. Karlsen commented

It gets triggered if I @EnableHystrix from https://cloud.spring.io/spring-cloud-netflix/single/spring-cloud-netflix.html - but I can imagine any aspect/AOP will trigger this.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 22, 2018

Juergen Hoeller commented

This turns out to be a side effect of #21264 where we're trying to combine interfaces for AspectJ pointcut matching. We ignore any such failures now, proceeding with the original target method (as we did before). This is ready for release in 5.1 RC1 and 5.0.8 this week; feel free to give it an early try against the upcoming 5.1.0.BUILD-SNAPSHOT / 5.0.8.BUILD-SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data type: bug
Projects
None yet
Development

No branches or pull requests

2 participants