cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (Commented) (JIRA)" <>
Subject [jira] [Commented] (CAY-1655) Logger injection to JdbcAdapter subclass does not work
Date Wed, 08 Feb 2012 17:44:59 GMT


Andrus Adamchik commented on CAY-1655:

Hi! Our preliminary tests show that injection into superclass works just fine.. So a question.
Custom adapter is created indirectly via MyCustomDbAdapterFactory. Is it possible to post
the contents of MyCustomDbAdapterFactory to see how it is implemented? This is probably the
key to the problem.

> Logger injection to JdbcAdapter subclass does not work
> ------------------------------------------------------
>                 Key: CAY-1655
>                 URL:
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1M3
>         Environment: Windows 7, MS Access, JdbcOdbc driver
>            Reporter: Wernke zur Borg
> I created a custom subclass of JdbcAdapter for some special handling with MS Access.
It is instantiated by a custom DbAdapterFactory subclass, which is configured as:
> 		Module m = new Module() {
> 			public void configure(Binder binder) {
> 				binder.bind(DbAdapterFactory.class).to(MyCustomDbAdapterFactory.class);
> 			}
> 		};
> Now the application runs into a NullPointerException in org.apache.cayenne.access.jdbc.SelectAction.performAction()
where it says:
> adapter.getJdbcEventLogger()...  (line 171)
> This means that the injection of the JdbcEventLogger "logger" in my superclass JdbcAdapter
has not taken place. It might be important that also SelectAction has been subclassed with
a custom SelectAction.
> The problem does not occur when I comment the binder.bind(...) line out.
> Workaround: Instantiate a CommonsJdbcEventLogger in the custom JdbcAdapter and assign
it to the logger (it is protected). But this logger is not aware of the log4j log level. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message