Julia Damerow - 2012-01-09

If you work on old projects with a newer version of Virtual Spaces you might get the following error message when you try to generate your HTML:

null
Stacktrace is : 
java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at de.mpiwg.vspace.generation.control.service.GenerationService$1.run(GenerationService.java:235)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3593)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3286)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at de.mpiwg.vspace.diagram.application.ExhibitionApplication.start(ExhibitionApplication.java:91)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: java.lang.NullPointerException
    at de.mpiwg.vspace.java.transformation.navigation.VirtualSpaceNavigationCreator.getChildren(VirtualSpaceNavigationCreator.java:27)
    at de.mpiwg.vspace.java.transformation.managers.NavigationCreatorManager.createNavigation(NavigationCreatorManager.java:50)
    at de.mpiwg.vspace.java.transformation.managers.TransformationManager.startTransformationVirtualSpace(TransformationManager.java:57)
    at de.mpiwg.vspace.java.transformation.service.VirtualSpaceTransformator.runTransformation(VirtualSpaceTransformator.java:28)
    at de.mpiwg.vspace.generation.control.internal.DefaultGenerationController.start(DefaultGenerationController.java:63)
    at de.mpiwg.vspace.languages.generation.LanguageGenerationController.start(LanguageGenerationController.java:22)
    at de.mpiwg.vspace.generation.control.internal.GenerationRunnable.run(GenerationRunnable.java:132)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

To resolve that error there are two ways:
1) Use at least Virtual Spaces version 1.5.3 and import your project. It will be updated to the newest version and the error should appear.
2) If you for some reason can't do that, do the following:
   - Go to your project folder in your filesystem and locate the file model.exhibition.
   - Open the file and paste the following code before last line that says:

</de.mpiwg.vspace.metamodel:Exhibition>

    

<moduleCategoryContainer>
    <linkedContainer href="moduleCategories.cats#/"/>
</moduleCategoryContainer>

  - Save the file and close it.
  - Create a new file in the project folder named: moduleCategories.cats and paste the following code in it.

<?xml version="1.0" encoding="UTF-8"?>
<de.mpiwg.vspace.metamodel:LinkedModuleCategoryContainer xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:de.mpiwg.vspace.metamodel="http:///org/jat/exhibition.ecore"/>

  - Save the file.
  - Restart Virtual Spaces. Generation should now work.