+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: Requested string is longer than available data

Hybrid View

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Requested string is longer than available data

    I have read Mike Parks stickied post re: using the same ES version for client and server. I am using Electroserver v4.0.6 on both client and server, the server is running in a Linux environment and I am using the Actionscript 2 API on the client.

    My problem arises when I attempt to send a pluginRequest from the client. Code snippet below:

    public function sendMessage(plugin:String, command:String, parameters:Array, ignored:String):Void {
    var values:EsObject = new EsObject();
    values.setString("cmd", command);
    values.setInteger("len", parameters.length);

    trace("the esObject: " + values.toString());

    var request:PluginRequest = new PluginRequest();
    request.setPluginName("game");
    request.setEsObject(values);

    _es.send(request);


    Here is the debug output on the client:
    -- the esObject: {EsObject:
    cmd:string = game
    len:integer = 1
    0:string = 23
    }
    -- [INFO] --> Sending :: conId: 0
    -- [INFO] PluginRequest: C 1 3game0113113cmd13test013len111110undefinedundefine d23
    -- [INFO] <-- Receiving :: conId: 0
    -- [INFO] GenericErrorResponse
    -- [INFO] Error occurred
    -- [INFO] PluginRequest
    -- [INFO] GenericError
    -- [INFO] --connection closed-- id: 0


    Here is the server stack trace:
    11:24:29,159 [AnonymousIoService-11] WARN com.electrotank.electroserver4.servers.gateway.Cli entIoHandler - ClientIoHandler.exceptionCaught
    java.lang.RuntimeException: Requested string is longer than available data
    at com.electrotank.electroserver4.protocol.text.Messa geStringReader._nextString(MessageStringReader.jav a:230)
    at com.electrotank.electroserver4.protocol.text.Messa geStringReader.nextInteger(MessageStringReader.jav a:44)
    at com.electrotank.electroserver4.protocol.text.Messa geStringReader.nextPrefixedString(MessageStringRea der.java:36)
    at com.electrotank.electroserver4.protocol.text.Messa geStringReader.nextString(MessageStringReader.java :40)
    at com.electrotank.electroserver4.protocol.codecs.sha red.EsObjectCodec.decode(EsObjectCodec.java:177)
    at com.electrotank.electroserver4.protocol.codecs.sha red.ClientInvokePluginRequestCodec.decode(ClientIn vokePluginRequestCodec.java:49)
    at com.electrotank.electroserver4.protocol.codecs.ext ernal.PrefixingMessageCodecDecorator.decode(Prefix ingMessageCodecDecorator.java:56)
    at com.electrotank.electroserver4.protocol.ProtocolFi lter.messageReceived(ProtocolFilter.java:119)
    at org.apache.mina.common.support.AbstractIoFilterCha in.callNextMessageReceived(AbstractIoFilterChain.j ava:299)
    at org.apache.mina.common.support.AbstractIoFilterCha in.access$1100(AbstractIoFilterChain.java:53)
    at org.apache.mina.common.support.AbstractIoFilterCha in$EntryImpl$1.messageReceived(AbstractIoFilterCha in.java:648)
    at org.apache.mina.common.IoFilterAdapter.messageRece ived(IoFilterAdapter.java:80)
    at org.apache.mina.common.support.AbstractIoFilterCha in.callNextMessageReceived(AbstractIoFilterChain.j ava:299)
    at org.apache.mina.common.support.AbstractIoFilterCha in.access$1100(AbstractIoFilterChain.java:53)
    at org.apache.mina.common.support.AbstractIoFilterCha in$EntryImpl$1.messageReceived(AbstractIoFilterCha in.java:648)
    at org.apache.mina.filter.codec.support.SimpleProtoco lDecoderOutput.flush(SimpleProtocolDecoderOutput.j ava:58)
    at org.apache.mina.filter.codec.ProtocolCodecFilter.m essageReceived(ProtocolCodecFilter.java:174)
    at org.apache.mina.common.support.AbstractIoFilterCha in.callNextMessageReceived(AbstractIoFilterChain.j ava:299)
    at org.apache.mina.common.support.AbstractIoFilterCha in.access$1100(AbstractIoFilterChain.java:53)
    at org.apache.mina.common.support.AbstractIoFilterCha in$EntryImpl$1.messageReceived(AbstractIoFilterCha in.java:648)
    at org.apache.mina.filter.executor.ExecutorFilter.pro cessEvent(ExecutorFilter.java:219)
    at org.apache.mina.filter.executor.ExecutorFilter$Pro cessEventsRunnable.run(ExecutorFilter.java:263)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at org.apache.mina.util.NamePreservingRunnabl

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    When you compiled your client, did you use the API found here? There were some bugs in the API that comes when you install 4.0.6.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah I forgot to mention that, but yes I am using the AS2 API provided in that link

  4. #4
    Junior Member
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    One thing, I'm not sure if this is relevant or not, i noticed in the debug line:

    [INFO] PluginRequest: C 1 3game0113113cmd13test013len111110undefinedundefine d23

    the undefinedundefined at the end of the message, perhaps this is significant

  5. #5
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Is the plugin you are trying to send the message to a server level plugin or a room plugin? If a server level plugin, you might want to add a logging line to the init method of it, then check the ES4 log to make sure it initializes. If it's a room plugin, you have to add the roomId and zoneId to the plugin request.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  6. #6
    Junior Member
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is a server level plugin, and it initializes without any hiccups

  7. #7
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Since TEXT protocol is the default, try removing this line and recompiling:
    _es.setProtocol(Protocol.TEXT);

    if that doesn't fix it, I'll need to build a similar client and play with it to see if it is a bug in the API that needs fixing. We don't have very many people using AS2 with ES4.0.6.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  8. #8
    Junior Member
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Tried that, still no luck

  9. #9
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Ok, I'll work on it tomorrow and let you know if I reproduce it or not. Exactly which version of ES4 are you using? Straight 4.0.6 or one of the patches? Because I don't think I have an unpatched one left.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  10. #10
    Junior Member
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Interesting, I am using ElectroServer_4_0_6_unix.tar.gz, but when i start it up it says:

    Starting ElectroServer 4.0.7-a3
    Go to http://www.electro-server.com/ for the newest version.
    -=-=-=-=-=-=-=-
    Computer Information
    Operating System: Linux
    Operating System Architecture: amd64
    Processors Available: 2
    Memory Available: 81Mb
    -=-=-=-=-=-=-=-
    Virtual Machine Information
    Virtual Machine Vendor: Sun Microsystems Inc.
    Virtual Machine Version: 1.6.0_14

    So I was wrong when I said 4.0.6 as it appears to be 4.0.7...

+ 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