[Red5] My persistent so's stopped working between RC1 and RC2[issue found, mixed arrays!?]

Andy Shaules bowljoman at hotmail.com
Fri Mar 27 07:26:49 PST 2009


Shared objects might have stopped working when you upgraded your flash player to a version which defaults to AMF3, and you didnts explicitly set it to AMF0.

Occasionally I see issues using amf3 and shared objects. And notice I wrote 'might'.  It may be legitamate bug.

However consider that if you are not requireing your clients to use higher versions of flash, they may connect with a defaulting AMF0 and others are in AMF3 which will often cause a problem.

Do you have any errors in your log regarding the RTMP failing to decode some data?

Andy



  ----- Original Message ----- 
  From: Naicu Octavian 
  To: red5 at osflash.org 
  Sent: Friday, March 27, 2009 7:09 AM
  Subject: Re: [Red5] My persistent so's stopped working between RC1 and RC2[issue found, mixed arrays!?]


  I can reproduce the issue with a single call to  getSharedObject(room, "roomslist",true);  placed in roomStart

  I've done a red5 application with just that line of code and the connection from the flash client fails consistently (and curiously) from the third connection attempt on!



  On Tue, Mar 24, 2009 at 9:02 PM, Naicu Octavian <naicuoctavian at gmail.com> wrote:

    I have emailed Matt Hodgson who submitted the patch for http://jira.red5.org/browse/APPSERVER-311, hopefully he will have some better insight into the issue!



    2009/3/24 Tyler Kocheran <rfkrocktk at gmail.com>


      Way back when, (0.7) there was a bug with persisting custom objects to SharedObjects. When I persisted a SharedObject with a custom externalizable value in it, sometimes it would corrupt the SharedObject and the only solution was to delete the SharedObject by hand. I don't know if this was fixed, but maybe it has something to do with what you're experiencing. 


      2009/3/24 Naicu Octavian <naicuoctavian at gmail.com>


        Just a small update regarding my issue, today I made a boolean search trough the repository for the exact revision number (between rc1 and rc2) where my Shared Objects's stopped working!

        I have compiled and tested about 10 Red5 revisions between Rc1 and Rc2 and I have identified revision r3431 as the revision in which my shared objects stopped working properly!

        The SVN logs shows what was changed in this revision:
        =========================================
        Fix http://jira.red5.org/browse/APPSERVER-311 with patch provided, and re-enable system regression test for it
        Modified /java/server/trunk/test/fixtures/red5-selftest.swf
        Modified /java/server/trunk/src/org/red5/io/amf/Input.java
        =========================================


        Also I have changed the log level for org.red5.io to DEBUG and you can see below what I get now in the logs when the error triggers.

         My issue is not completely solved yet but now I am closer to the exact issue. Hope this helps someone!

        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.object.Deserializer - Type: 4
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.object.Deserializer - Datatype: String
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.object.Deserializer - Type: 4
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.object.Deserializer - Datatype: String
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.object.Deserializer - Type: 7
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.object.Deserializer - Datatype: List
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.amf.Input - Read start mixed array: 0
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.amf.Input - End of object: ? true
        2009-03-24 18:42:19,703 [pool-4-thread-3] DEBUG org.red5.io.amf.Input - mixed array is a regular array
        2009-03-24 18:42:19,718 [pool-4-thread-3] ERROR o.red5.server.net.rtmp.RTMPHandler - Error connecting {}
        java.nio.BufferUnderflowException
            at java.nio.Buffer.nextGetIndex(Buffer.java:474) [na:1.6.0_12]
            at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:117) [na:1.6.0_12]
            at org.apache.mina.common.support.BaseByteBuffer.get(BaseByteBuffer.java:177) [mina-core-1.1.7.jar:na]
            at org.red5.io.amf.Input.readDataType(Input.java:85) [red5.jar:na]
            at org.red5.io.object.Deserializer.deserialize(Deserializer.java:49) [red5.jar:na]
            at org.red5.server.so.SharedObject.deserialize(SharedObject.java:650) [red5.jar:na]
            at org.red5.server.persistence.FilePersistence.doLoad(FilePersistence.java:293) [red5.jar:na]
            at org.red5.server.persistence.FilePersistence.doLoad(FilePersistence.java:220) [red5.jar:na]
            at org.red5.server.persistence.FilePersistence.load(FilePersistence.java:345) [red5.jar:na]
            at org.red5.server.so.SharedObjectScope.<init>(SharedObjectScope.java:97) [red5.jar:na]
            at org.red5.server.so.SharedObjectService.createSharedObject(SharedObjectService.java:123) [red5.jar:na]
            at org.red5.server.so.SharedObjectService.getSharedObject(SharedObjectService.java:139) [red5.jar:na]
            at org.red5.server.adapter.MultiThreadedApplicationAdapter.getSharedObject(MultiThreadedApplicationAdapter.java:708) [red5.jar:na]
            at Chat.Application.roomConnect(Application.java:1004) [Application.class:na]
            at org.red5.server.adapter.MultiThreadedApplicationAdapter.connect(MultiThreadedApplicationAdapter.java:308) [red5.jar:na]
            at org.red5.server.adapter.ApplicationAdapter.connect(ApplicationAdapter.java:48) [red5.jar:na]
            at org.red5.server.Scope.connect(Scope.java:321) [red5.jar:na]
            at org.red5.server.BaseConnection.connect(BaseConnection.java:293) [red5.jar:na]
            at org.red5.server.net.rtmp.RTMPConnection.connect(RTMPConnection.java:290) [red5.jar:na]
            at org.red5.server.net.rtmp.RTMPMinaConnection.connect(RTMPMinaConnection.java:81) [red5.jar:na]
            at org.red5.server.net.rtmp.RTMPHandler.onInvoke(RTMPHandler.java:296) [red5.jar:na]
            at org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:146) [red5.jar:na]
            at org.red5.server.net.rtmp.RTMPMinaIoHandler.messageReceived(RTMPMinaIoHandler.java:130) [red5.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570) [mina-core-1.1.7.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) [mina-core-1.1.7.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) [mina-core-1.1.7.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) [mina-core-1.1.7.jar:na]
            at org.apache.mina.filter.LoggingFilter.messageReceived(LoggingFilter.java:89) [mina-core-1.1.7.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) [mina-core-1.1.7.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) [mina-core-1.1.7.jar:na]
            at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) [mina-core-1.1.7.jar:na]
            at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220) [mina-core-1.1.7.jar:na]
            at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) [mina-core-1.1.7.jar:na]
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutorjava:886) [na:1.6.0_12]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_12]
            at java.lang.Thread.run(Thread.java:619) [na:1.6.0_12]
        2009-03-24 18:42:19,734 [pool-4-thread-3] INFO  o.r.s.net.rtmp.RTMPMinaIoHandler - [/127.0.0.1:1246] WRITE: org.red5.server.net.rtmp.message.Packet at b34b1





        Naicu Octavian,
        Product Manager @ AVChat Software
        http://www.avchat.net/blog/



        On Sat, Mar 21, 2009 at 2:16 AM, Naicu Octavian <naicuoctavian at gmail.com> wrote:

          I am using mostly Maps, like this:

          ISharedObject roomslist = getSharedObject(room, "roomslist",true);
          Map nextroom = (Map)roomslist.getAttribute((String)client.getAttribute("roomid"));
          Integer newusernr= (Integer)nextroom.get("users");
          nextroom.put("users",++newusernr);
          roomslist.setAttribute((String)client.getAttribute("roomid"), nextroom);


          Naicu


          2009/3/20 Tyler Kocheran <rfkrocktk at gmail.com>


            Are you storing custom objects in your SharedObjects? 


            2009/3/20 Naicu Octavian <naicuoctavian at gmail.com>

              With RC1 everything works fine.

              With Rc2 and the svn version, my flash chat application connects just fine to my red5 server side chat application, some persistent sos are created server side in Application.roomStart , everything works almost super smooth.

              During this phase I get some WARN's tough:
              2009-03-20 16:45:50,093 [pool-4-thread-16] WARN  org.red5.server.Context - Bean lookup failed for r0users..soservice in the application context
              whenever the execution reaches a getSharedObject or createSharedObject for r0users

              Now if I disconnect and connect again with the flash client app, the connection wont go trough. The executions stops when it hits a getSharedObject or createSharedObject inside Application.roomStart.

              The exact stack trace is :
              2009-03-20 16:46:00,796 [pool-4-thread-16] ERROR o.red5.server.net.rtmp.RTMPHandler - Error connecting {}
              java.nio.BufferUnderflowException
                  at java.nio.Buffer.nextGetIndex(Buffer.java:474) [na:1.6.0_12]
                  at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:117) [na:1.6.0_12]
                  at org.apache.mina.common.support.BaseByteBuffer.get(BaseByteBuffer.java:177) [mina-core-1.1.7.jar:na]
                  at org.red5.io.amf.Input.readDataType(Input.java:85) [red5.jar:na]
                  at org.red5.io.object.Deserializer.deserialize(Deserializer.java:50) [red5.jar:na]
                  at org.red5.server.so.SharedObject.deserialize(SharedObject.java:650) [red5.jar:na]
                  at org.red5.server.persistence.FilePersistence.doLoad(FilePersistence.java:293) [red5.jar:na]
                  at org.red5.server.persistence.FilePersistence.doLoad(FilePersistence.java:220) [red5.jar:na]
                  at org.red5.server.persistence.FilePersistence.load(FilePersistence.java:345) [red5.jar:na]
                  at org.red5.server.so.SharedObjectScope.<init>(SharedObjectScope.java:97) [red5.jar:na]
                  at org.red5.server.so.SharedObjectService.createSharedObject(SharedObjectService.java:120) [red5.jar:na]
                  at org.red5.server.adapter.MultiThreadedApplicationAdapter.createSharedObject(MultiThreadedApplicationAdapter.java:644) [red5.jar:na]
                  at SuperChat.Application.createRoomInScope(Application.java:740) [Application.class:na]
                  at SuperChat.Application.loadSettings(Application.java:287) [Application.class:na]
                  at SuperChat.Application.roomStart(Application.java:910) [Application.class:na]
                  at org.red5.server.adapter.MultiThreadedApplicationAdapter.start(MultiThreadedApplicationAdapter.java:323) [red5.jar:na]
                  at org.red5.server.adapter.ApplicationAdapter.start(ApplicationAdapter.java:60) [red5.jar:na]
                  at org.red5.server.Scope.addChildScope(Scope.java:274) [red5.jar:na]
                  at org.red5.server.Scope.createChildScope(Scope.java:364) [red5.jar:na]
                  at org.red5.server.ScopeResolver.resolveScope(ScopeResolver.java:101) [red5.jar:na]
                  at org.red5.server.Context.resolveScope(Context.java:148) [red5.jar:na]
                  at org.red5.server.net.rtmp.RTMPHandler.onInvoke(RTMPHandler.java:250) [red5.jar:na]
                  at org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:146) [red5.jar:na]
                  at org.red5.server.net.rtmp.RTMPMinaIoHandler.messageReceived(RTMPMinaIoHandler.java:127) [red5.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.filter.LoggingFilter.messageReceived(LoggingFilter.java:89) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220) [mina-core-1.1.7.jar:na]
                  at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) [mina-core-1.1.7.jar:na]
                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutorjava:886) [na:1.6.0_12]
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_12]
                  at java.lang.Thread.run(Thread.java:619) [na:1.6.0_12]
              2009-03-20 16:46:05,656 [DefaultQuartzScheduler_Worker-7] WARN  o.r.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection from 127.0.0.1 : 1195 to localhost (in: 3429 out 3177 ), with id 21960486 due to long handshake

              Any ideas?!

              Naicu Octavian,
              Product Manager @ AVChat Software
              http://www.avchat.net/blog/


              _______________________________________________
              Red5 mailing list
              Red5 at osflash.org
              http://osflash.org/mailman/listinfo/red5_osflash.org





            -- 
            And do this, knowing the time, that now it is high time to awake out of sleep;
            for now our salvation is nearer than when we first believed.

            _______________________________________________
            Red5 mailing list
            Red5 at osflash.org
            http://osflash.org/mailman/listinfo/red5_osflash.org






        _______________________________________________
        Red5 mailing list
        Red5 at osflash.org
        http://osflash.org/mailman/listinfo/red5_osflash.org





      -- 
      And do this, knowing the time, that now it is high time to awake out of sleep;
      for now our salvation is nearer than when we first believed.


      _______________________________________________
      Red5 mailing list
      Red5 at osflash.org
      http://osflash.org/mailman/listinfo/red5_osflash.org








------------------------------------------------------------------------------


  _______________________________________________
  Red5 mailing list
  Red5 at osflash.org
  http://osflash.org/mailman/listinfo/red5_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090327/e9cebd80/attachment-0001.html>


More information about the Red5 mailing list