操作情形:
在bookTrading例子中,开两个cmd,分别运行Seller和Buyer两个代理
>java jade.Boot -gui a1:examples.bookTrading.BookSellerAgent
>java jade.Boot -gui a2:examples.bookTrading.BookBuyerAgent("book2")
具体出错:
[jade-develop] jade.core.ProfileException: Can't get a proxy to the Platform Manager [nested jade.core.IMTPException: The Service Manager was already bound in the RMI Registry [nested java.rmi.AlreadyBoundException: ServiceManager]]
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:574)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:342)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478
)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
Nested Exception:
jade.core.IMTPException: The Service Manager was already bound in the RMI Regist
ry [nested java.rmi.AlreadyBoundException: ServiceManager]
at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.jav
a:276)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:563)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:342)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478
)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
Nested Exception:
java.rmi.AlreadyBoundException: ServiceManager
at sun.rmi.registry.RegistryImpl.bind(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
rce)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(Unknown Source)
at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.jav
a:224)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:563)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:342)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478
)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
2010-3-16 11:22:22 jade.core.Runtime$1 run
信息: JADE is closing down now.
出错原因:在同一台机子,同一个端口上启动两个Main Container ;或者同一个Container中有两个同名的Agent。
修正方法:一次同时运行两个agent
>java jade.Boot -gui a1:examples.bookTrading.BookSellerAgent a2:exam
ples.bookTrading.BookBuyerAgent("book2")
修正结果:成功
在bookTrading例子中,开两个cmd,分别运行Seller和Buyer两个代理
>java jade.Boot -gui a1:examples.bookTrading.BookSellerAgent
>java jade.Boot -gui a2:examples.bookTrading.BookBuyerAgent("book2")
具体出错:
[jade-develop] jade.core.ProfileException: Can't get a proxy to the Platform Manager [nested jade.core.IMTPException: The Service Manager was already bound in the RMI Registry [nested java.rmi.AlreadyBoundException: ServiceManager]]
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:574)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:342)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478
)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
Nested Exception:
jade.core.IMTPException: The Service Manager was already bound in the RMI Regist
ry [nested java.rmi.AlreadyBoundException: ServiceManager]
at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.jav
a:276)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:563)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:342)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478
)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
Nested Exception:
java.rmi.AlreadyBoundException: ServiceManager
at sun.rmi.registry.RegistryImpl.bind(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Sou
rce)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
ce)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(Unknown Source)
at jade.imtp.rmi.RMIIMTPManager.exportPlatformManager(RMIIMTPManager.jav
a:224)
at jade.core.ProfileImpl.createPlatformManager(ProfileImpl.java:563)
at jade.core.ProfileImpl.getPlatformManager(ProfileImpl.java:487)
at jade.core.ProfileImpl.getServiceManager(ProfileImpl.java:501)
at jade.core.AgentContainerImpl.init(AgentContainerImpl.java:342)
at jade.core.AgentContainerImpl.joinPlatform(AgentContainerImpl.java:478
)
at jade.core.Runtime.createMainContainer(Runtime.java:148)
at jade.Boot.<init>(Boot.java:130)
at jade.Boot.main(Boot.java:70)
2010-3-16 11:22:22 jade.core.Runtime$1 run
信息: JADE is closing down now.
出错原因:在同一台机子,同一个端口上启动两个Main Container ;或者同一个Container中有两个同名的Agent。
修正方法:一次同时运行两个agent
>java jade.Boot -gui a1:examples.bookTrading.BookSellerAgent a2:exam
ples.bookTrading.BookBuyerAgent("book2")
修正结果:成功