Reload java extension

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

radz
Posts: 16
Joined: 06 Oct 2005, 07:38

Reload java extension

Post by radz »

I have a problem when reloading my java extensions. If I compile the file and click reload in the admin interface, it still reloads the old class. I have to restart sfs to run the new class. Is that related to my jvm or the sfs?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

that's weird, the java class should be reloaded each time
Do you compile your class and put it in the javaExtensions folder?
Lapo
--
gotoAndPlay()
...addicted to flash games
radz
Posts: 16
Joined: 06 Oct 2005, 07:38

Post by radz »

Yes, and if I restart the server the changes are loaded.

Once loaded, I can even delete the class file and press reload, this will reload the deleted class file as if it still existed. It seems like the jvm is caching the class. I've also tried it on the pixel demo with the same result.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Thanks for the info, we'll look into it and post a solution as soon as possible :)
Lapo
--
gotoAndPlay()
...addicted to flash games
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

Lapo, same here.
The same problem apply to the Zone extension written in AS.
SFS doesn't react neighter to the Reload Zone nor to the Reload Extension button pressed for a zone extension.

It works only after a server restart.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

one moment... Reloading AS extensions has always been working :)
If you can't reload an extension, probably a compilation error is being thrown. Check your console, or the wrapper logs if you run it as a service.

Probably the Java extension issue noticed by radz is similar, I will do a test soon and I'll let you know
Lapo
--
gotoAndPlay()
...addicted to flash games
radz
Posts: 16
Joined: 06 Oct 2005, 07:38

Post by radz »

I have no problem reloading AS extensions. :) I don't get any error messages when reloading java extension either, it's looks fine except it's reloading the old version of the class.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

radz wrote:I have no problem reloading AS extensions. :) I don't get any error messages when reloading java extension either, it's looks fine except it's reloading the old version of the class.
Radz you're right. The problem is with the Java default classloader which does not load newly compiled classes.
Thanks for spotting this!
I am already working on it :)
Lapo
--
gotoAndPlay()
...addicted to flash games
radz
Posts: 16
Joined: 06 Oct 2005, 07:38

Post by radz »

Lapo, any news about the dynamic reload? I noticed that the same problem is still in the 1.4.0 final release. Do you think it will be fixed soon?[/quote]
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Hi,
I think there's a little mistake in the 1.4.0 launcher. It includes the javaExtensions/ folder in the classpath.

If you're under Windows open the start.bat file and remove that folder. Then stop and start the server. It should fix the problem

:)
Lapo
--
gotoAndPlay()
...addicted to flash games
radz
Posts: 16
Joined: 06 Oct 2005, 07:38

Post by radz »

Perfect! It's working fine now, thanks! :)
turtlesoup
Posts: 77
Joined: 28 Dec 2007, 20:56

Post by turtlesoup »

Hey Lapo,

I was having the same problem reloading java extensions from the Admin tool. I deleted that javaExtensions folder from the start.bat and it's working now. This is on SFS 1.6.

Just a reminder if you were intending to fix that and forgot about it or something.
jigidyjim
Posts: 39
Joined: 06 Nov 2007, 21:48

Post by jigidyjim »

Hi - I'm having this problem too.

I just upgraded from 1.5.5. to 1.6.1 today, and now reloading java extensions has stopped working. I have to completely stop and start the server again (a restart doesn't work either).

Any work arounds?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Yep! turtlesoup sorry about being late on checking this one.
We're checking the issue in the next hours. Stay tuned :)
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

The solution is actually in the above previous message of mine:
I think there's a little mistake in the 1.4.0 launcher. It includes the javaExtensions/ folder in the classpath.
Depending on how you run the service (service/daemon) or standalone you should remove the reference to that folder in the classpath folder.

Service/Daemon:

open the Server/conf/wrapper.conf and remove the classpath line referencing the folder


Standalone:

open the start.sh (Unix) or start.bat (Windows) and remove the classpath entry

Additionally you can turn on the <AutoReloadExtension> feature to make the server auto-detect extension saves.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply