[Red5] 2134 Cannot create SharedObject

Andy Shaules bowljoman at hotmail.com
Sun May 24 12:10:56 PDT 2009


Looks like you are not waiting for the netconnection onStatus event before 
attemptine to make a remote object.


----- Original Message ----- 
From: "Stan" <stan at analytica.biz>
To: <red5 at osflash.org>
Sent: Sunday, May 24, 2009 12:05 PM
Subject: [Red5] 2134 Cannot create SharedObject


> Hi,
>
> I'm trying to make simple chat using red5 streaming server and flex3.
> I manage to connect to my server successfully but can't create remote 
> shared object I get error code 2134 out from flash meaning "Cannot create 
> SharedObject". There is no message regarding this in red5 log and flash in 
> nothing more specific. I must be doing something stupid because RSO demos 
> are working ok on my installation but I can't figure out what it is.
>
> To note I'm running on ubuntu 64bit, using Eclipse for red5 server 
> development only. I compile mxmls in command line using Flex 3 sdk.
>
> Here is what I've got on server side, This SO is created by ClientManager 
> but I've tried to create one manually or even not to create it at all 
> expecting it co be created automatically upon request from client.
>
>
> public class Application extends ApplicationAdapter {
>
>    /** Manager for the clients. */
>    private ISharedObject soClients;
>   private IScope appScope;
>   private static final Log log = LogFactory.getLog( Application.class );
>    private static String appname = "chatroomred5 - ";
>    private ClientManager clientMgr = new ClientManager("clients", false);
>
>
>    public Application()
>    {
>        log.info(appname+"my app constructor");
>    }
>
>
>    public boolean appStart(IScope app)
>    {
>        this.appScope = app;
>        log.info(appname+"my app starting ");
>
>       this.soClients = this.getSharedObject(this.appScope, "clients", 
> false);
>        if (soClients==null)
>            log.error(appname+"can't get clients so, it is null");
>       soClients.setAttribute("message", "Hello World!");
>
>        //We setup an interval, to call our changeNumbers function
>        //random_change_interval = 
> setInterval(application.changeNumbers,2000, this);
>        //For no particular reason at this point, we keep count of the 
> number of connected clients
>
>       return true;
>    }
>   /** {@inheritDoc} */
>    @Override
>    public boolean connect(IConnection conn, IScope scope, Object[] params) 
> {
>        log.info(appname+"connect called" );
>        // Check if the user passed valid parameters.
>        if (params == null || params.length == 0) {
>            // NOTE: "rejectClient" terminates the execution of the current 
> method!
>            log.error(appname+"no username passed");
>            rejectClient("No username passed.");
>           }
>       // Call original method of parent class.
>        if (!super.connect(conn, scope, params)) {
>            log.error(appname+"parrent connect failed");
>            return false;
>        }
>
>        String username = params[0].toString();
>        log.info(appname+"client >"+username+"< connected" );
>
>       clientMgr.addClient(scope, username, conn.getClient().getId());
>
>           return true;
>    }
>
>
>
> And this is on client side, I always get exception on clients SO get no 
> matter whether it exists on server yet or not.
>
> function initializeApplication()
>             {
>            myData = new Array();
>                 conn = new NetConnection();
>
>            //CONNECTION STATUS HANDLER
>            conn.addEventListener(NetStatusEvent.NET_STATUS, 
> netStatusHandler);
>
>                 //connect To server
>            var server:String='rtmp://localhost:1935/ChatroomRed5Server';
>            //var server:String='rtmp://192.168.153.2:1935/chatroom';
>            //conn.setURI(server);
>             //connect and pass own username
>            log("connecting...");
>            conn.connect(server,name_box.text);
>           log("creating shared objects...");
>            try
>            {
>              log("GET remote clients...");
>              soClients = 
> SharedObject.getRemote("clients",conn.uri,"false");
>              log("get remote data...");
>              soData =  SharedObject.getRemote("data",conn.uri,"false");
>
>              log("connecting shared objects...");
>              soClients.connect(conn);
>              soData.connect(conn);
>
>              log("adding shared objects sync listeners...");
>              soClients.addEventListener(flash.events.SyncEvent.SYNC, 
> syncClients);
>              soData.addEventListener(flash.events.SyncEvent.SYNC, 
> syncData);
>            }
>            catch(e:Error)
>            {
>              log("exeption caught:"+e.message);
>            }
>
>        }
>
>
> Thanks
>
> Stan
>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
> 




More information about the Red5 mailing list