+ Reply to Thread
Results 1 to 4 of 4

Thread:

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hi there. I'm having problems with the ElectroServer, everynow and then the server crashes and I can't find the reason.

    The problem occurs when a user tries to create a room, the Lobby room for a game .

    The room has the following settings:
    Code:
        var roomObj:Object = new Object();
        roomObj.zone = "XXD";
        roomObj.roomName = selected_room;
        roomObj.description = "Lobby";
        roomObj.userVariablesEnabled = true;
    
        roomObj.plugins = new Array();
        roomObj.plugins.push({name:lobbyPlugin});
    
        es.createUserVariable("sex", sex);
        es.createUserVariable("xxdid", xxd_id);
        es.createUserVariable("isBusy", "false");
    
        es.createRoom(roomObj);

    This are the errors I get, plus some trace messages I make:
    [code]
    ---- XXDLobby Plug-in Initialized ----
    Zone name: XXD
    Room name: anfitrion


    User entered: nitram
    User left: nitram
    ---- XXDLobby Plug-in removed ----
    2006/08/08 17:21:06.828 SEVERE [28] (XmlHelper.buildRoomFromXml): Error building room level plugin. Message = null
    java.lang.NullPointerException
    org.apache.xpath.XPathAPI.eval(Unknown Source)
    org.apache.xpath.XPathAPI.selectNodeIterator(Unkno wn Source)
    org.apache.xpath.XPathAPI.selectSingleNode(Unknown Source)
    org.apache.xpath.XPathAPI.selectSingleNode(Unknown Source)
    com.electrotank.electroserver.utilities.XmlHelper. loadSingleNodeAsString(XmlHelper.java:798)
    com.electrotank.electroserver.utilities.Properties Loader.buildPlugin(PropertiesLoader.java:557)
    com.electrotank.electroserver.utilities.Properties Loader.loadRoomPlugin(PropertiesLoader.java:538)
    com.electrotank.electroserver.utilities.XmlHelper. buildRoomFromXml(XmlHelper.java:963)
    com.electrotank.electroserver.transactions.CreateR oomTransaction.createRoom(CreateRoomTransaction.ja va:124)
    com.electrotank.electroserver.transactions.CreateR oomTransaction.execute(CreateRoomTransaction.java: 79)
    com.electrotank.electroserver.transactions.Transac tionHandler.handleTransaction(TransactionHandler.j ava:160)
    com.electrotank.electroserver.ChatProtocol.process Message(ChatProtocol.java:223)
    org.ronsoft.protoplex.generic.AbstractGenericServe r.drainQueuedMessages(AbstractGenericServer.java:1 44)
    org.ronsoft.protoplex.nioimpl.server.NioServer.dra inQueuedMessages(NioServer.java:471)
    org.ronsoft.protoplex.nioimpl.server.NioConnection .handleReadySelection(NioConnection.java:177)
    org.ronsoft.protoplex.nioimpl.server.Dispatcher$Ha ndlerAdapter.run(Dispatcher.java:469)
    EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Wo rker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
    2006/08/08 17:21:37.813 SEVERE [29] (XmlHelper.buildRoomFromXml): Error building room level plugin. Message = null
    java.lang.NullPointerException
    org.apache.xpath.XPathAPI.eval(Unknown Source)
    org.apache.xpath.XPathAPI.selectNodeIterator(Unkno wn Source)
    org.apache.xpath.XPathAPI.selectSingleNode(Unknown Source)
    org.apache.xpath.XPathAPI.selectSingleNode(Unknown Source)
    com.electrotank.electroserver.utilities.XmlHelper. loadSingleNodeAsString(XmlHelper.java:798)
    com.electrotank.electroserver.utilities.Properties Loader.buildPlugin(PropertiesLoader.java:557)
    com.electrotank.electroserver.utilities.Properties Loader.loadRoomPlugin(PropertiesLoader.java:538)
    com.electrotank.electroserver.utilities.XmlHelper. buildRoomFromXml(XmlHelper.java:963)
    com.electrotank.electroserver.transactions.CreateR oomTransaction.createRoom(CreateRoomTransaction.ja va:124)
    com.electrotank.electroserver.transactions.CreateR oomTransaction.execute(CreateRoomTransaction.java: 79)
    com.electrotank.electroserver.transactions.Transac tionHandler.handleTransaction(TransactionHandler.j ava:160)
    com.electrotank.electroserver.ChatProtocol.process Message(ChatProtocol.java:223)
    org.ronsoft.protoplex.generic.AbstractGenericServe r.drainQueuedMessages(AbstractGenericServer.java:1 44)
    org.ronsoft.protoplex.nioimpl.server.NioServer.dra inQueuedMessages(NioServer.java:471)
    org.ronsoft.protoplex.nioimpl.server.NioConnection .handleReadySelection(NioConnection.java:177)
    org.ronsoft.protople

  2. #2
    Electrotank jobem's Avatar
    Join Date
    Apr 2004
    Posts
    996
    Thanks
    0
    Thanked 24 Times in 17 Posts
    Hi,

    How often does it happen? Sounds like its *probably* an intermitten issue that occurs in your pluginInit event.

    Can we see it?
    ------
    Jobe Makar
    @jobemakar
    http://www.electrotank.com

    YouTube ElectroServer video tutorials
    http://www.youtube.com/user/ElectrotankInc

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi. It happen twice, with 1 day of difference. I solved the problem by re-initializing the Electroserver.
    I should mention that the ElectroServer is installed on a remote server and working with 2 enviroments (a production env. and a testing env., each with different url's). The configuration file is something like the following:

    Code:
        
          <Name>LobbyPlugin</Name>
          Script
          <Scope>Room
          <File>plugins\LobbyPlugin.as</File>
          <Variables/>
        </Plugin>
    
        
          <Name>GamePlugin</Name>
          Script
          <Scope>Room
          <File>plugins\GamePlugin.as</File>
          <Variables/>
        </Plugin>
    
        
          <Name>LobbyPlugin_v3</Name>
          Script
          <Scope>Room
          <File>plugins\LobbyPlugin_v3.as</File>
          <Variables/>
        </Plugin>
    
        
          <Name>GamePlugin_v3</Name>
          Script
          <Scope>Room
          <File>plugins\GamePlugin_v3.as</File>
          <Variables/>
        </Plugin>
    Where LobbyPlugin and GamePlugin are the plugins for the production url, and the LobbyPlugin_v3 and GamePlugin_v3 for the testing url.
    We also create rooms with different names, like "Lobby" for productions and "Lobby_v3" in testing so we can test without disturbing a stable version of our game.

    All the problems occurred on the testing url. The stable version works fine. The funny thing is that the error came out from nowhere, it was working fine for a couple of days and all of a sudden the test version crashed, and 1 day later, again. When we tested it in localhost, it worked perfectly so I have no clue.

    After re-initializing the electroserver, it all worked out fine until this very moment, but we can't take our beta version of the game to a stable version having this unexpected "random" errors.


    This is the first part of the code of my plugin, the only parts that aren't here are a couple of functions to process the lobby invitations, nothing too complex:


    [code]

    // ################################################## ###########################
    // VARIABLES
    // ################################################## ###########################
    var gameName = "MyGame";
    var plugin1 = "GamePlugin";



    // ################################################## ###########################
    // TRACE FUNCTIONS
    // ################################################## ###########################
    function traceNewLine() {
    trace("\n");
    }


    function traceUserVariables(user) {
    var userVars = getUserVariables(user);

    trace("[User Variables for " + user + "]");
    for(var i=0; i<userVars.length; i++) {
    var userVar = userVars[i];
    var varName = userVar.name;
    var varValue = userVar.value;
    trace(varName + "=" + varValue);
    };
    }


    function traceRoomVariables() {
    var roomVars = getRoomVariables();

    trace("[Room Variables]");

    for(var i=0; i<roomVars.length; ++i) {
    var roomVar = roomVars[i];
    var varName = roomVar.name;
    trace(varName + " = " + roomVar.value + " locked: " + roomVar.locked + ", persistent: " + roomVar.persistent);
    };
    }



    // ################################################## ###########################
    // USER AND ROOM VARIABLES FUNCTIONS
    // ################################################## ###########################

    function getUserVar(username, varName) {
    var i;
    var userVars;
    var returnValue = "";

    //trace(getPluginName() + "->getUserVar");
    //trace("User: " + username);

    userVars = getUserVariables(username);

    if(userVars.length > 0) {
    for(i=0; i<userVars.length; ++i) {
    var userVar = userVars[i];
    var name = userVar.name;
    var value = userVar.value;
    //trace(name + " = " + value);

    if(name == varName) {
    returnValue = value;
    };
    };

    };

    return returnValue;
    }


    // ################################################## ###########################
    // PLUG-IN FUNCTIONS
    // ############

  4. #4
    Electrotank jobem's Avatar
    Join Date
    Apr 2004
    Posts
    996
    Thanks
    0
    Thanked 24 Times in 17 Posts
    Hi Federico,

    Mike and I have looked into your error. We were able to reproduce it on our site (not using your plugins) based on a guess.

    It turns out that this *exact* error occurs when you pass in a plugin name to be created, and that plugin name does not exist in the configuration file.

    So it sounds like 1 of 2 possible issues:
    1) That plugin doesn't exist in the config file.
    or
    2) There is a client-side bug that occurs occasionally. This bug passes the incorrect (or no) plugin name back to ElectroServer.

    I noticed that you have this line of code:
    Code:
    roomObj.plugins.push({name:lobbyPlugin});
    I was assuming that 'lobbyPlugin' was a variable reference. Perhaps that reference gets changed or killed sometimes.

    So just to be clear: this does not appear to be an ElectroServer bug, but more a client or configuration bug. We have made an update to ElectroServer for the next release so that the error that occurs will explain a little better what is happening.

    If you need that new build of ES early to help you in debugging, then I'll see what I can do.
    ------
    Jobe Makar
    @jobemakar
    http://www.electrotank.com

    YouTube ElectroServer video tutorials
    http://www.youtube.com/user/ElectrotankInc

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts