Return-Path: X-Original-To: apmail-cayenne-commits-archive@www.apache.org Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E8A69FCF for ; Wed, 8 Feb 2012 17:45:23 +0000 (UTC) Received: (qmail 17414 invoked by uid 500); 8 Feb 2012 17:45:23 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 17378 invoked by uid 500); 8 Feb 2012 17:45:22 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 17369 invoked by uid 99); 8 Feb 2012 17:45:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2012 17:45:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2012 17:45:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 641611AAF2B for ; Wed, 8 Feb 2012 17:44:59 +0000 (UTC) Date: Wed, 8 Feb 2012 17:44:59 +0000 (UTC) From: "Andrus Adamchik (Commented) (JIRA)" To: commits@cayenne.apache.org Message-ID: <846495776.15523.1328723099411.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1255746101.71762.1327413400874.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CAY-1655) Logger injection to JdbcAdapter subclass does not work MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAY-1655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13203766#comment-13203766 ] 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: https://issues.apache.org/jira/browse/CAY-1655 > 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira