Bug 48678

Summary: org.apache.catalina.startup.Catalina incorrectly duplicates super class member
Product: Tomcat 6 Reporter: Henning Blohm <henning.blohm>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 6.0.24   
Target Milestone: default   
Hardware: All   
OS: All   

Description Henning Blohm 2010-02-04 00:09:04 UTC
Catalina declares its own protected member variable "server" and a corresponding "setServer" method, while Catalina's super class Embedded has a private member "server" and a "getServer" method, so that Catalina sets its "service" member, but when asking, will return super.server which is consistently null.

This means that Catalina cannot be used as Tomcat embedding directly but at least requires an extension like so:

public class MyCatalina extends Catalina {
        public Server getServer() {
                return this.server;
        }
}

It might have other ramifications though and was most likely not intended.

See also: http://marc.info/?l=tomcat-user&m=126502245412565&w=2
Comment 1 Henning Blohm 2010-02-04 00:11:13 UTC
updated platform and OS to "All".
Comment 2 Mark Thomas 2010-02-06 13:35:43 UTC
Fixed in trunk and proposed for 6.0.x. Many thanks.
Comment 3 Mark Thomas 2010-02-23 22:52:22 UTC
This has been fixed in 6.0.x and will be included in 6.0.25 onwards.