Search code examples
spring-bootcachingosgilogbackwebsphere-liberty

FFDC Incident related to osgi cache in Websphere Liberty Core


I have a Spring Boot application deployed on a WLC (Websphere Liberty Core) application server. When I start my IHS and my server, everything goes well, but several errors occur afterwards. I see an error in my log (console.log).

FFDC Incident has been created: java.nio.file.NoSuchFileException: /applis/logs/19578-solaa/wlc/sa-19578_solaa_prod-prez-1/sa-19578_solaa_prod-prez-1/workarea/org.eclipse.osgi/58/data/cache/com.ibm.ws.app.manager_8/.cache/WEB-INF/lib/logback-core-1.2.3.jar

However, this dependency ‘logback-core-1.2.3.jar’ does exist in my Pom.xml and it is present in the delivered war file.

What’s link between osgi and my application ?

Start and stop WLC Clean osgi Cache


Solution

  • The application is not linked to OSGi. However, Liberty itself uses OSGI. One of the uses is to place component data in OSGI data folders. That "org.eclipse.osgi" folder is the root OSGI data folder. The path from the exception is for data managed by the "com.ibm.ws.app.manager" component of Liberty.

    There is a problem -- a JAR was deleted unexpectedly. To diagnose this problem, usual next steps are to look at the exception stack to determine what code is attempting to access the JAR and to see if there is processing which is happening on the server workarea files while the server is running. Normally, only the server should use files in the workarea. To have one be deleted while the server is running is unusual.

    Also possible, files in the server workarea do not have fixed locations. The OSGI assigned number can change, and component specific folders can change. Code other than the server should not rely on workarea files being in specific locations.


    This location:

    <SERVER_NAME>/workarea/org.eclipse.osgi/58/data/cache/com.ibm.ws.app.manager_8/.cache/WEB-INF/lib/logback-core-1.2.3.jar
    

    Has folders:

    • "workarea" A root folder for server generated data files.
    • "org.eclipse.osgi" The folder for OSGI component data.
    • "58" A folder specific to the "com.ibm.ws.app.manager" component. This number is assigned by OSGi and can change between server restarts, depending on what features are being used.
    • "data/cache/com.ibm.ws.app.manager_8/.cache" These folders are specific to how the application manager component manages its data. This folder is used to store nested archives, which must be extracted to disk to be accessed efficiently.
    • "WEB-INF/lib/logback-core-1.2.3.jar" This is an application specific archive, extracted to disk for efficient access.

    As another example, if the application "TestServlet" is being used, and the application archive "TestServlet.ear" has web module archive "TestServlet.war", and that has java archive "WEB-INF/lib/TestServlet.jar":

    TestServlet.ear/
       TestServlet.war/
           WEB-INF/lib/TestServlet.jar
    

    Then, the Liberty workarea will have a structure similar to the following:

    • <SERVER_NAME>/workarea/org.eclipse.osgi/51/data/cache/com.ibm.ws.app.manager_6/.cache/TestServlet.war
    • <SERVER_NAME>/workarea/org.eclipse.osgi/51/data/cache/com.ibm.ws.app.manager_6/.cache/WEB-INF/lib/TestServlet.jar

    Note the folder number "51" instead of "58", and the folder "manager_6" instead of "manager_8".