Bug 48034 - Configurator does not cater for inner classes ie, containing a $ in the name)
Summary: Configurator does not cater for inner classes ie, containing a $ in the name)
Status: RESOLVED DUPLICATE of bug 41487
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Configurator (show other bugs)
Version: 1.2
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-21 04:31 UTC by Ramon Casha
Modified: 2009-10-23 17:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ramon Casha 2009-10-21 04:31:13 UTC
In several of my projects I maintain a single class called DB which is full of static inner classes to interact with different tables in the database. These each have a Logger and the logger name ends up as "my.project.DB$MyTable". However the log4j.xml configuration file does not allow this name to be used. Also, specifying "my.project.DB" as the logger name is not inherited by the inner classes.
Comment 1 Curt Arnold 2009-10-22 06:29:29 UTC
Could you confirm that this is still an issue with the current SVN HEAD?  It sounds familiar, but I don't have time to look it up at the moment.
Comment 2 Ramon Casha 2009-10-22 23:29:40 UTC
Yes, it's still there on svn head:

log4j:ERROR Parsing error on line 43 and column 38
log4j:ERROR Attribute value "almira.DB$Location" of type ID must be a name.
Comment 3 Curt Arnold 2009-10-23 07:14:21 UTC
That message is from the XML parser validating the configuration file against a DTD where the attribute is defined to be an ID or IDREF.  That is consistent with the behavior noticed in bug 41487 which was fixed in rev 510723 in 2007.

The DTD validation messages are informative only (reporting them as an ERROR overstates the case, they are an XML error, but not an XML fatal error).  Configuration actually succeeded at least in the original bug.

I've reviewed the current log4j.dtd and there are no longer any ID or IDREF attributes, so I don't see how this could happen unless the DOMConfigurator is using an old DTD.  Either, there is an older log4j.jar on the classpath or you specify a DTD that the DOMConfigurator doesn't replace with its internal copy of log4j.dtd.
Comment 4 Ramon Casha 2009-10-23 07:51:31 UTC
I think you're right; I moved the Log4J Jar to the top of the classpath and this error disappeared.
Comment 5 Curt Arnold 2009-10-23 17:53:21 UTC

*** This bug has been marked as a duplicate of bug 41487 ***