You can do this be specifying the jar in the score file, I think. The implementation element has an optional "binDir" attribute and you should be able to specify your jar in the implementation element for the root context. More than one path, jar file can be specified in the birDir by separating them with a ",". Note that the binDir is relative to the implementation basePath attribute. 

This is obviously not ideal and should be easier in future versions.


On Jul 20, 2009, at 7:58 AM, John Tranier wrote:


I come back again with the classpath issue I've posted some time ago.
Now I've figured out what is the problem, but not how to solve it.

I'm OK with loading an external JAR in general. It works since I add the JAR file to the Build classpath and to the Runtime classpath.
The problem is that my current JAR file is an extension of Repast (the classes of my API extend Repast classes). Thus, there is a circular reference ... 

At the moment, I get the following error when I run the model: 
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: repast/simphony/context/DefaultContext

What I understand is that the Repast classes are loaded in a different ClassLoader, and so my API does not have access to it.
Perhaps the solution would be to add my JAR file not to the standard Runtime ClassLoader, but to the one used by Repast.
The problem is I don't know how to do that ...


Le 18 mars 09 à 16:01, John Tranier a écrit :

Hi all,

I'm facing a problem using an external library within my Repast project.
I use the Repast Symphony 1.2.0.
I have added the JAR file I need within the lib subdirectory and I've also added this JAR files as an external JAR in the settings of eclipse.
It works properly when I run my model from eclipse, but it doesn't work when I run it from a standalone version obtained with the installer.
It leads to the following error: "java.lang.NoClassDefFoundError: masq/kernel/Mind"... Of course this class belong to the JAR file.

What should I do to make Repast aware of that external JAR file ?

Thanks for support,

Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge_______________________________________________
Repast-interest mailing list