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

Bug 126594

Summary: Server launch configuration and tab group are not extendable for other mode
Product: [WebTools] WTP ServerTools Reporter: Eugene Chan <ewchan>
Component: jst.serverAssignee: Tim deBoer <deboer>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: gorkem.ercan, popescu, rgavlin, ryman, sluiman
Version: 1.0Keywords: api
Target Milestone: 1.5 RC3   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/107763
https://git.eclipse.org/r/107832
Whiteboard:
Bug Depends on:    
Bug Blocks: 126583, 136003    

Description Eugene Chan CLA 2006-02-06 11:21:04 EST
TPTP is extending the following delegates and tab groups currently available in WTP for profiling support, which are currently internal.  We would like to request that these be made public API.
org.eclipse.jst.server.generic.core.internal.GenericServerLaunchConfigurationDelegate
org.eclipse.jst.server.generic.ui.internal.GenericLaunchConfigurationTabGroup
org.eclipse.jst.server.tomcat.core.internal.TomcatLaunchConfigurationDelegate
org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour
org.eclipse.jst.server.tomcat.ui.internal.TomcatLaunchConfigurationTabGroup

The following internal classes are also need to be made public API for supporting server profile mode startup.
26:import org.eclipse.wst.server.core.internal.IStartup
27:import org.eclipse.wst.server.core.internal.Server
Comment 1 Eugene Chan CLA 2006-02-06 13:13:53 EST
This is a blocking defect for TPTP .
Comment 2 Tim deBoer CLA 2006-02-06 17:05:19 EST
Current WTP plans and guidance will not have all of this as API even for 1.5. Are there actual methods that are private that you can't currently call, or is it just that you don't want to use internal code? Please let us know if there is anything we can do in the short term (e.g. change internal class or method to protected or public access) and we'll look at moving things to API later.

FYI, WTP currently has a program for scanning your code to capture 'internal usage', which will then be checked against ongoing WTP builds to ensure that we don't change things even if they are internal. Please feel free to talk to Arthur Ryman or Jeffrey Liu about this.
Comment 3 Eugene Chan CLA 2006-02-06 17:34:13 EST
- The Delegates and TabGroups are currently being extended to support profile mode launches. We get warnings for such action.
- IStartup is used with extension point "org.eclipse.wst.server.core.internalStartup", currently intended for internal use, we need such interface for registrating server listener. 
- Server class is needed for getLaunchConfiguration() call, which does not exist in IServer.

We are now using all the internal elements without error, but we would like to not have any internal usage in our code.

I will check with Jeffrey on the scanning program. Thanks a lot!

Comment 4 Tim deBoer CLA 2006-02-10 09:48:11 EST
No justification for blocking status, which is also making it come up in 1.0.1 reports. Changing to correct severity.
Comment 5 Valentina Popescu CLA 2006-02-17 11:37:10 EST
Tim, the engines that identifies internal dependencies is not sufficient to downgrade this defect to an enhancement. 

There are huge issues TPTP and downstream products have now because we made a similar deal with the PDE team for the profile launch configuration. Nothing guarantees that a new driver is compatible with a previous one and we are at a point where every single milestone driver breaks us and consequently breaks any other products based on TPTP. It is hard to explain why TPTP has to be refreshed when moving to every single eclipse milestone. This is a major problem for us and I predict that we'll have major compatibility issues on downstream products because of that 

The Profile on Server function cannot be implemented with the existing WTP/AST API's and we require to have this considered as a high priority request.
I will go next and discuss this with Arthur as you suggested. We need a solution that is compatible with the open source standards.
Comment 6 Eugene Chan CLA 2006-02-17 11:46:31 EST
I have talked to Jeff, and Hubert Leung of TPTP build team is investigating on WTP API usage report and submiting of such report to WTP for adoptor scanner in the mean time.
Comment 7 Tim deBoer CLA 2006-02-20 11:35:24 EST
Re: comment #5. Sorry Valentina, but WTP is not mature enough to declare full API. Server tools already has significantly more API than other areas of WTP, and our direction is to slowly expose these over time. Technically, this request does not even qualify because we're supposed to have two external users before we're allowed to expose API. You'll need to work this through Arthur and the PMC if this is that critical for you.
Comment 8 Valentina Popescu CLA 2006-02-20 11:43:02 EST
Thanks Tim, I've already contacted Arthur and hope to find the best solution for both projects. API usage is marked as blocking issue for TPTP so we'll have to go through a process exception for this situation.
Comment 9 Eugene Chan CLA 2006-02-22 12:00:14 EST
Here is more information on what and how the internal code of Web Tools are called by TPTP profile on servers integration.

[org.eclipse.wst.server.core.internal.IStartup]
This is used inline with plugin extension point org.eclipse.wst.server.core.internalStartup where our server listener class extends IStartup class to register ServerListener for listening to PROFILE_MODE server start change event. We open our attach to server process wizard once we received such event. We need such extension to do all the registration on server startup, and this is a crucial for us to listen to the server to support profile mode.

[org.eclipse.wst.server.core.internal.Server]
In our IServerListener implementation (the server listener mentioned above), serverChanged method returns ServerEvent where we receive an IServer from event.getServer() call. The IServer is then cast to Server for retriving the ILaunchConfiguration via getLaunchConfiguration() call. We need the launchconfguration for its workingcopy. If IServer can provide getLaunchConfiguration equivalent, then there is no need to cast to Server which is internal for now.

[org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour]
	tomcatServerBehaviour.setupLaunch(ILaunch, String, IProgressMonitor)
	tomcatServerBehaviour.getRuntimeClass()
	tomcatServerBehaviour.setProcess(IProcess)
In our support of profiling mode of TomcatServerLaunchConfigurationDelegate class, our implementation try to extend the org.eclipse.jst.server.tomcat.core.insternal.TomcatLaunchConfigurationDelegate in such a way by just modified the VMArgument with '-XrunpiAgent:server=enabled" appended. We can do that by overriding getVMArguments methods; However, the launch method is bounded to RUN and DEBUG mode only and hence we have to extend AbstractJavaLaunchConfigurationDelegate and duplicate the launch method in TomcatLaunchConfigurationDelegate but to get the VMRunner as in Run mode to complete the work, this duplication introduces the need to use TomcatServerBehaviour and its methods listed above. Either we need a way to override the way the super class get the VMRunner or we need to use the TomcatServerBehaviour to complete the task.

We would like to have this addressed by API freeze.
Comment 10 Gorkem Ercan CLA 2006-02-22 12:28:33 EST
Eugene do you have similiar requirements for the generic servers as well for instance for GenericServerLaunchConfigurationDelegate
Comment 11 Eugene Chan CLA 2006-02-22 12:59:16 EST
Gorkem, Yes we face a similar problem in our Profile GenericServerLaunchconfigurationDelegate. I missed to mention it in my last comment.

[org.eclipse.jst.server.generic.core.internal.GenericServerLaunchConfigurationDelegate]
[org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour]
        genericServer.setupLaunch(ILaunch, String, IProgressMonitor)
        genericServer.setProcess(IProgress)
        genericServer.terminate();
Similar to TomcatServerLaunchConfiguration, in order to append our VMArguements, we extend org.eclipse.jst.server.generic.core.internal.GenericServerLaunchConfigurationDelegate and override the getVMArguments method to append the '-XrunpiAgent' argument. And we were looking to override the launch method to make it support PROFILE mode by faking it as RUN mode to get the VMRunner. However, the methods listed above of GenericServerBehaviour are invisiable so we cannot extend it as described. As a result, we can only append the JVMArgument and lost the server change notficiation event resulting an extra step for user to attach to the server process. 
Comment 12 Tim deBoer CLA 2006-04-05 14:20:22 EDT
As per our meeting several weeks ago, this request has changed substantially. We'll now be providing an extension point that allows vendors to plug specific profilers into WTP. I've added a new extension point named org.eclipse.jst.server.core.serverProfilers that should provide you with this support.

I have enabled the support for Tomcat and released into the WTP 1.5 stream. Please verify that it meets your requirements and then we'll push it into the generic servers.
Comment 13 Eugene Chan CLA 2006-05-01 12:57:58 EDT
Gorkem,
Tim D introduces an extension point for profile mode server launch, where TPTP extends in RC1. The extension point is proven in Tomcat scenario. Generic server launch should adapt the new extension point for profile mode server launch. Would you please update the generic server code? Detail of the new extension point is available in bug 136003. We need this by WTP RC2 so TPTP will have enough time for testing for its 4.2i3 release (May 14).

Tim, 
There are things that TPTP is still waiting from WTP in this feature request:
1. Automatic loading of TPTP plugin when extension point is loaded. 
2. IServer.getLaunchConfiguration, TPTP needs this in our 4.2 timeframe. We discussed about the limitation of WTP API freeze, but TPTP strongly request this API as it is a blocking defect. A possible solution for this problem is a new server interface class as discussed before.

WTP team,
All these requests are required by May 7 to give TPTP enough time to adopt and test. We need to close this request ASAP.

Thanks a lot for your time.
Comment 14 Gorkem Ercan CLA 2006-05-01 14:43:25 EDT
Hey Eugene, I am working on it, aiming to release it for this weeks I build 
Comment 15 Eugene Chan CLA 2006-05-05 14:49:08 EDT
Hi Tim and Arthur,

As discussed, WTP will deliver in WTP 1.5 RC3 auto loading of profiling plugin before the new profiler extension point is loaded, to allow profiling plugin a chance to register any server listener. 

On the other hand, API IServer.getLaunchConfiguration will be delivered in WTP 2.0.

Thanks in advance for your help on these issue!
Comment 16 Tim deBoer CLA 2006-05-12 15:29:27 EDT
This bug is complete - the new extension point is used by both Tomcat & generic servers and the trigger to start the profiling plugin is in place.
Comment 17 Eugene Chan CLA 2006-05-16 18:03:14 EDT
Thanks WTP for your help on closing this enhencement request.

I have opened bug 142102 for the remaining issue as mentioned in comment #15.
Comment 18 Ron Gavlin CLA 2006-08-14 11:56:39 EDT
I am using WTP 1.5 and TPTP 4.2 on Windows. I have created a WebLogic 8.1 Generic Server. The "Profile-on-Server" button for this generic server is disabled. Based on comment 14, https://bugs.eclipse.org/bugs/show_bug.cgi?id=126594#c14, it appears to me that this functionality was indeed implemented for generic servers in these WTP/TPTP releases and that button should be enabled. Am I correct that this functionality should be available in these releases? If not, is there a workaround to profile generic servers "manually"?
Comment 19 Eugene Chan CLA 2006-08-14 12:14:26 EDT
(In reply to comment #18)
> I am using WTP 1.5 and TPTP 4.2 on Windows. I have created a WebLogic 8.1
> Generic Server. The "Profile-on-Server" button for this generic server is
> disabled. Based on comment 14,
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=126594#c14, it appears to me that
> this functionality was indeed implemented for generic servers in these WTP/TPTP
> releases and that button should be enabled. Am I correct that this
> functionality should be available in these releases? If not, is there a
> workaround to profile generic servers "manually"?
> 

According to bug 148599, Profiling on Sever feature is not yet supported for WebLogic server. To workaround the problem, please try adding "-XrunpiAgent" as a VM argument in server launch configuration, and start server in run mode with the VM arg, then Profile>Profile... and create an 'Attach-Java Process' configuration, select profiling agent to attach to and additional profiling options to continue.
Comment 20 Eclipse Genie CLA 2017-10-11 15:59:51 EDT
New Gerrit change created: https://git.eclipse.org/r/107763
Comment 21 Eclipse Genie CLA 2017-10-11 16:01:28 EDT
New Gerrit change created: https://git.eclipse.org/r/107832