Search code examples
javaeclipse-rcprcpe4

Part can't be found after the class name has changed


I have multiple parts defined in my application.e4xmi file. These load up correctly.

I would now like one part to use a different class URI. I've now pointed the part to the new class URI and ran the application.

Here is the error I get.

!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-02-13 09:30:26.003
!MESSAGE Unable to load class 'com.example.ViewName' from bundle '3'
!STACK 0
java.lang.ClassNotFoundException: com.example.ViewName cannot be found by com.example_1.0.0.qualifier

I no longer use the ViewName class in the application.e4xmi file. This means that it must be getting the class URI from the cache. It is then unable to find the class and throws the error. I've tried Synchronize and Launch an Eclipse application in the product file as I thought that might update it but it has no effect. The original method I was using to update was to clear the cache but we can't have the users do this as they will lose their preferences.

What is the correct method of dealing with this?


Solution

  • Specify the -clearPersistedState flag in the 'Program arguments' section of the 'Arguments' tab of the Run Configuration. This will stop the Eclipse loading the persisted workbench.xmi from the previous run (this is in the .metadata/.plugins/org.eclipse.e4.workbench folder of the workspace).