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

Bug 348980

Summary: Unable to use "Apply now" after installing a new Generic Server Plugin
Product: [WebTools] WTP ServerTools Reporter: tundra <rojkov>
Component: wst.serverAssignee: wst.server <wst.server-inbox>
Status: NEW --- QA Contact: Angel Vera <arvera>
Severity: normal    
Priority: P3 CC: ccc, stryker
Version: 3.2   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description tundra CLA 2011-06-09 19:41:06 EDT
Build Identifier: 20110218-0911

basic details: org.eclipse.wst.server.core.ServerCore throws NPE when choosing "Apply Now" after installing fresh plugin.

!ENTRY org.eclipse.equinox.registry 4 2 2011-06-09 16:17:27.319
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.equinox.registry".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.server.core.ServerCore.handleRuntimeTypeDelta(ServerCore.java:456)
	at org.eclipse.wst.server.core.ServerCore$RegistryChangeListener.registryChanged(ServerCore.java:50)
	at org.eclipse.core.internal.registry.ExtensionRegistry$2.run(ExtensionRegistry.java:921)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.registry.ExtensionRegistry.processChangeEvent(ExtensionRegistry.java:919)
	at org.eclipse.core.runtime.spi.RegistryStrategy.processChangeEvent(RegistryStrategy.java:260)
	at org.eclipse.core.internal.registry.osgi.ExtensionEventDispatcherJob.run(ExtensionEventDispatcherJob.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

This behaviour can be observed with either Resin Plugin: http://www.caucho.com/eclipse
or JBoss AS Tools plugin (http://download.jboss.org/jbosstools/updates/stable/helios

Reproducible: Always

Steps to Reproduce:
1. Obtain fresh copy of Eclipse with Java EE Support
2. Install Plugin Help -> Install ...
3. After Installation is finished click "Apply Changes Now"
Comment 1 Rob Stryker CLA 2011-06-13 01:06:26 EDT
The exception seems to be in ServerCore (wst.server) on this line:

  if (rt[i].getId().equals(cf[j].getAttribute("id"))) {

This is already a bit strange, since it seems it'd be occurring during the "removal" of an extension,  and not an addition.  So I am already quite confused as to how the flow of execution could even enter this code.  If you download a stock eclipse and then add an extension, it should never enter the 'removal' section.

I think Angel should look into this most-likely.