BUG: Confusing error message is displayed.

Post here your questions about the OpenSpace 1.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Post Reply
morgflast
Posts: 9
Joined: 04 Sep 2008, 15:21

BUG: Confusing error message is displayed.

Post by morgflast »

I was attempting to port the 'Slopes' example from the OpenSpace_trial into flex, when I ran into a confusing error.

The .swf files would load okay, and the background would load but as soon as this executed:

Code: Select all

public function onOpenSpaceMapRendered(evt:OpenSpaceEvent):void
		{
			os.createMyAvatar("dummy")
		}
It would break with the following error

TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/addChild()
at com.smartfoxserver.openspace.avatar::Avatar()
at com.smartfoxserver.openspace.avatar::AvatarsManager/createAvatar()
at com.smartfoxserver.openspace.mvc::IsoEngineModel/createAvatar()
at com.smartfoxserver.openspace::OpenSpace/createMyAvatar()
at vw.app.modules::OpenSpaceCodeModule/onOpenSpaceMapRendered()[/Users/djacobs7/svn/vw_client/src/vw/app/modules/OpenSpaceCodeModule.as:211]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.smartfoxserver.openspace::OpenSpace/forwardOpenSpaceEvent()
at com.smartfoxserver.openspace::OpenSpace/onMapRendered()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.smartfoxserver.openspace.mvc::IsoEngineModel/onMapBuilt()
at com.smartfoxserver.openspace.map::MapManager/onMapGenerationCompleted()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.smartfoxserver.openspace.utils.executor::MultiFrameExecutor/runStep()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

After a lot of debugging, I realized that this was caused by a Security Sandbox violation, because the createMyAvatar function tries to read in some classes from the AvatarsLibraryExample.swf. This requires a different level of permissions then simply reading in map files, which is why it did not break until this point.

I know Flex will occasionaly throw an error saying there was a security sandbox violation, and it would be helpful if OpenSpace.createMyAvatar could do the same so this would be easier to debug.

Thanks,
Daniel
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Thank you for reporting.
Paolo Bax
The SmartFoxServer Team
sn0
Posts: 2
Joined: 18 Sep 2009, 22:55

Got the similar problem

Post by sn0 »

There is log listing:

Code: Select all

Join button clicked, now loading config...
[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='156' /></body></msg>

[ RECEIVED ]: <cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>, (len: 91)
[ RECEIVED ]: <msg t='sys'><body action='apiOK' r='0'></body></msg>, (len: 53)
Connection successful: true
[Sending]: <msg t='sys'><body action='login' r='0'><login z='openspace'><nick><![CDATA[scsc]]></nick><pword><![CDATA[]]></pword></login></body></msg>

[ RECEIVED ]: <msg t='sys'><body action='logOK' r='0'><login n='scsc' id='17' mod='0'/></body></msg>, (len: 86)
Login successful: true
[Sending]: <msg t='sys'><body action='getRmList' r='-1'></body></msg>

[ RECEIVED ]: <msg t='sys'><body action='rmList' r='0'><rmList><rm id='1' priv='0' temp='0' game='0' ucnt='0' maxu='50' maxs='0'><n><![CDATA[Ranch (inside)]]></n></rm><rm id='2' priv='0' temp='0' game='0' ucnt='0' maxu='50' maxs='0'><n><![CDATA[Ranch (outside)]]></n></rm><rm id='3' priv='0' temp='0' game='0' ucnt='0' maxu='50' maxs='0'><n><![CDATA[Slopes area]]></n></rm></rmList></body></msg>, (len: 381)
Roomlist received, now joining the initial room
[Sending]: <msg t='sys'><body action='joinRoom' r='-1'><room id='2' pwd='' spec='0' leave='0' old='-1' /></body></msg>

[ RECEIVED ]: <msg t='sys'><body action='joinOK' r='2'><pid id='0'/><vars /><uLs r='2'><u i='17' m='0'><n><![CDATA[scsc]]></n><vars></vars></u></uLs></body></msg>, (len: 148)
[ RECEIVED ]: <msg t='sys'><body action='uCount' r='2' u='1'></body></msg>, (len: 60)
Avatars' library loaded
Skins' library loaded
Backgrounds' library loaded
[OpenSpace|INFO] External configuration loaded: http://xxx:8888/config/OpenSpace.xml 
[OpenSpace|INFO] Using Mouse controller 
[OpenSpace|INFO] Initialization completed 
[OpenSpace|INFO] Loading map: http://xxx/editorData/m2_RanchOutside.xml 
[OpenSpace|INFO] Map xml file loaded and parsed successfully 
Map loaded & parsed: progress status should be displayed
[OpenSpace|INFO] Backgrounds creation process completed (total time: 1ms) 
[OpenSpace|INFO] Foregrounds creation process completed (total time: 0ms) 
[OpenSpace|INFO] Tiles creation progress: 27% 
[OpenSpace|INFO] Tiles creation progress: 53% 
[OpenSpace|INFO] Tiles creation progress: 80% 
[OpenSpace|INFO] Tiles creation progress: 100% 
[OpenSpace|INFO] Tiles creation completed (total time: 852ms) 
[OpenSpace|INFO] Renderer initialized 
[OpenSpace|INFO] Map background rendering completed 
[OpenSpace|INFO] Map tiles rendering completed (224 tiles) 
[OpenSpace|INFO] Map foreground rendering completed 
[OpenSpace|INFO] Tiles added to display list (total time: 52ms) 
Map rendered, now creating my own avatar...
[OpenSpace|INFO] Creating avatar; id = 17 
[OpenSpace|INFO] Placing avatar 17 on map coordinates:  
[OpenSpace|INFO] Map coordinates not passed, selecting a map access point randomly 
--> Validating map coordinates: (11,7,-1)
    - coordinates are inside map boundaries
    - pz coordinate not passed
    - looking for valid pz
    - tile found
    - tile is walkable
[OpenSpace|INFO] Validated map coordinates for avatar 17: (11,7,0) 
[OpenSpace|INFO] Populating pathfinder nodes for user avatar 
DummyAvatarMovieClip()
TypeError: Error #2007: Parameter child must be non-null.
	at flash.display::DisplayObjectContainer/addChild()
	at com.smartfoxserver.openspace.avatar::Avatar()
	at com.smartfoxserver.openspace.avatar::AvatarsManager/createAvatar()
	at com.smartfoxserver.openspace.mvc::IsoEngineModel/createAvatar()
	at com.smartfoxserver.openspace::OpenSpace/createMyAvatar()
	at OpenSpace_tester_fla::MainTimeline/onOpenSpaceMapRendered()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at com.smartfoxserver.openspace::OpenSpace/forwardOpenSpaceEvent()
	at com.smartfoxserver.openspace::OpenSpace/onMapRendered()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at com.smartfoxserver.openspace.mvc::IsoEngineModel/onMapBuilt()
	at com.smartfoxserver.openspace.map::MapManager/onMapGenerationCompleted()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at com.smartfoxserver.openspace.utils.executor::MultiFrameExecutor/runStep()
	at flash.utils::Timer/_timerDispatch()
	at flash.utils::Timer/tick()

OpenSpace_tester.swf on server A
AvatarsLibraryExample.swf on server B

How can I fix this issue?[/code]
Post Reply