First, let's take a look at the exception:
Java. Lang. instantiationexception: COM. IBM. msdk. UI. session. View. Actions. simportaction
At java. Lang. Class. newinstance0 (class. Java: 340)
At java. Lang. Class. newinstance (class. Java: 308)
At com. IBM. msdk. UI. session. View. Actions. sviewactionprovider. makeimportaction (sviewactionprovider. Java: 157)
At com. IBM. msdk. UI. session. View. Actions. sviewactionprovider. makeactions (sviewactionprovider. Java: 67)
At com. IBM. msdk. UI. session. View. sessionview. createpartcontrol (sessionview. Java: 446)
At org. Eclipse. UI. Internal. viewreference. createparelper (viewreference. Java: 367)
At org. Eclipse. UI. Internal. viewreference. createpart (view reference. Java: 226)
At org. Eclipse. UI. Internal. workbenchpartreference. getpart (workbenchpartreference. Java: 595)
At org. Eclipse. UI. Internal. workbenchpage $ activationlist. setactive (workbenchpage. Java: 4212)
At org. Eclipse. UI. Internal. workbenchpage $18. runwithexception (workbenchpage. Java: 3271)
At org. Eclipse. UI. Internal. startupthreading $ startuprunnable. Run (startupthreading. Java: 31)
========================================================== ========================
For the above exceptions, it means that an exception is thrown when the object fails to be instantiated. Most of these exceptions occur in abstract classes. When the reflection mechanism is used, since the constructor in the abstract parent class is not public, it is very easy to cause exceptions. You only need to change the corresponding constructor in the class to public.
Generally
In the development of rap or RCP, reflection is required when the fragment mechanism is used, which is often used for action and other operations. It should be noted that org. eclipse. jface. action. all constructor methods in action are private. If public is not declared during inheritance, reflection class is used. forname ("com. andy. myaction ")
. Newinstance ();
You cannot call the non-parameter constructor in myaction.
Public class myaction extends org. Eclipse. jface. action. Action {
Public
Myaction (){}<---- After modification ---
Protected
Action (){}
}