Topic
  • 4 replies
  • Latest Post - ‏2014-07-28T19:18:09Z by Karl_tfa
SystemAdmin
SystemAdmin
37422 Posts

Pinned topic Liberty Profile 8.5 lib/ext

‏2012-10-01T08:58:17Z |
Hi

I have a WAS application that I would like to run using Liberty Profile for development purpose.

This application uses a property file that has to be in the applications classpath but it is environment
specific so therefore not included in the project itself.

In the old (current) setup it is dropped in the lib/ext folder an it just works perfectly but I can seem to find
the equivalent in Liberty Profile.

I have tried to put in the following locations relative to the install path of WLP:
- lib
- usr/shared/apps
- usr/shared/config
- usr/shared/resources

I have tried to look in the documentation but nothing comes up.

Can someone point me in the right direction?

Regards

Thomas
Updated on 2012-11-22T07:44:51Z at 2012-11-22T07:44:51Z by SystemAdmin
  • bkail
    bkail
    372 Posts

    Re: Liberty Profile 8.5 lib/ext

    ‏2012-10-11T16:25:46Z  
    I would suggest configuring a library and specifically referencing it from your application rather than relying on a single directory:

    http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.wlp.nd.doc/topics/twlp_classloader.html

    If you really do need/want a global directory, see the "Providing global libraries for all Java EE applications" topic.
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Liberty Profile 8.5 lib/ext

    ‏2012-11-19T08:46:40Z  
    • bkail
    • ‏2012-10-11T16:25:46Z
    I would suggest configuring a library and specifically referencing it from your application rather than relying on a single directory:

    http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.wlp.nd.doc/topics/twlp_classloader.html

    If you really do need/want a global directory, see the "Providing global libraries for all Java EE applications" topic.
    Hi

    Thanks for your info. I have read all the stuff about the topic. Also downloaded a couple of redbooks "WebSphere Application
    Server V8.5 Concepts,Planning, and Design Guide" and "WebSphere Application Server Liberty Profile,Guide for Developers". These actually have great descriptions about setting up shared libraries.

    Nevertheless I can not make it work. What I want is not a jar-file but a property file that has to be in the classpath of the system. Like f.eks. log4j. But in this case it is actually a linkage file to be used by IBM EGL Java Wrappers.

    Anybody knows how to do that?

    /Thomas
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: Liberty Profile 8.5 lib/ext

    ‏2012-11-22T07:44:51Z  
    Hi

    Thanks for your info. I have read all the stuff about the topic. Also downloaded a couple of redbooks "WebSphere Application
    Server V8.5 Concepts,Planning, and Design Guide" and "WebSphere Application Server Liberty Profile,Guide for Developers". These actually have great descriptions about setting up shared libraries.

    Nevertheless I can not make it work. What I want is not a jar-file but a property file that has to be in the classpath of the system. Like f.eks. log4j. But in this case it is actually a linkage file to be used by IBM EGL Java Wrappers.

    Anybody knows how to do that?

    /Thomas
    Actually I have been testing it a bit further. I have created a test scenario with log4j.

    From my servers.xml:

    <library id="loggingLibrary">
       <fileset dir="c:/lib"   includes="log4j-1.2.17.jar, log4j.properties"/>
    </library>
     
    <application id="Log4jTestEAR" location="Log4jTestEAR.ear" name="Log4jTestEAR" type="ear">
       <classloader commonLibraryRef="loggingLibrary"/>
    </application>
    


    I have a Test Servlet with just a log statement. It finds the log4j-1.2.17.jar but not the log4j.properties file.

    [err] log4j:WARN No appenders could be found for logger (servlets.TestServlet).
    [err] log4j:WARN Please initialize the log4j system properly.
    


    I know that this is not the way to do it with log4j, but it is just to create a similar test case as my own scenario.

    /Thomas
    Updated on 2014-03-25T23:51:45Z at 2014-03-25T23:51:45Z by iron-man
  • Karl_tfa
    Karl_tfa
    1 Post

    Re: Liberty Profile 8.5 lib/ext

    ‏2014-07-28T19:18:09Z  
    Actually I have been testing it a bit further. I have created a test scenario with log4j.

    From my servers.xml:

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr"><library id="loggingLibrary"> <fileset dir="c:/lib" includes="log4j-1.2.17.jar, log4j.properties"/> </library> <application id="Log4jTestEAR" location="Log4jTestEAR.ear" name="Log4jTestEAR" type="ear"> <classloader commonLibraryRef="loggingLibrary"/> </application> </pre>

    I have a Test Servlet with just a log statement. It finds the log4j-1.2.17.jar but not the log4j.properties file.

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">[err] log4j:WARN No appenders could be found for logger (servlets.TestServlet). [err] log4j:WARN Please initialize the log4j system properly. </pre>

    I know that this is not the way to do it with log4j, but it is just to create a similar test case as my own scenario.

    /Thomas

    Hi Thomas,

     

    I know it's a bit late, but I think it's good to share what I found just for future reference.

     

    Try this in the service.xml

    <library id="loggingLibrary">

       <fileset dir="c:/lib"/>

       <folder dir="c:/lib" />

    </library>

     

    Based on the documentation of #1, <fileset> will only search content within a .jar or .zip, while <folder> will search content in a directory. Because .properties is not a .jar or .zip, it will be ignored by <fileset>.

     

    I don't know why they choose such a counter intuitive design, I hope they will fix it in next version.

    #1 http://pic.dhe.ibm.com/infocenter/radhelp/v9/index.jsp?topic=%2Fcom.ibm.websphere.wlp.nd.multiplatform.doc%2Fae%2Fcwlp_sharedlibrary.html

     

    Hope it help.

     

    Karl Huang

    Teach For America

    Java Developer

    One day, all children in this nation will have the opportunity to attain an excellent education.

    Updated on 2014-07-28T19:19:51Z at 2014-07-28T19:19:51Z by Karl_tfa