Topic
  • 6 replies
  • Latest Post - ‏2013-10-21T13:37:29Z by jnjnc
jnjnc
jnjnc
6 Posts

Pinned topic Liberty profile shared library isolation

‏2013-10-14T10:16:19Z |

Hi,

Sorry if that question has already been posted but I don't find any answer in the forum nor in the following doc.

http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.was_v8/was/8.5/ProgrammingModel/WAS85_LP_Class_Loading.pdf

I'm using 3 shared libraries definition, let's say core libraries, business libraries and database libraries.

They are defined as commonLibraryRef

<application id="MY_EAR" name="MY_EAR" type="ear"
location="${server.config.dir}/apps/MY_EAR.ear">
 
<classloader commonLibraryRef="CoreLib,OracleLib,BusinessLib"
delegation="parentLast">
</classloader>
 
</application>

When the core invoke the business or the database, I got class not found exception.

It works pretty fine if I put all jars in an unique shared lib folder until the database class try to locate some WAS class

java.lang.NoClassDefFoundError: com/ibm/websphere/rsadapter/WSCallHelper

Did I miss something about classloading isolation ?

Could the shared lib interact if they are deployed through different shared lib definition ?

Thanks for your help.

Regards.

 

 

 

 

  • SolomanBarghouthi
    SolomanBarghouthi
    8 Posts

    Re: Liberty profile shared library isolation

    ‏2013-10-14T14:24:22Z  

    HI,

     

    WSCallHelper is not supported with liberty, see the following:

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014938425

     

    -- Soloman

  • jnjnc
    jnjnc
    6 Posts

    Re: Liberty profile shared library isolation

    ‏2013-10-14T14:51:13Z  

    HI,

     

    WSCallHelper is not supported with liberty, see the following:

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014938425

     

    -- Soloman

    Thanks a lot for your quick answer about the issue about com/ibm/websphere/rsadapter/WSCallHelper.

    I will check why we are going through this interface.

    Could you let me know if when I use multiple shared library definition, they are supposed to work together, or is there a classloading issue with my current setting ?

    As I said in my first test I'm getting class not found exception when using the following configuration and when a class from CoreLib is calling a class from BusinessLib or OracleLib.

     

    <application id="MY_EAR" name="MY_EAR" type="ear"
    location="${server.config.dir}/apps/MY_EAR.ear">
     
    <classloader commonLibraryRef="CoreLib,OracleLib,BusinessLib"
    delegation="parentLast">
    </classloader>
     
    </application>

    Thanks a lot.

    Regards,

     

     

  • Alasdair
    Alasdair
    55 Posts

    Re: Liberty profile shared library isolation

    ‏2013-10-14T14:58:07Z  
    • jnjnc
    • ‏2013-10-14T14:51:13Z

    Thanks a lot for your quick answer about the issue about com/ibm/websphere/rsadapter/WSCallHelper.

    I will check why we are going through this interface.

    Could you let me know if when I use multiple shared library definition, they are supposed to work together, or is there a classloading issue with my current setting ?

    As I said in my first test I'm getting class not found exception when using the following configuration and when a class from CoreLib is calling a class from BusinessLib or OracleLib.

     

    <application id="MY_EAR" name="MY_EAR" type="ear"
    location="${server.config.dir}/apps/MY_EAR.ear">
     
    <classloader commonLibraryRef="CoreLib,OracleLib,BusinessLib"
    delegation="parentLast">
    </classloader>
     
    </application>

    Thanks a lot.

    Regards,

     

     

    Hi,

    When you use commonLibraryRef each library is represented with a classloader and there is no relationship between them. If there is a relationship between these libraries then you should configure them as a single library.

    Alasdair

  • jnjnc
    jnjnc
    6 Posts

    Re: Liberty profile shared library isolation

    ‏2013-10-14T15:02:24Z  
    • Alasdair
    • ‏2013-10-14T14:58:07Z

    Hi,

    When you use commonLibraryRef each library is represented with a classloader and there is no relationship between them. If there is a relationship between these libraries then you should configure them as a single library.

    Alasdair

    Thanks Alasdair for this explanation.

    Edit.

    I can see in full profile the following property. Is there same kind of option in liberty ?

     

    Thanks and regard

     

    Class Loading

     

     

  • JungWoonLee
    JungWoonLee
    6 Posts

    Re: Liberty profile shared library isolation

    ‏2013-10-17T01:19:15Z  

    Hi,

    please check below link about IBM WAS Liberty classloader

    https://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.was_v8/was/8.5/ProgrammingModel/WAS85_LP_Class_Loading.pdf?dmuid=20120710094802628195

    As you can check above link I sent, you might get similar function you would want to be like 'isolate class loading' when you set classloader as private with 'privateLibraryRef'.

     

    Thanks,

  • jnjnc
    jnjnc
    6 Posts

    Re: Liberty profile shared library isolation

    ‏2013-10-21T13:37:29Z  

    Hi,

    please check below link about IBM WAS Liberty classloader

    https://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/topic/com.ibm.iea.was_v8/was/8.5/ProgrammingModel/WAS85_LP_Class_Loading.pdf?dmuid=20120710094802628195

    As you can check above link I sent, you might get similar function you would want to be like 'isolate class loading' when you set classloader as private with 'privateLibraryRef'.

     

    Thanks,

    Hi,

    Sorry for the late reply and thanks for your link. I think this is the same I read and mentioned in my first post.

    What I was wondering is if there is a way to have same behavior than in full profile where by default a class in a shared library could call a class in another shared library (I would like to share same kind of shared library configuration in full and liberty profile).

    That's why I use 'commonLibraryRef' but as a Alasdair answered it seems not and I would have to put all my jars in same shared lib folder.

    If not I think we could mark this subject as answered (I don't have the privilege to do so).

    Thanks.