felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Lenzi <kis...@interfree.it>
Subject Felix/OSGi and JADE Second Part
Date Tue, 17 Apr 2007 16:55:26 GMT
Hi All,
	I had a chance to clarify my idea and to do more tests. Here is what I 
got and I hope that you can help me to find a solution.
	GOAL: The Goal is to run JADE over OSGi so that agents can be installed 
as bundle and executed when the bundle starts.

	APPROCH: I have created a JADE-Core bundle that contains all the 
library used by JADE(e.g.: core, toosl and MTPs). Then I have created a 
JADE-Example bundle that contains all the example that came with JADE 
and it also contains a BundleActivator that during the start method 
executes the setup of the JADE Platform and launches all the agent 
required by the example.

	THE PROBLEM: During the start up of the JADE Platform I get the Class 
Not Found error message that states:

"GRAVE: Cannot create agent Buyer-Alpha: Class 
examples.bookTrading.BookBuyerAgent for agent ( agent-identifier :name 
Buyer-Alpha@asuka:1099/JADE ) not found [nested 
java.lang.ClassNotFoundException: *** Class 
'examples.bookTrading.BookBuyerAgent' was not found because bundle 12 
does not import 'examples.bookTrading' even though bundle 13 does export 
it. Additionally, the class is also available from the system class 
loader. There are two fixes: 1) Add an import for 'examples.bookTrading' 
to bundle 12; imports are necessary for each class directly touched by 
bundle code or indirectly touched, such as super classes if their 
methods are used. 2) Add package 'examples.bookTrading' to the 
'org.osgi.framework.bootdelegation' property; a library or VM bug can 
cause classes to be loaded by the wrong class loader. The first approach 
is preferable for preserving modularity. ***]"

	DEPLOY AND RUNTIME INFORMATION: As you already know I have 2 bundles: 
JADE-Core and JADE-Examples. The former contains the Boot class that is 
the class in charge of the startup of the JADE platform, the latter 
contains some of the Agent that I want to run on the JADE Platform.
JADE-Examples imports all the packages exported by JADE-Core, thus the 
Boot class. But during the JADE Platform startup (made by Boot and other 
classes) the method Class.loadForName() is invoked and it returns the 
the above error.


Stefano "Kismet" Lenzi

P.S.: Sorry for the long post... If you want I can give you more details...
P.P.S.: It's my first Class Loading headache :S
P.P.P.S.: As you can see I have cross posted the message to Felix and JADE

View raw message