[Pogamut-list] Multiple Servers in 3.2

jacob.schrum pogamut-forum at diana.ms.mff.cuni.cz
Thu Apr 21 19:03:32 CEST 2011


Multiple Servers in 3.2

Author: jacob.schrum

I have some code that more-or-less worked in previous versions of Pogamut to launch multiple servers on the same machine for the purpose of evolution. Each server used its own ports, had its own bots, etc.

After upgrading to 3.2, when I run this code I encounter errors like the following:
java.lang.IllegalAccessException: Class cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.ItemDescriptor can not access a member of class cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.WeaponDescriptor with modifiers "private"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.reflect.Field.doSecurityCheck(Field.java:960)
        at java.lang.reflect.Field.getFieldAccessor(Field.java:896)
        at java.lang.reflect.Field.set(Field.java:657)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.ItemDescriptor.doReflexion(ItemDescriptor.java:87)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.WeaponDescriptorFactory.getNewDescriptor(WeaponDescriptorFactory.java:22)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.ItemTranslator.createDescriptor(ItemTranslator.java:108)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.server.state.ItemCategoryState.innerStateSymbol(ItemCategoryState.java:56)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.server.state.ItemCategoryState.innerStateSymbol(ItemCategoryState.java:22)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.server.support.AbstractServerFSMState.stateSymbol(AbstractServerFSMState.java:27)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.server.support.AbstractServerFSMState.stateSymbol(AbstractServerFSMState.java:17)
        at cz.cuni.amis.fsm.FSM$StateWrapper.stateSymbol(FSM.java:181)
        at cz.cuni.amis.fsm.FSM$StateWrapper.pushSymbol(FSM.java:187)
        at cz.cuni.amis.fsm.FSM.push(FSM.java:361)
        at cz.cuni.amis.pogamut.ut2004.communication.translator.server.ServerFSM.processMessage(ServerFSM.java:38)
        at cz.cuni.amis.pogamut.base.communication.translator.impl.WorldMessageTranslator.processMessage(WorldMessageTranslator.java:102)
        at cz.cuni.amis.pogamut.base.communication.translator.impl.WorldMessageTranslator.getEvent(WorldMessageTranslator.java:123)
        at cz.cuni.amis.pogamut.base.communication.mediator.impl.Mediator$Worker.run(Mediator.java:299)

I'm pretty sure I might have had this problem in 3.1 as well, but I did a hack solution and basically edited your source so that the relevant fields were public instead of private. However, I would rather fix the problem properly this time. Is information inadvertently being shared between servers?

By the way, I also tried a small test using your new DeathMatch1vNative example code. I basically modified it to launch two instances of UT2004DeathMatch in separate Threads, and I received the same error.

Lastly, I'm interested to know if there is any more intelligent way to launch multiple servers on the same machine. If there is good clean code in the new version, I would prefer to use it. Even if the code is sloppy, just looking at it might give me some ideas on how to improve mine.

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_parentId=676#form>





More information about the Pogamut-list mailing list