I am trying to rebuild the OSLC Adapter which is built on MagicDraw. I am trying to rebuild it to use Cameo System Modeller. In that project also I am getting the same error while loading project. This project tries to expose the OSLC services on top of Cameo project files to query the data (like requirements, use cases etc.)
Here is the github project url :
https://github.com/ld4mbse/oslc-adapter ... nager.javaIf you see the method loadSysMLProject. It tries to do the same thing. First get the instance of the application, then start the application and try to load project.
if (project == null) {
// if (magicdrawApplication == null) { this does not support
// reloading of models
// launch MagicDraw in batch mode
magicdrawApplication = Application.getInstance();
try {
magicdrawApplication.start(false, true, false, new String[0], null);
} catch (ApplicationExitedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.err.println(e.toString());
} catch (Exception e) {
e.printStackTrace();
System.err.println(e.toString());
}
}
projectsManager = magicdrawApplication.getProjectsManager();
if (!loadedProjects.keySet().contains(projectId)) {
final File sysmlfile;
if (OSLC4JMagicDrawApplication.useIndividualSubversionFiles) {
String[] filePathSegments = projectId.split("\\\\");
String fileDirName = filePathSegments[filePathSegments.length - 1];
String[] fileDirNameSegments = fileDirName.split("---");
String fileName = fileDirNameSegments[1];
String dirName = fileDirNameSegments[0];
sysmlfile = new File(magicdrawModelsDirectory + dirName + "/" + fileName + ".mdzip");
} else {
sysmlfile = new File(magicdrawModelsDirectory + projectId + ".mdzip");
}
// final File sysmlfile = new File(magicdrawModelsDirectory +
// projectId + ".mdzip");
ProjectDescriptor projectDescriptor = ProjectDescriptorsFactory.createProjectDescriptor(sysmlfile.toURI());
projectsManager.loadProject(projectDescriptor, true);
And the code fails with same error on projectsManager.loadProject(projectDescriptor, true)