After IDE packing getting NoClassDefFoundError error

I am not sure if this is my setup problem, or something else, but can someone help me to fix the following problem.

I have following code:


import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleConfigurationEditor;
import com.intellij.openapi.module.ModuleType;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ui.configuration.DefaultModuleConfigurationEditorFactory;
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationEditorProvider;
import com.intellij.openapi.roots.ui.configuration.ModuleConfigurationState;
import org.systemverilog.module.SystemVerilogModuleType;


public class SystemVerilogModuleConfigurationEditorProvider implements ModuleConfigurationEditorProvider {

@Override
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {


ModifiableRootModel rootModel = state.getRootModel();
Module module = rootModel.getModule();
final ModuleType moduleType = ModuleType.get(module);

String moduleName = module.getName();

if (!(moduleType instanceof SystemVerilogModuleType)) {
return ModuleConfigurationEditor.EMPTY;
}

final DefaultModuleConfigurationEditorFactory editorFactory = DefaultModuleConfigurationEditorFactory.getInstance();
List<ModuleConfigurationEditor> editors = new ArrayList<>();
editors.add(editorFactory.createModuleContentRootsEditor(state));
return editors.toArray(ModuleConfigurationEditor.EMPTY);
}
}

Which extends ModuleConfigurationEditorProvider and registers in plugin XML like this:
<moduleConfigurationEditorProvider implementation="org.systemverilog.configuration.SystemVerilogModuleConfigurationEditorProvider"/>

Code works fine, without any issue in Intellij IDE environment. I can see new Module secton update in the Projects Settings dialog.

However after building standalon IDE, which is based on Comunity IDE:
class SVStudioBuildSimple extends IdeaCommunityProperties{

SVStudioBuildSimple(String communityHome) {
super(communityHome)
println("[INFO: SVSTUDIO] communityHome is " + communityHome);
productCode = "SV"
baseFileName = "svstudio"
platformPrefix = "SystemVerilogStudio"
applicationInfoModule = "svstudio.branding"
brandingResourcePaths = ["$communityHome/svstudio/svstudio.branding/src/images/"]
//productLayout.buildAllCompatiblePlugins = true
productLayout.mainModules = productLayout.mainModules + ["svstudio", "slm4j", "svstudio.branding", "svstudio.plugin"]
productLayout.productImplementationModules = productLayout.productImplementationModules + [
"slm4j","svstudio.branding", "svstudio.plugin"
]
}
....

And running the standalone IDE, I am getting following error:

2019-09-01 15:24:46,611 [ 14213] ERROR - llij.ide.plugins.PluginManager - com/intellij/openapi/roots/ui/configuration/DefaultModuleConfigurationEditorFactory
java.lang.NoClassDefFoundError: com/intellij/openapi/roots/ui/configuration/DefaultModuleConfigurationEditorFactory
at org.systemverilog.configuration.SystemVerilogModuleConfigurationEditorProvider.createEditors(SystemVerilogModuleConfigurationEditorProvider.java:60)
at com.intellij.openapi.roots.ui.configuration.ModuleEditor.createEditors(ModuleEditor.java:175)
at com.intellij.openapi.roots.ui.configuration.ModuleEditor.createPanel(ModuleEditor.java:247)
at com.intellij.openapi.roots.ui.configuration.ModuleEditor.getPanel(ModuleEditor.java:261)
at com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleConfigurable.createOptionsPanel(ModuleConfigurable.java:119)
at com.intellij.openapi.ui.NamedConfigurable.createComponent(NamedConfigurable.java:70)
at com.intellij.openapi.ui.MasterDetailsComponent.updateSelection(MasterDetailsComponent.java:622)
at com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable.updateSelection(ModuleStructureConfigurable.java:194)

 

Somehow the build can not find DefaultModuleConfigurationEditorFactory class. But if I am creating Java project inside of this IDE all works fine. 

 

Same with following implementation:

public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {

ModifiableRootModel rootModel = state.getRootModel();
Module module = rootModel.getModule();

String moduleName = module.getName();
List<ModuleConfigurationEditor> editors = new ArrayList<>();
editors.add(new ContentEntriesEditor(moduleName, state));
//editors.add(new ClasspathEditor(state));
return editors.toArray(ModuleConfigurationEditor.EMPTY);
}

Works fine inside Intellij but with standalone IDE I am getting following error:
2019-09-01 16:08:19,182 [ 63497] ERROR - llij.ide.plugins.PluginManager - com/intellij/openapi/roots/ui/configuration/ContentEntriesEditor
java.lang.NoClassDefFoundError: com/intellij/openapi/roots/ui/configuration/ContentEntriesEditor
at org.systemverilog.configuration.SystemVerilogModuleConfigurationEditorProvider.createEditors(SystemVerilogModuleConfigurationEditorProvider.java:76)
at com.intellij.openapi.roots.ui.configuration.ModuleEditor.createEditors(ModuleEditor.java:175)
at com.intellij.openapi.roots.ui.configuration.ModuleEditor.createPanel(ModuleEditor.java:247)
at com.intellij.openapi.roots.ui.configuration.ModuleEditor.getPanel(ModuleEditor.java:261)
at com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleConfigurable.createOptionsPanel(ModuleConfigurable.java:119)
at com.intellij.openapi.ui.NamedConfigurable.createComponent(NamedConfigurable.java:70)
at com.intellij.openapi.ui.MasterDetailsComponent.updateSelection(MasterDetailsComponent.java:622)
at com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable.updateSelection(ModuleStructureConfigurable.java:194)

Please sign in to leave a comment.