Fcoder
Fcoder

Reputation: 9226

JADE Agent doesn't added to Agents list

i want to run a simple agent in JADE environment(Mac OSX El Capitan, Jade 4.4.0), this is my Agent code:

public class BookBuyerAgent extends Agent {
    protected void setup() {
        // Printout a welcome message
        System.out.println("Hello World! My name is "+getLocalName());

    }
}

i set CLASSPATH in bash_profile like this:

export CLASSPATH=/Users/John/jade/lib/jade.jar:/Users/John/jade/lib/jadeExamples.jar:/Users/John/jade/lib/commons-codec/commons-codec-1.3.jar:/Users/John/jade/src/jade/:/Users/John/Desktop/

Im running my agent like this:

java  jade.Boot -gui -agents buyer:com.app.jade.BookBuyerAgent

but i get this warning:

WARNING: Automatic main-detection mechanism initialization failed (Error setting up multicast socket - Caused by:  Can't assign requested address). Mechanism disabled!

an then this error:

SEVERE: Cannot create agent buyer: Class com.app.jade.BookBuyerAgent for agent ( agent-identifier :name [email protected]:1099/JADE ) not found - Caused by:  com.app.jade.BookBuyerAgent

and after that, Jade GUI appears but my agent does not added to agents list and it doesn't work. i checked everything but i don't know what's the problem.

this is full message i get:

Feb 27, 2016 4:14:59 PM jade.core.Runtime beginContainer
INFO: ----------------------------------
    This is JADE 4.4.0 - revision 6778 of 21-12-2015 12:24:43
    downloaded in Open Source, under LGPL restrictions,
    at http://jade.tilab.com/
----------------------------------------
Feb 27, 2016 4:14:59 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://192.168.1.4:1099

Feb 27, 2016 4:14:59 PM jade.core.AgentContainerImpl init
WARNING: Automatic main-detection mechanism initialization failed (Error setting up multicast socket - Caused by:  Can't assign requested address). Mechanism disabled!
Feb 27, 2016 4:15:01 PM jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
Feb 27, 2016 4:15:01 PM jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
Feb 27, 2016 4:15:01 PM jade.core.BaseService init
INFO: Service jade.core.resource.ResourceManagement initialized
Feb 27, 2016 4:15:01 PM jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
Feb 27, 2016 4:15:01 PM jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
Feb 27, 2016 4:15:31 PM jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Feb 27, 2016 4:15:31 PM jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://192.168.1.4:7778/acc
Feb 27, 2016 4:15:31 PM jade.core.AgentContainerImpl startBootstrapAgents
SEVERE: Cannot create agent buyer: Class com.app.jade.BookBuyerAgent for agent ( agent-identifier :name [email protected]:1099/JADE ) not found - Caused by:  com.app.jade.BookBuyerAgent
Feb 27, 2016 4:15:31 PM jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container [email protected] is ready.

Upvotes: 1

Views: 1008

Answers (1)

user8751092
user8751092

Reputation:

I am not sure if I understood the issue, but for the warning, here what I've found: This warning tells that the automatic main detection mechanism (i.e. the mechanism by means of which a peripheral container is able to automatically discover where the Main Container is running) is disabled since the underlying network stack does not support IP-multicast (this is always the case for instance when you work on a Windows XP PC not connected to the network). Provided that, when starting a peripheral container you explicitly specify the host and port of the Main Container (when different from the default ones), you can forget about this warning.

For deploying agents (Assuming there is a container deployed)

java  jade.Boot -container -host localhost -agents buyer:com.app.jade.BookBuyerAgent

Upvotes: 1

Related Questions