RestComm / jain-slee

The World's #1 Open Source JAIN-SLEE (JSLEE) 1.1 Implementation
http://www.restcomm.com/
GNU Affero General Public License v3.0
24 stars 50 forks source link

Incomplete class loading. #127

Open tuijldert opened 6 years ago

tuijldert commented 6 years ago

Hi,

Further to my question on classloading, I've implemented a skeleton sbb and servlet that shows the issue (see included zip). testing123.zip

A Readme is included; simply unzip the file, build and deploy it and note the results within server.log. Clearly, javax.sound implementation classes from the SDK are not properly loaded because the war finds them but the sbb does not.

My guess is that SLEE core doesn't load (or export?) them correctly. Any hints on a solution are much appreciated.

TIA, Tom.

georgeyanev commented 5 years ago

@tuijldert I also have some kind of a class-loading issue. I can not figure out how to declare dependency in a slee deployment unit (du) to some wildfly module? I tried with MANIFEST.MF Dependencies tag, with jboss-deployment-structure.xml but nothing helps. The du can not deploy because it does not see the classes from the dependency. Actually I use the dependency classes in all DU submodules - sbb, events and library. Do you have a clue of how to do that?

tuijldert commented 5 years ago

AFAIK, you won't see any classes outside the SLEE module.

Your best bet would be to declare the dependency in the module.xml of org.restcomm.slee.container.extension that is loaded at startup.

I used that to include my own module. See the http-common build files on how that's done.

georgeyanev commented 5 years ago

Ok, that worked but it is very strange. I wonder is it supposed to remain so. I think deployment units should be able to depend on other modules.

georgeyanev commented 5 years ago

@tuijldert Anyway this was very helpful. Thanks!

tuijldert commented 5 years ago

I think that it is by design. It needs to run in any SLEE environment. A dependency on a framework (JBoss/Wildfly in this case) would make that impossible. This is what SLEE libraries are for.

And glad to be of help.

yulianoifa-mobius commented 3 years ago

Hi In case you are using the wildfly and need jdk files to be accessed you need to change the /modules/system/layers/base/org/telestax/slee/container/lib/main/module.xml or in older versions /modules/system/layers/base/org/restcomm/slee/container/lib/main/module.xml

and change
module name="sun.jdk" to module name="sun.jdk" export="true"

However this will break the slee spec ( and tck testsuite will fail due to security restrictions )

tdevinda commented 3 years ago

Its been long. But I hope this adds upto something;

I needed a separate package on a different project (actually a bunch of DTOs) to be used in my project. But SLEE would not load them however I compile the project. I found out that if I place the jar files manually on the correct module path, I would be able to load them at runtime.

my DTO packages start with lk.dialog.apnc.dto So I put the following files in the path <WILDFLY ROOT>/modules/system/layers/base/lk/dialog/apnc/dto/main/

module.xml

<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.3" name="lk.dialog.apnc.dto">

    <resources>
        <resource-root path="apnc-dto-collection-1.0.jar"/>
    </resources>

    <dependencies/>
</module>

Now I can use these classes in the SBBs.

Hope that helped in some way.