jain-slee icon indicating copy to clipboard operation
jain-slee copied to clipboard

Incomplete class loading.

Open tuijldert opened this issue 6 years ago • 7 comments

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.

tuijldert avatar May 23 '18 14:05 tuijldert

@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?

georgeyanev avatar Sep 25 '18 13:09 georgeyanev

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.

tuijldert avatar Sep 25 '18 14:09 tuijldert

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 avatar Sep 25 '18 15:09 georgeyanev

@tuijldert Anyway this was very helpful. Thanks!

georgeyanev avatar Sep 26 '18 03:09 georgeyanev

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.

tuijldert avatar Sep 26 '18 07:09 tuijldert

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 )

yulianoifa-mobius avatar Jan 29 '21 14:01 yulianoifa-mobius

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/

  • apnc-dto-collection-1.0.jar (this is the compiled jarfile of the DTO project from /target)
  • module.xml

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.

tdevinda avatar Aug 19 '21 14:08 tdevinda