Community
Participate
Working Groups
Trying to profile a server using TPTP Build TPTP-4.4.0-200702190100 and either WTP I200702152002 or I200702080847 throws a NullPointerException. In the ResourceManager class the method getServers throws the Null pointer, because the servers list is null and has not been initialized. In the init method the server list is either not built in time because the status is initializing and thus the server list is null when checked in the getServer method. I see that it is synchronized block of code but for some reason the list is always null. There is no work around that I aware of. Stack Trace: java.lang.NullPointerException at org.eclipse.wst.server.core.internal.ResourceManager.getServers(ResourceManager.java:720) at org.eclipse.wst.server.core.ServerCore.getServers(ServerCore.java:299) at org.eclipse.tptp.platform.profile.server.wst.internal.ApplicationServerListener.startup(ApplicationServerListener.java:42) at org.eclipse.wst.server.core.internal.ResourceManager.executeStartups(ResourceManager.java:186) at org.eclipse.wst.server.core.internal.ResourceManager.init(ResourceManager.java:212) at org.eclipse.wst.server.core.internal.ResourceManager.getServers(ResourceManager.java:718) at org.eclipse.wst.server.core.ServerCore.getServers(ServerCore.java:299) at org.eclipse.wst.server.ui.internal.InitializeJob.run(InitializeJob.java:35) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
After more debugging, what is happening is that the init call within ResourceManager makes a call to executeStartups which include a call to the TPTP ApplicationServerListener which implements IStartup. So the server list will always be null until the init is finished.
Since TPTP is calling API during the API startup hook, at best this will probably return an empty list. I'll take a deeper look tomorrow.
Looking at the init again in ResourceManager, I think if you move executeStartups() after you do loadServersList() everything would be fine. Just my two cents.
No, you're right. The fix made in M4 to avoid deadlock when startups were used incorrectly went a little too far, and we can make this API work. Startups still can't tell whether others servers will be created before or after their call during the initialization, but the API will be consistent. We're in final lock down for M5 and I don't think this really qualifies as blocking since it will only cause this specific TPTP startup to fail. I will release a fix as soon as M6 opens, likely late this week.
moved to critical.
Fix released to WTP 2.0 M6 builds.
Profiling now works, verified on build I200702260802.
*** Bug 174887 has been marked as a duplicate of this bug. ***
New Gerrit change created: https://git.eclipse.org/r/108157