Bug 480140 - ClassNotFoundException at the loading of generated class
Summary: ClassNotFoundException at the loading of generated class
Status: NEW
Alias: None
Product: PMF
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: ---   Edit
Assignee: El-Amine Ouraiba CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 12:32 EDT by Faycal Abka CLA
Modified: 2015-11-25 14:14 EST (History)
1 user (show)

See Also:


Attachments
Test case to reproduce the bug (443.40 KB, application/zip)
2015-10-19 12:32 EDT, Faycal Abka CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Faycal Abka CLA 2015-10-19 12:32:03 EDT
Created attachment 257359 [details]
Test case to reproduce the bug

I try PMF with simple example with this scenario:
1. I created an Ecore (Example.ecore) with an EClass called: NamedClass which contains one EString attribute name.
2. I created a PMF application "ExampleApplication.pmf" and import my model
3. I created a container, Property part and property tab as content a dataform generated by importing my model.
4. I Generate the PMF application:
   I fill the properties of the Properties.fcore with the model, context...

at this the end of the generation, some export packages are missing in my MANIFEST.MF (messages, validator, menus). I add the these package by hand

5. I create a new class that extends the Example editor and implements ITabbedPropertySheetPageContributor.

6. I launch a runtime, than, I create example model. And when I selected the instance of my NamedClass a get java.lang.ClassNotFoundException (see the stack below)


This class NamedclassView is not generated in the package example.ui.properties.views, but, in the example.ui.properties and it name is duplicated (NamedClassNamedClassView.java)!
In the associated xwt file, this class is referenced as example.ui.properties.views.NamedClassView


java.lang.ClassNotFoundException: example.ui.properties.views.NamedClassView
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:131)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at example.ui.properties.part.XWTSectionDescriptor.getSectionClass(XWTSectionDescriptor.java:57)
	at org.eclipse.ui.views.properties.tabbed.AbstractTabDescriptor.createTab(AbstractTabDescriptor.java:64)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.createTab(TabbedPropertySheetPage.java:695)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.updateTabs(TabbedPropertySheetPage.java:669)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.setInput(TabbedPropertySheetPage.java:736)
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.selectionChanged(TabbedPropertySheetPage.java:556)
	at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:335)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService.notifyListeners(SelectionService.java:237)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService.handlePostSelectionChanged(SelectionService.java:122)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService.access$1(SelectionService.java:112)
	at org.eclipse.ui.internal.e4.compatibility.SelectionService$3.selectionChanged(SelectionService.java:80)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$4.run(SelectionAggregator.java:167)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.notifyPostListeners(SelectionAggregator.java:164)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator.access$8(SelectionAggregator.java:161)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$8$1.run(SelectionAggregator.java:273)
	at org.eclipse.e4.core.contexts.RunAndTrack.runExternalCode(RunAndTrack.java:56)
	at org.eclipse.e4.ui.internal.workbench.SelectionAggregator$8.changed(SelectionAggregator.java:270)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:114)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:341)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:356)
	at org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl.setPostSelection(SelectionServiceImpl.java:36)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart$3.selectionChanged(CompatibilityPart.java:132)
	at example.presentation.ExampleEditor.setSelection(ExampleEditor.java:1684)
	at example.presentation.ExampleEditor$6.selectionChanged(ExampleEditor.java:887)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
	at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2197)
	at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1228)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1257)
	at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242)
	at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:236)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:408)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.polarsys.capella.studio.product.Application.start(Application.java:127)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Comment 1 El-Amine Ouraiba CLA 2015-11-25 14:14:43 EST
Hi Faycal,

The problem is in "Propertie.fcore" of your generator "org.eclipse.pmf.ui.tools.properties" :

1. in the Production Plan "Generate classes and XWT files", exactly in the invocation Contact "model.package.name". The String must be defined as : "example.ui.properties.views".

2. the same Bug 482259:  in the method "generate" in the pattern "XWTTabDescriptorProvider", the variable <%=className%> will be declared as : 
String className = parameter.getName() + ".views." + content.getDataContextType().getName() + content.getName() + "View". 

 
Best,