Loading jars from javaExtensions folder

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

arun8483
Posts: 33
Joined: 15 Dec 2010, 02:35
Contact:

Loading jars from javaExtensions folder

Postby arun8483 » 11 Mar 2012, 00:57

Hi,
How to load my application jar from javaExtensions...
Problem:
1) Currently I am loading all jars from smartfox_pro/server/lib....location....
My application has spring dependencies and lots of spring configuration xml files...all embedded inside jar file...
I am using ClassPathXmlApplicationContext to load spring configuration file from inside jars and its working fine....so far no problem...app is loading fine and everything is working as expected....

2) Now I am creating another application..But my spring configuration folder structure is same as the above application....
ie, app1: application1/config/dev/spring.xml
app2: application2/config/dev/spring.xml
Only the application name differs, but the configration folder structure is same.....
Now the prblem is, ClassPathXmlApplicationContext loads files using the classloader, So already app1 deployed and its config xml files also loaded,
Since the second apps config file names are also same as the first app...ClassPathXmlApplicationContext just ignores the second app xml files and its taking the first app configuration files.....this is because both apps are loaded using the same cloassloader...
So I tried changing the xml file names...and everything started working fine....But I don't want this behavior...I want to maintain a consistent structure for all my applications....It seems javaExtensions folder is not loaded in the begining and all extensions loaded from javaExtensions has their own independent classloader..So I just want to use this approach....I want to know how to load jars from javaExtensions folder...is there any way to accompolish this????????....I also tried exploded dir structure..But the problem with this approach is that since hibernate pojos and xmls are loaded based on the classpath again loading seems to be a problem....
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Loading jars from javaExtensions folder

Postby Lapo » 13 Mar 2012, 10:47

I am sorry, I am not familiar with Spring. Any jar that should be seen in the system should be deployed in the lib/ folder
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 42 guests