Ali Abdulaziz
2014-08-03 12:20:50 UTC
Dear founders of JADE and all,
I posting this after visiting all possibly related posts to my issue and
could not find an exact solution.
I employing Jade in my master degree research project. That is, I would like
to create Intra-platforms from an external java application. by revising
all documents in the website especially "administration" one, this would be
similar to the scenario of launching several platforms using Command-line in
Windows environment as the following using windows :
--------------------------------
First platform
open a CMD
type : java jade.Boot -gui -platform-id Platform
this will initiate a platform named Platform, in which, its AMS would be
reached in this address AMS at Platform
------------------------------
Second platform
open a "new" another CMD
type : java jade.Boot -gui -platform-id Platform -local-port 1111
this will initiate a platform named Platform, in which , its AMS would be
reached in this address AMS at Platform2
---------------------------------
and so on.
now this would work perfectly using the command line, as we can see
different platforms with different IDs and ports can be launched such that
Agents that live in them can communicate with other agents in the same
platform or in remote platform.
however, I tried doing the same launching using external java application
and could not succeed in doing so.
it only succeed in initiating the first platform, but it would not in the
rest platforms.
this is my code
#####################################################################
Profile p1 = new ProfileImpl(true);
p1.setParameter(ProfileImpl.PLATFORM_ID, "platform"+ID); // ID range from 1
to 10
p1.setParameter(Profile.LOCAL_PORT, Integer.toString(port)); // available
port
Runtime.instance().setCloseVM(true)
ContainerController mc = Runtime.instance().createMainContainer(p1); // I
need to have a main container for each platform
#####################################################################
then I get this error
####################################################################
Aug 03, 2014 9:42:26 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://10.1.1.5:1024
- jicp://10.1.1.5:1025
Aug 03, 2014 9:42:26 PM jade.core.AgentContainerImpl joinPlatform
SEVERE: Some problem occurred while joining agent platform.
jade.core.ProfileException: Can't get a proxy to the Platform Manager -
Caused by: Wrong platform name platform1. It should be platform2
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:529)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:442)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:456)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:346)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:492)
at jade.core.Runtime.createMainContainer(Runtime.java:166)
at intiator.intiatePlatform(intiator.java:49)
at MainLauncher.main(MainLauncher.java:69)
Nested Exception:
jade.core.IMTPException: Wrong platform name platform1. It should be
platform2
at
jade.imtp.leap.CommandDispatcher.setPlatformManager(CommandDispatcher.java:231)
at
jade.imtp.leap.CommandDispatcher.registerSkeleton(CommandDispatcher.java:736)
at
jade.imtp.leap.LEAPIMTPManager.exportPlatformManager(LEAPIMTPManager.java:198)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:518)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:442)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:456)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:346)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:492)
at jade.core.Runtime.createMainContainer(Runtime.java:166)
at intiator.intiatePlatform(intiator.java:49)
at MainLauncher.main(MainLauncher.java:69)
Exception in thread "main" java.lang.NullPointerException
at intiator.intiatePlatform(intiator.java:58)
at MainLauncher.main(MainLauncher.java:69)
#####################################################################
So I would like to make it successfully using code as it would be using
Command-line
Thank you
--
View this message in context: http://jade.17737.x6.nabble.com/running-multi-platfrom-from-an-external-java-application-tp5002672.html
Sent from the JADE - Dev mailing list archive at Nabble.com.
I posting this after visiting all possibly related posts to my issue and
could not find an exact solution.
I employing Jade in my master degree research project. That is, I would like
to create Intra-platforms from an external java application. by revising
all documents in the website especially "administration" one, this would be
similar to the scenario of launching several platforms using Command-line in
Windows environment as the following using windows :
--------------------------------
First platform
open a CMD
type : java jade.Boot -gui -platform-id Platform
this will initiate a platform named Platform, in which, its AMS would be
reached in this address AMS at Platform
------------------------------
Second platform
open a "new" another CMD
type : java jade.Boot -gui -platform-id Platform -local-port 1111
this will initiate a platform named Platform, in which , its AMS would be
reached in this address AMS at Platform2
---------------------------------
and so on.
now this would work perfectly using the command line, as we can see
different platforms with different IDs and ports can be launched such that
Agents that live in them can communicate with other agents in the same
platform or in remote platform.
however, I tried doing the same launching using external java application
and could not succeed in doing so.
it only succeed in initiating the first platform, but it would not in the
rest platforms.
this is my code
#####################################################################
Profile p1 = new ProfileImpl(true);
p1.setParameter(ProfileImpl.PLATFORM_ID, "platform"+ID); // ID range from 1
to 10
p1.setParameter(Profile.LOCAL_PORT, Integer.toString(port)); // available
port
Runtime.instance().setCloseVM(true)
ContainerController mc = Runtime.instance().createMainContainer(p1); // I
need to have a main container for each platform
#####################################################################
then I get this error
####################################################################
Aug 03, 2014 9:42:26 PM jade.imtp.leap.LEAPIMTPManager initialize
INFO: Listening for intra-platform commands on address:
- jicp://10.1.1.5:1024
- jicp://10.1.1.5:1025
Aug 03, 2014 9:42:26 PM jade.core.AgentContainerImpl joinPlatform
SEVERE: Some problem occurred while joining agent platform.
jade.core.ProfileException: Can't get a proxy to the Platform Manager -
Caused by: Wrong platform name platform1. It should be platform2
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:529)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:442)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:456)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:346)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:492)
at jade.core.Runtime.createMainContainer(Runtime.java:166)
at intiator.intiatePlatform(intiator.java:49)
at MainLauncher.main(MainLauncher.java:69)
Nested Exception:
jade.core.IMTPException: Wrong platform name platform1. It should be
platform2
at
jade.imtp.leap.CommandDispatcher.setPlatformManager(CommandDispatcher.java:231)
at
jade.imtp.leap.CommandDispatcher.registerSkeleton(CommandDispatcher.java:736)
at
jade.imtp.leap.LEAPIMTPManager.exportPlatformManager(LEAPIMTPManager.java:198)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:518)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:442)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:456)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:346)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:492)
at jade.core.Runtime.createMainContainer(Runtime.java:166)
at intiator.intiatePlatform(intiator.java:49)
at MainLauncher.main(MainLauncher.java:69)
Exception in thread "main" java.lang.NullPointerException
at intiator.intiatePlatform(intiator.java:58)
at MainLauncher.main(MainLauncher.java:69)
#####################################################################
So I would like to make it successfully using code as it would be using
Command-line
Thank you
--
View this message in context: http://jade.17737.x6.nabble.com/running-multi-platfrom-from-an-external-java-application-tp5002672.html
Sent from the JADE - Dev mailing list archive at Nabble.com.