Hi Does anyone have an example if this working? I'm pretty new to Spring but based on my current understanding an ApplicationContext needs to be constructed in order to load in the spring configuration from an external xml file in order to get Spring working generally but I was wondering how to do this with SFS2X?
I have tried by placing the following code in the init method of one of my extensions where applicationContext.xml is my spring config file and is on the class path (I have put it in the SFS2X dir, the SFS2x/lib dir and a few other places.
Code: Select all
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
Whenever I try to launch he server with this code in the extension I get the error shown below where it seems to attempt to do something but then the boot process stops and the server does not start. I'm probably doing something totally incorrect but would really appreciate if anyone had any ideas how I could get Spring working wuth SFS2x
21 Dec 2010 09:15:09,551 INFO [main] entities.managers.SFSZoneManager - Creating room: (default) Limbo
21 Dec 2010 09:15:09,557 WARN [main] entities.managers.SFSZoneManager - RoomSetting literal not found:
21 Dec 2010 09:15:09,560 INFO [main] v2.api.SFSApi - Room created: [ Room: Limbo, Id: 0, Group: default, isGame: false ]
21 Dec 2010 09:15:09,560 INFO [main] entities.managers.SFSZoneManager - Creating room: (default) User
21 Dec 2010 09:15:09,561 WARN [main] entities.managers.SFSZoneManager - RoomSetting literal not found:
21 Dec 2010 09:15:09,561 INFO [main] v2.api.SFSApi - Room created: [ Room: User, Id: 1, Group: default, isGame: false ]
21 Dec 2010 09:15:09,573 DEBUG [main] user.room.UserRoomExtension - Initialised!
21 Dec 2010 09:15:09,583 DEBUG [main] user.buddylist.BuddyListPersister - BuddyListPersister initialized.
21 Dec 2010 09:15:09,586 DEBUG [main] secure.zone.SecureZoneExtension - initialise SecureZoneExtension
21 Dec 2010 09:15:09,618 INFO [main] context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@451ef443: startup date [Tue Dec 21 09:15:09 GMT 2010]; root of context hierarchy
21 Dec 2010 09:15:09,649 INFO [Thread-2] entities.managers.SFSZoneManager - BuddyList saveAll...
21 Dec 2010 09:15:09,649 WARN [SFS2X ShutdownHook] v2.core.SFSShutdownHook - SFS2X is shutting down. The process may take a few seconds...
21 Dec 2010 09:15:09,671 INFO [Thread-3] entities.managers.SFSBannedUserManager - BanUser data saved.