Dependencies in _lib_ folder not found

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

Moderators: Lapo, Bax

Post Reply
yqtang
Posts: 13
Joined: 03 May 2022, 19:14

Dependencies in _lib_ folder not found

Post by yqtang »

Hello Lapo,

I've read on official documentation and looks like you can put your customized dependency in _lib_ folder under extensions folder. I put some common utility classes inside a jar and put it inside _lib_ folder. Weird enough, some of its classes can be accessed from other extension classes while some can not be found. I run into the error like this when trying to a create an instance of one of the classes from that jar and following is from the log:

java.lang.NoClassDefFoundError:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.NoClassDefFoundError

I tried to restart the server several times, and it didn't fix the issue. Could you shed some light on this matter? Is there something possibly I've been missing? Thank you very much!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Dependencies in _lib_ folder not found

Post by Lapo »

Hi,
I would recommend to double check that all the classes you need are in the jar files you've copied under extensions/__lib__/
Other than that it should work without any issues.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
yqtang
Posts: 13
Joined: 03 May 2022, 19:14

Re: Dependencies in _lib_ folder not found

Post by yqtang »

Hi Lapo,

Thank you for your quick response. I looked into the issue, looks like I have some dependency cycles there.

Another question I am lost at is that in the tutorial documentation, it says you can do extension interoperability. Since different extensions are put in different folders, how are you supposed to be able to see the type of one extension from another? Inside the tutorial documentation the room extension is casting to the zone extension:

MyZoneExtension zoneExt = (MyZoneExtension) getParentZone().getExtension();

Vec3D vec = zoneExt.handleInternalMessage("test", someVec3D);

In my case, since extension classes are put in different folders, they won't be able to see the class definition of another extension type. Is there a solution to that? Anything I am missing? Thank you!
Post Reply