Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334818

Summary: Tomcat 7 requires a Java SDK in WTP
Product: [WebTools] WTP ServerTools Reporter: David Becker <david>
Component: jst.serverAssignee: Larry Isaacs <larryisaacs>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: david, david_williams, larryisaacs, mauromol
Version: 3.2Flags: david_williams: pmc_approved+
arvera: pmc_approved? (raghunathan.srinivasan)
arvera: pmc_approved? (naci.dai)
arvera: pmc_approved? (deboer)
arvera: pmc_approved? (neil.hauge)
arvera: pmc_approved? (kaloyan)
arvera: review+
Target Milestone: 3.2.3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
See Also: https://git.eclipse.org/r/109019
Whiteboard: PMC_approved
Attachments:
Description Flags
Patch to include Tomcat 7.0 in the check for not requiring tools.jar none

Description David Becker CLA 2011-01-19 12:45:37 EST
Build Identifier: 20100917-0705

While attempting to add a Tomcat v7.0 runtime in WST 3.0.2, I get the following warning and it won't let me create the runtime.
Tomcat requires a Java SDK in order to compile JSP files. Ensure that the JRE preference settings point to an SDK install location.

My java preference is an SDK (Mac OS X Java 1.6), and it works just fine with Tomcat v6.0. Besides which, that error isn't even true, is it? Tomcat 7 says it uses the eclipse compiler for JSP pages now and that JRE is sufficient...

Reproducible: Always

Steps to Reproduce:
1. Add a Tomcat 7 runtime on a Mac using the standard Mac JVM.
Comment 1 David Becker CLA 2011-01-19 12:46:20 EST
Larry Isaacs responded to a forum post with the following:

That would be a bug. I missed updating that check when implementing the 
Tomcat 7 support. Of the numerous versions of Java I have on my system, 
they are almost all SDKs. Please file a bug report and I'll see about 
fixing that in WTP 3.2.3. If you create a file named tools.jar in the 
JRE's lib folder, that will work around this check.

Cheers,
Larry
Comment 2 Larry Isaacs CLA 2011-01-19 13:05:32 EST
Updating product, component, and assigning to me.
Comment 3 Larry Isaacs CLA 2011-01-19 13:36:38 EST
Created attachment 187137 [details]
Patch to include Tomcat 7.0 in the check for not requiring tools.jar
Comment 4 Larry Isaacs CLA 2011-01-19 13:43:21 EST
Angel,

I would like to request this for WTP 3.2.3.  Though perhaps not a "show-stopper" in the normal sense, it is a potential cycle waster as many more users start to trip over this with Tomcat 7.0 going "stable" with the recently released 7.0.6.  The fix is simple and safe and fewer cycles to fix than to deal with the likely newgroup posts and possible bug reports about this issue.  If you agree, I can add the PMC approval info.

Thanks,
Larry
Comment 5 Angel Vera CLA 2011-01-19 16:50:59 EST
We need the PMC template
Comment 6 Larry Isaacs CLA 2011-01-19 20:48:13 EST
Here is the PMC Approval Info:

1. Explain why you believe this is a stop-ship defect.

This is a regression of Tomcat 7.0 behavior relative to Tomcat 5.5 and 6.0.  For many years, Tomcat 5.5. and 6.0 have only needed a JRE, instead of an SDK (for tools.jar), because they use their own copy of the Eclipse Java compiler.  Unfortunately, the checking to allow a JRE didn't get updated when Tomcat 7.0 support was added.  As a result, Tomcat 7.0 is back to requiring an SDK, instead of a JRE, though a JRE is sufficient.  Now that the recently released Tomcat 7.0.6 has been declared "stable", its use is going increase and many users are likely to trip over this.

2. Is there a work-around? If so, why do you believe the work-around is
insufficient?

Creating a "tool.jar" file in the JRE's lib folder will avoid the issue.  However, users will be confused by this requirement and this trick is not obvious from the message displayed.  WTP newsgroup posts, and perhaps duplicate bug reports, will likely occur.  It would be better to avoid the grief and time answering newsgroup posts by implementing the simple fix for this.

3. How has the fix been tested? Is there a test case attached to the bugzilla
record? Has a JUnit Test been added?

I have manually testing the fix in my development environment.  The Tomcat JUnits can detect this bug, but the warning is currently accepted as passing.  Making this a failure would impose requirements it on the testing environment (have to run with a JRE) that probably aren't worth it.  The JUnits can test any Tomcat version, but only one version in any one build.  We continue to run the tomcat.core tests using Tomcat 5.0 at this time.

4. Give a brief technical overview. Who has reviewed this fix?

The check that allows a JRE to be used for Tomcat 5.5 and 6.0 needs a minor update to include 7.0 too.

5. What is the risk associated with this fix? 

The change is simple enough to carry very little risk.
Comment 7 Larry Isaacs CLA 2011-01-27 14:05:01 EST
Fix release to WTP 3.2.3 maintenance and HEAD and is present in current builds.
Comment 8 Eclipse Genie CLA 2017-10-11 16:35:46 EDT
New Gerrit change created: https://git.eclipse.org/r/109019