Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344356

Summary: Can't launch Escape models.
Product: [Modeling] AMP Reporter: Miles Parker <milesparker>
Component: AMF UIAssignee: Miles Parker <milesparker>
Status: RESOLVED FIXED QA Contact: Miles Parker <milesparker>
Severity: major    
Priority: P3 CC: jonas.ruettimann
Version: 0.9.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Miles Parker CLA 2011-04-29 19:01:14 EDT
When launching models from a running AMP instance a Runtime exception occurs. This appears to be a class loading problem introduced by the newer project loading mechanism, but perhaps simply has to do with project setup.

Couldn't create project classloader; falling back to default loader

org.eclipse.amp.escape.ide.LoaderCreationException: Problem creating classloaders.
	at org.eclipse.amp.escape.ide.ProjectLoader.<init>(ProjectLoader.java:79)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:138)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:105)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:88)
	at org.eclipse.amp.escape.amf.ide.ExecuteAMFHandler.executeOpen(ExecuteAMFHandler.java:56)
	at org.eclipse.amp.escape.command.ExecuteHandler$1.run(ExecuteHandler.java:63)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.IllegalStateException: Bundle cannot be found: org.eclipse.amp.escape.runtime
	at org.eclipse.amp.escape.ide.ProjectLoader.readDependencies(ProjectLoader.java:113)
	at org.eclipse.amp.escape.ide.ProjectLoader.<init>(ProjectLoader.java:73)
	... 6 more

This leads to:

java.lang.RuntimeException: Couldn't find class: edu.brook.DemographicPrisonersDilemma
	at org.ascape.runtime.Runner.instanceFromName(Runner.java:925)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:150)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:105)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:88)
	at org.eclipse.amp.escape.amf.ide.ExecuteAMFHandler.executeOpen(ExecuteAMFHandler.java:56)
	at org.eclipse.amp.escape.command.ExecuteHandler$1.run(ExecuteHandler.java:63)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

java.lang.RuntimeException: Couldn't find class: edu.brook.DemographicPrisonersDilemma
	at org.ascape.runtime.Runner.instanceFromName(Runner.java:925)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:150)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:105)
	at org.eclipse.amp.escape.ide.EclipseEscapeRunner.open(EclipseEscapeRunner.java:88)
	at org.eclipse.amp.escape.amf.ide.ExecuteAMFHandler.executeOpen(ExecuteAMFHandler.java:56)
	at org.eclipse.amp.escape.command.ExecuteHandler$1.run(ExecuteHandler.java:63)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


This
Comment 1 Miles Parker CLA 2011-04-29 19:19:49 EDT
OK, I think I was able to make a quick fix of this. Jonas, please see:

http://git.eclipse.org/c/amp/org.eclipse.amp.git/commit/?id=18c4e67c70565855d426d85782a699244a6c4019

And let me know if the logic looks right. I think the idea that the code was going for is that the bundle is ok if either a) there is no additional directive or b) the directive is optional. Is that correct?
Comment 2 Jonas Ruttimann CLA 2011-05-24 10:34:02 EDT
This is a bug, indeed. But I think the bugfix is not quite error free.

The intention is to make the project loader use all available plugins that are set as dependencies in the MANIFEST.MF file. Those that are marked as optional only need to be loaded if they are available. If a required plugin is missing, this should lead to an error.

I've corrected this bug and added a test class to make sure this works now. You might want to add more test cases to make sure you're not getting your error again.
 

(In reply to comment #1)
> OK, I think I was able to make a quick fix of this. Jonas, please see:
> 
> http://git.eclipse.org/c/amp/org.eclipse.amp.git/commit/?id=18c4e67c70565855d426d85782a699244a6c4019
> 
> And let me know if the logic looks right. I think the idea that the code was
> going for is that the bundle is ok if either a) there is no additional
> directive or b) the directive is optional. Is that correct?