Pinned topic Liberty Profile 8.5 lib/ext
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:
I have tried to look in the documentation but nothing comes up.
Can someone point me in the right direction?
bkail 120000PS1Y372 PostsACCEPTED ANSWER
Re: Liberty Profile 8.5 lib/ext2012-10-11T16:25:46Z in response to SystemAdminI would suggest configuring a library and specifically referencing it from your application rather than relying on a single directory:
If you really do need/want a global directory, see the "Providing global libraries for all Java EE applications" topic.
Re: Liberty Profile 8.5 lib/ext2012-11-19T08:46:40Z in response to bkailHi
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?
Re: Liberty Profile 8.5 lib/ext2012-11-22T07:44:51Z in response to SystemAdminActually 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.
/ThomasUpdated on 2014-03-25T23:51:45Z at 2014-03-25T23:51:45Z by iron-man
Karl_tfa 270006A3EJ1 PostACCEPTED ANSWER
Re: Liberty Profile 8.5 lib/ext2014-07-28T19:18:09Z in response to SystemAdmin
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">
<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.
Hope it help.
Teach For America
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