-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Matt,
On 11/14/14 5:02 PM, Matt Newell wrote: > On Fri, Nov 14, 2014 at 3:14 PM, Mark Thomas <ma...@apache.org> > wrote: >> On 14/11/2014 18:14, Matt Newell wrote: >>> Greetings, >>> >>> I have a need to get version information for classes that I >>> have been packaged in a war, and loaded into Tomcat 7.0.trunk >>> on Windows 7. For example: >>> >>> >>> System.out.println(this.getClass().getPackage().getImplementationVersion()); >>> >>> >>> Assuming my.war/META-INF/MANIFEST.MF: >>> Manifest-Version: 1.0 Implementation-Version: 1.0 >>> >>> getImplementationVersion() always returns null. >>> >>> If I review the code for WebappClassLoader the reason for this >>> is clear. All roads lead to findResourceInternal(File, String), >>> line 2983 in 7.x/trunk. This method makes no attempt to load >>> the manifest from the war. >>> >>> My first instinct was that this is a bug. However, I did a >>> quick check using the same scenario using Wildfly 8 and the >>> behavior is the same. Given the clarity of the Tomcat code, and >>> that two robust, well-tested platforms behave the same, I have >>> to assume this is intentional. >> >> Probably not. My guess is that the Tomcat developers didn't >> implement it because they didn't have a need for it. >> >>> My question is this: why? >> >> I'm fairly sure the Wildfly Servlet container is a fork of Tomcat >> - hence the commonality. >> >>> Is META-INF/MANIFEST.MF not part of the war standard? >> >> It looks like it is to me. >> >>> I've googled, but am not enough of a java standards wonk to >>> know what docs are authoritative on this topic. I've certainly >>> seen examples that use it. >> >> I think this is worth opening a bug for. I am a little concerned >> about the overhead that may be required for this. It might end up >> as WONTFIX. > > Mark, > > Ok, will take your advice and open a bug as soon as I work out the > correct process to do so. Whether fixed or not, it won't help me > in the short-term, but am happy to try and improve the product. > It's been my rock for more years than I can count. Frankly, it's a > credit credit to the Tomcat crew that I've never needed to open a > bug previously. > > Heck, I should take a swing a fixing it myself. I owe at least that > much. This. Seriously, /this/ is what the community is all about: 1. you get a benefit from using a community built/supported product 2. your find you have a need the product doesn't fill 3. you offer your time and skills to improve the product 4. the community benefits 5. (bonus) you get your name in the changelog Just assume that your first patch proposal will be brutally criticized. Don't let that cause you any hesitation to propose a patch, rather treat it as liberating that you don't have to mull-over your patch for weeks before submitting it. Knock-up a patch that gets the job done and don't over-think it too much. Try to make it as minimally-invasive as possible. Submit it as soon as you have something and you'll get feedback. If the patch is good, congratulations: it'll likely get applied. If the patch needs improvement, improve it and re-submit until it's acceptable. Do it many times and you'll be voted in as a committer. ;) Thanks in advance for your contribution(s). - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUZrF6AAoJEBzwKT+lPKRYp6QP/2YtbwY3APo0cqL/jR70Y0ML rIskfy8WybBtIBwAxEa0h9IXw2oRTATUle1RJCjuedy7LadVvZisYiVO5hch7iWB VbYcqeB4J9BoxnhbN8trwmraMv0n98Nc3tv7RlLxSOxae6c5ANEY2CepfYxcgAnY PsVQAZ9v8iSZiW9tjMhjtR5cgOOBb7Oxebud82OnULi2avdnSkQIVYmHtHqYLDX+ qNWszub6Enm8P8AVLEjY6UAfRlt3ZV5qgYfLwsXzP7SggGC8asjY6cc13fukDq+C ZexpuozTPUzxglBx+nerRpLJkgOh03auUFOoUFzsNloaJotLAZpIF9dVmfWt61Jj IoKSiaCbQcj+8CXkbKtu1E+Y5HYt+VMQZ/ZEPfM9hI59Tp0v7np2tuLj3RVP3quZ bnnnzaJVR+hoM18sZiuRMCnnTDCE9Wo+dUUeXvXyRAm7uHQ9R97hc5d/sogEhdzH 3MuhXoiQPKRTzwNM14nycu+QGlTkfRipMCrYQp7KxVCZoivDKZifAr/AsYe7CMWs VESw5C2mdY50+bKDNvNKGWxtmWzM9CLqU2pAt8l/mnR0pTMO48FhC0zvjSDmLotN TNyELHR4TpZV4ptld3thkopoh2Ms8a2VdWF5xxPxrHoAMD451X46lBL7p/z7H/eY +tixKSbCXRSmMmp3+yZv =uDv+ -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org