You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Arseni Bulatski (JIRA)" <ji...@apache.org> on 2019/06/07 12:08:00 UTC
[jira] [Issue Comment Deleted] (CAY-2573) DI field injection is
triggered when creating sql Driver
[ https://issues.apache.org/jira/browse/CAY-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Arseni Bulatski updated CAY-2573:
---------------------------------
Comment: was deleted
(was: *4.1* https://github.com/apache/cayenne/commit/91992935b9de28f9b5739b0b763b90520675c77e)
> DI field injection is triggered when creating sql Driver
> --------------------------------------------------------
>
> Key: CAY-2573
> URL: https://issues.apache.org/jira/browse/CAY-2573
> Project: Cayenne
> Issue Type: Bug
> Components: Database integration
> Affects Versions: 4.0.1, 4.1.B1
> Reporter: Nikita Timofeev
> Priority: Major
> Fix For: 4.0.2, 4.1.B3, 4.2.M1
>
>
> Some of {{DataSourceFactory}} implementations (namely {{DriverDataSourceFactory}}, {{PropertyDataSourceFactory}} and {{XMLPoolingDataSourceFactory}}) use {{AdhocObjectFactory}} to create {{Driver}} instance. This have one nasty side effect: DI field injection is used in a process and it can lead to errors.
> This is an exception that is thrown by SAP HANA driver in that case:
> {code:java}
> java.lang.NoClassDefFoundError: Ljava/lang/ref/Cleaner;
> at java.lang.Class.getDeclaredFields0(Native Method)
> at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
> at java.lang.Class.getDeclaredFields(Class.java:1916)
> at org.apache.cayenne.di.spi.FieldInjectingProvider.injectMembers(FieldInjectingProvider.java:55)
> at org.apache.cayenne.di.spi.FieldInjectingProvider.get(FieldInjectingProvider.java:44)
> at org.apache.cayenne.di.spi.DefaultAdhocObjectFactory.newInstance(DefaultAdhocObjectFactory.java:70)
> {code}
> I believe we should use only {{getJavaClass()}} method of {{AdhocObjectFactory}}. As a more distant solution we can check usage of {{DriverManager}} instead of detecting and using {{Driver}} explicitly.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)