Bug 481859 - Eclipse CF server properties are blank when using pre-refactor workspace
Summary: Eclipse CF server properties are blank when using pre-refactor workspace
Status: RESOLVED FIXED
Alias: None
Product: CFT
Classification: ECD
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal
Target Milestone: 1.0 M3   Edit
Assignee: Jonathan West CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2015-11-10 11:49 EST by Jonathan West CLA
Modified: 2016-02-11 17:06 EST (History)
1 user (show)

See Also:


Attachments
Patch to cft server properties (9.84 KB, patch)
2015-11-10 11:52 EST, Jonathan West CLA
no flags Details | Diff
Patch to cft server properties (10.76 KB, patch)
2015-11-10 12:06 EST, Jonathan West CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan West CLA 2015-11-10 11:49:48 EST
When attempting to use an old workspace (pre-CF refactor) with a post-CF refactor workspace, you will see an exception when attempting to use the existing CF server. You will also see blank properties in the first page of the CF server editor.

This is due to old property constants in the server map.

Old properties in the CF server (comma-separated):
{org.cloudfoundry.ide.eclipse.org=jgwest@ca.ibm.com, org.cloudfoundry.ide.eclipse.username=jgwest@ca.ibm.com, org.cloudfoundry.ide.eclipse.serverId=jgwest@ca.ibm.com_jgwest@ca.ibm.com_dev@https://api.ng.bluemix.net, server-type-id=com.ibm.cftools.server, start-timeout=600, auto-publish-setting=1, server-type=com.ibm.cftools.server, org.cloudfoundry.ide.eclipse.space=dev, stop-timeout=60, hostname=Cloud, name=IBM Bluemix, runtime-id=IBM Bluemix Runtime, id=IBM Bluemix, org.cloudfoundry.ide.eclipse.url=https://api.ng.bluemix.net, timestamp=0}

These properties have been refactored in the org.eclipse.cft.* codebase (passwords are stored separately in secure preferences, and are also handled by this patch.)

Exception:
org.eclipse.core.runtime.CoreException: Unable to resolve locally stored organization and space for the server instance null. The server instance may have to be cloned or created again.
    at org.eclipse.cft.server.core.internal.CloudErrorUtil.toCoreException(CloudErrorUtil.java:357)
    at org.eclipse.cft.server.core.internal.CloudErrorUtil.toCoreException(CloudErrorUtil.java:343)
    at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.getClient(CloudFoundryServerBehaviour.java:1066)
    at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.getClient(CloudFoundryServerBehaviour.java:1093)
    at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour$BehaviourRequest.getClient(CloudFoundryServerBehaviour.java:1957)
    at org.eclipse.cft.server.core.internal.client.BaseClientRequest.run(BaseClientRequest.java:76)
    at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.getDomainsForSpace(CloudFoundryServerBehaviour.java:274)
    at org.eclipse.cft.server.core.internal.ApplicationUrlLookupService.refreshDomains(ApplicationUrlLookupService.java:56)
    at org.eclipse.cft.server.core.internal.client.CloudFoundryServerBehaviour.initialize(CloudFoundryServerBehaviour.java:1133)
    at com.ibm.cftools.branding.internal.CloudFoundryBluemixServerBehaviour.initialize(CloudFoundryBluemixServerBehaviour.java:1186)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.initialize(ServerBehaviourDelegate.java:101)
    at org.eclipse.wst.server.core.model.InternalInitializer.initializeServerBehaviourDelegate(InternalInitializer.java:41)
    at org.eclipse.wst.server.core.internal.Server.getBehaviourDelegate(Server.java:531)
    at org.eclipse.wst.server.core.internal.ServerWorkingCopy.getBehaviourDelegate(ServerWorkingCopy.java:391)
    at org.eclipse.wst.server.core.internal.ServerWorkingCopy.loadAdapter(ServerWorkingCopy.java:767)
    at com.ibm.etools.wdt.server.ui.internal.editor.WDTSecurityEditorPart.initialize(WDTSecurityEditorPart.java:204)
    at com.ibm.etools.wdt.server.ui.internal.editor.WDTSecurityEditorPart.createPartControl(WDTSecurityEditorPart.java:102)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:244)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:214)
    at org.eclipse.wst.server.ui.internal.editor.ServerEditor.createPages(ServerEditor.java:247)
    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:363)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:151)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:341)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:898)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:879)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:121)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:345)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:264)
Comment 1 Jonathan West CLA 2015-11-10 11:52:28 EST
Created attachment 257862 [details]
Patch to cft server properties
Comment 2 Jonathan West CLA 2015-11-10 12:06:29 EST
Created attachment 257863 [details]
Patch to cft server properties
Comment 3 Jonathan West CLA 2015-11-10 17:15:12 EST
Patch committed to master.