Bug 48678 - org.apache.catalina.startup.Catalina incorrectly duplicates super class member
Summary: org.apache.catalina.startup.Catalina incorrectly duplicates super class member
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.24
Hardware: All All
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-04 00:09 UTC by Henning Blohm
Modified: 2010-02-23 22:52 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.