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

Bug 328968

Summary: jUnit failures in jst.server.tomcat
Product: [WebTools] WTP ServerTools Reporter: Angel Vera <arvera>
Component: jst.serverAssignee: Angel Vera <arvera>
Status: RESOLVED FIXED QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: darin.eclipse, david_williams, israelgd, john.arthorne, larryisaacs, tjbishop
Version: 3.2   
Target Milestone: 3.2.3   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/109002
https://git.eclipse.org/r/108999
https://git.eclipse.org/r/109003
https://git.eclipse.org/r/109836
https://git.eclipse.org/r/109835
https://git.eclipse.org/c/servertools/webtools.servertools.git/commit/?id=83499cd59a24d79fc4f2fdd2765af74c00b3dbe6
https://git.eclipse.org/c/servertools/webtools.servertools.git/commit/?id=a0e753e6dc23ae8123f1b15256a922d4d9508472
Whiteboard:
Attachments:
Description Flags
logs from the junit run
none
possible patch arvera: iplog+

Description Angel Vera CLA 2010-10-28 15:42:04 EDT
In the latest wtp builds for 3.2.3 and for 3.3 there are failures in jst.server.tomcat related to: 

Test package: org.eclipse.jst.server.tomcat.core.tests. 
TestCase name: serverCanStop
The error reported is: 

junit.framework.AssertionFailedError: null
at org.eclipse.wst.server.core.tests.ext.AbstractServerTestCase.serverCanStop(AbstractServerTestCase.java:152)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:377)
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:210)
at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:36)
at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:32)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:621)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:576)
at org.eclipse.equinox.launcher.Main.run(Main.java:1409)
at org.eclipse.equinox.launcher.Main.main(Main.java:1385)
Comment 1 Angel Vera CLA 2010-10-28 15:46:10 EDT
I ran the test locally a few times with the 3.2.3 build and I didn't get any failures. Looking at the out logs, I see the following errors which seems to be related to the changes I did recently for Bug# 328067:

ENTRY org.eclipse.core.jobs 4 2 2010-10-28 16:28:09.970
!MESSAGE An internal error occurred during: "Starting Tomcat v5.0 Server at localhost".
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/debug/ui/DebugUITools
		 at org.eclipse.wst.server.ui.internal.SaveEditorPrompter.setDebugSaveBeforeLaunching(SaveEditorPrompter.java:62)
		 at org.eclipse.wst.server.ui.internal.SaveEditorPrompter.setDebugNeverSave(SaveEditorPrompter.java:69)
		 at org.eclipse.wst.server.core.internal.Server.startImpl2(Server.java:3213)
		 at org.eclipse.wst.server.core.internal.Server.startImpl(Server.java:3163)
		 at org.eclipse.wst.server.core.internal.Server$StartJob.run(Server.java:359)
		 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 2 David Williams CLA 2010-10-28 17:38:02 EDT
I don't quite recall the history (had to do with not shipping "java source" in binary folders, I believe) but jst.server.tomcat.core has some "pre-compiled jars" in it, I believe. See 

org.eclipse.jst.server.tomcat.runtime.50.loader-src.zip
org.eclipse.jst.server.tomcat.runtime.50.loader.jar
org.eclipse.jst.server.tomcat.runtime.55.loader-src.zip
org.eclipse.jst.server.tomcat.runtime.55.loader.jar
org.eclipse.jst.server.tomcat.runtime.60.loader-src.zip
org.eclipse.jst.server.tomcat.runtime.60.loader.jar
org.eclipse.jst.server.tomcat.runtime.70.loader-src.zip
org.eclipse.jst.server.tomcat.runtime.70.loader.jar

Do these need to be recompiled with the recent changes, checked into cvs, and released?
Comment 3 Larry Isaacs CLA 2010-10-28 22:57:35 EDT
FYI: The org.eclipse.jst.server.tomcat.runtime.??.loader jars are copied to Tomcat as part of the "Serve modules without publishing" feature.  Their code only runs within Tomcat and wouldn't affect anything or be affected by anything running in Eclipse.
Comment 4 Angel Vera CLA 2010-11-02 11:39:32 EDT
Created attachment 182219 [details]
logs from the junit run

Darin, 

Can you shed some light on this jUnit failure. This is related to the changes that you and I discussed for bug# 328067. 

The code changes are in Server.java ver. 1.188 as per: http://dev.eclipse.org/viewcvs/index.cgi/servertools/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java?root=WebTools_Project&r1=1.187&r2=1.188

The jUnit is defined as a <ant target="core-test", which I think should be the right target, but why is my code detecting that org.eclipse.ui is active, when it shouldn't be.
Comment 5 Angel Vera CLA 2010-11-04 13:10:41 EDT
Darin, I missed adding you on my last comment. Do you have any ideas, this is related to the hang that we worked on bug# 328067. Take a look at comment #4
Comment 6 Angel Vera CLA 2010-11-04 14:58:39 EDT
*** Bug 329475 has been marked as a duplicate of this bug. ***
Comment 7 Darin Wright CLA 2010-11-04 17:19:59 EDT
(In reply to comment #4)
> The jUnit is defined as a <ant target="core-test", which I think should be the
> right target, but why is my code detecting that org.eclipse.ui is active, when
> it shouldn't be.

I'm not familiar with the code that checks if the UI is running. Can you debug through the test to see why it thinks the UI is running?
Comment 8 Angel Vera CLA 2010-11-08 11:38:11 EST
(In reply to comment #7)
Unfortunately, this is happening in our automated jUnit test and I don't know how I could debug that. Maybe if I setup the same environment but that might take sometime.
Comment 9 Angel Vera CLA 2010-11-08 13:07:58 EST
I committed changes to 32M to make the test UI, I am doing this as a workaround to the jUnit test. While we continue to investigate the problem
Comment 10 Angel Vera CLA 2010-11-08 13:10:11 EST
John, 

Do you know of any better of way of checking if the UI is enabled or not?
Comment 11 Angel Vera CLA 2010-11-11 15:48:26 EST
Sicne the changes for 32M work as a temp workaround. I am committed and released the same changes for HEAD(3.3) while we investigate where the failure comes from.
Comment 12 Troy Bishop CLA 2010-11-30 16:35:30 EST
Created attachment 184189 [details]
possible patch

Within a WTP adopter product we have support for headlessly starting a server and this problem is now occurring.  Attached is a patch which modifies the check for determining if in a headless or UI environment.  It solves the problem in my environment.
Comment 13 Angel Vera CLA 2010-12-07 11:30:06 EST
Thanks for the patch Troy, and the testing. It seems to do the trick. It still puzzles me why the the .ui plugin is detected as active but that will be a problem for a different time.
Comment 14 Angel Vera CLA 2010-12-07 11:30:18 EST
committed to 32M
Comment 15 Angel Vera CLA 2010-12-08 16:08:04 EST
committed to HEAD
Comment 16 Angel Vera CLA 2010-12-08 16:08:36 EST
release to HEAD
Comment 17 Angel Vera CLA 2010-12-08 16:08:52 EST
released to 32M
Comment 18 Eclipse Genie CLA 2017-10-11 16:35:02 EDT
New Gerrit change created: https://git.eclipse.org/r/109002
Comment 19 Eclipse Genie CLA 2017-10-11 16:35:05 EDT
New Gerrit change created: https://git.eclipse.org/r/108999
Comment 20 Eclipse Genie CLA 2017-10-11 16:35:13 EDT
New Gerrit change created: https://git.eclipse.org/r/109003
Comment 21 Eclipse Genie CLA 2017-10-11 16:54:01 EDT
New Gerrit change created: https://git.eclipse.org/r/109836
Comment 22 Eclipse Genie CLA 2017-10-11 16:54:03 EDT
New Gerrit change created: https://git.eclipse.org/r/109835