Hi,

I had experienced the same problem. Initially I had the same approach:
Create a core bundle and then another bundle (application bundle) with
my agents that would dynamically import the JADE packages. Then, from
the application bundle I used the JADE Runtime class in order to
instantiate my agents. There was a problem there with a class not found
exception (like Stefano) and I think it is based on the fact that the
core JADE bundle does not import the packages of the application bundle
and therefore cannot instantiate the agents. This is a big problem
because if the core bundle also imports the application bundle libraries
then one cannot be installed before the other on the OSGi framework.
Therefore, you need to include the JADE jars in the application bundle
(as we did in our paper) - work with one bundle.

Thank you,
Nikos

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Caire
Giovanni
Sent: Wednesday, April 18, 2007 10:48 AM
To: Stefano Lenzi; felix-dev@incubator.apache.org;
[EMAIL PROTECTED]
Subject: RE: [jade-develop] Felix/OSGi and JADE Second Part


Hi,

If I understoot the problem correctly, the solution could be to declare
the DynamicImport-package manifest header in the bundle that contains
the JADE-Core and specify * as its value. This should allow the
JADE-Core bundle to load classes from all exported packages. Let me know
if this works. In case it does :-), would you be interested in making
your work available to the community. I think it could be useful for
many people.

Bye

Giovanni 



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stefano
Lenzi
Sent: martedì 17 aprile 2007 18.55
To: felix-dev@incubator.apache.org; [EMAIL PROTECTED]
Subject: [jade-develop] Felix/OSGi and JADE Second Part

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 
[EMAIL PROTECTED]: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.

        TIP or IDEA?

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 _______________________________________________
jade-develop mailing list
[EMAIL PROTECTED]
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT 
http://jade.tilab.com/community-mailinglist.htm
_______________________________________________
jade-develop mailing list
[EMAIL PROTECTED]
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT 
http://jade.tilab.com/community-mailinglist.htm


Reply via email to