Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-6096

Pax Referencing Old Resource Bundle from Cache on Undeploy / Deploy

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jboss-fuse-6.3
    • jboss-fuse-6.3
    • Karaf
    • % %
    • Hide

      TBD

      Show
      TBD

    Description

      Tested against 6.2 and 6.3, pax-web 3.2.9 and and 4.2.7, same results.

      When re-deploying a bundle secured with Keycloak, the bundle reference to keycloak.json is linking back to the cached entry from the previous WebAppWebContainerContext.

      First time it's deployed, WebAppWebContainerContext.resourceCache has 2 HashMaps, one for the keycloak.json and one for the web.xml.

      Class Name                                                                                     | Shallow Heap | Retained Heap
      ------------------------------------------------------------------------------------------------------------------------------
      org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext @ 0xf1862f68                 |         40 B |         352 B
      |- <class&gt; class org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext @ 0xc22bf2d8|          0 B |           0 B
      |- rootPath java.lang.String @ 0xc0378bd0                                                      |         24 B |          24 B
      |- httpContext org.ops4j.pax.web.service.internal.DefaultHttpContext @ 0xf1864320              |         24 B |          24 B
      |- log org.ops4j.pax.logging.slf4j.Slf4jLogger @ 0xf1864848                                    |         24 B |          24 B
      |- resourceCache java.util.concurrent.ConcurrentHashMap @ 0xf1864860                           |         64 B |         240 B
      |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap @ 0xc0196ab0 System Class           |        136 B |         432 B
      |  |- table java.util.concurrent.ConcurrentHashMap$Node[16] @ 0xf1ca8628                       |         80 B |         176 B
      |  |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap$Node[] @ 0xc0196760              |          0 B |           0 B
      |  |  |- [2] java.util.concurrent.ConcurrentHashMap$Node @ 0xf1ca8678                          |         32 B |          32 B
      |  |  |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap$Node @ 0xc01967c8 System Class|          0 B |           0 B
      |  |  |  |- key java.lang.String @ 0xf1ca60a8  WEB-INF/keycloak.json                           |         24 B |          88 B
      |  |  |  |- val java.net.URL @ 0xf1ca84b8  bundle://felix/WEB-INF/keycloak.json                |         64 B |         264 B
      |  |  |  '- Total: 3 entries                                                                   |              |              
      |  |  |- [15] java.util.concurrent.ConcurrentHashMap$Node @ 0xf25b2af0                         |         32 B |          64 B
      |  |  |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap$Node @ 0xc01967c8 System Class|          0 B |           0 B
      |  |  |  |- key java.lang.String @ 0xf25b0610  WEB-INF/web.xml                                 |         24 B |          72 B
      |  |  |  |- val java.net.URL @ 0xf25b2990  bundle://felix/WEB-INF/web.xml                      |         64 B |         248 B
      |  |  |  |- next java.util.concurrent.ConcurrentHashMap$Node @ 0xf25def08                      |         32 B |          32 B
      ------------------------------------------------------------------------------------------------------------------------------
      

      Deployment looks good;

      10:45:36,948 | DEBUG | pool-7-thread-1  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | getting resource: [/WEB-INF/keycloak.json]                                 10:45:36,948 | DEBUG | pool-7-thread-1  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | not a URL or invalid URL: [/WEB-INF/keycloak.json], treating as a file path
      10:45:36,948 | DEBUG | pool-7-thread-1  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Searching bundle org.keycloak.example.demo.customer-portal-fuse-example [680] for resource [/WEB-INF/keycloak.json], normalized to [WEB-INF/keycloak.json]                                                                                                                10:45:36,948 | DEBUG | pool-7-thread-1  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Resource found as url [bundle://680.0:0/WEB-INF/keycloak.json]     
      10:45:36,948 | DEBUG | pool-7-thread-1  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | found resource: bundle://680.0:0/WEB-INF/keycloak.json                     10:45:37,065 | DEBUG | pool-7-thread-1  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | getting resource: [/WEB-INF/web.xml]                                       
      10:45:37,066 | DEBUG | pool-7-thread-1  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | not a URL or invalid URL: [/WEB-INF/web.xml], treating as a file path      10:45:37,066 | DEBUG | pool-7-thread-1  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Searching bundle org.keycloak.example.demo.customer-portal-fuse-example [680] for resource [/WEB-INF/web.xml], normalized to [WEB-INF/web.xml]                                                                                                                            10:45:37,066 | DEBUG | pool-7-thread-1  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Resource found as url [bundle://680.0:0/WEB-INF/web.xml]           
      10:45:37,066 | DEBUG | pool-7-thread-1  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | found resource: bundle://680.0:0/WEB-INF/web.xml
      

      Undeploy and redeploy the WAR, it creates a new WebAppWebContainerContext (old one linked the bundle which is gone is still there). This time, WebAppWebContainerContext.resourceCache only has 1 hashmap for the web.xml

      Class Name                                                                                     | Shallow Heap | Retained Heap
      ------------------------------------------------------------------------------------------------------------------------------
      org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext @ 0xfbfa02a0                 |         40 B |         936 B
      |- <class&gt; class org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext @ 0xc22bf2d8|          0 B |           0 B
      |- rootPath java.lang.String @ 0xc0378bd0                                                      |         24 B |          24 B
      |- bundle org.apache.felix.framework.BundleImpl @ 0xc15f71d0                                   |         72 B |       5.18 KB
      |- log org.ops4j.pax.logging.slf4j.Slf4jLogger @ 0xfbfa02c8                                    |         24 B |          24 B
      |- httpContext org.ops4j.pax.web.service.internal.DefaultHttpContext @ 0xfbfa02e0              |         24 B |          24 B
      |- mimeMappings java.util.HashMap @ 0xfbfa02f8                                                 |         48 B |          48 B
      |- resourceCache java.util.concurrent.ConcurrentHashMap @ 0xfbfa0328                           |         64 B |         800 B
      |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap @ 0xc0196ab0 System Class           |        136 B |         432 B
      |  |- table java.util.concurrent.ConcurrentHashMap$Node[16] @ 0xfbfa0368                       |         80 B |         736 B
      |  |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap$Node[] @ 0xc0196760              |          0 B |           0 B
      |  |  |- [15] java.util.concurrent.ConcurrentHashMap$Node @ 0xfbfa03b8                         |         32 B |         656 B
      |  |  |  |- <class&gt; class java.util.concurrent.ConcurrentHashMap$Node @ 0xc01967c8 System Class|          0 B |           0 B
      |  |  |  |- key java.lang.String @ 0xfbfa03d8  WEB-INF/web.xml                                 |         24 B |          72 B
      |  |  |  |- val java.net.URL @ 0xfbfa0420  bundle://felix/WEB-INF/web.xml                      |         64 B |         248 B
      |  |  |  |- next java.util.concurrent.ConcurrentHashMap$Node @ 0xfbfa0518                      |         32 B |         304 B
      ------------------------------------------------------------------------------------------------------------------------------
      
      

      Deployment succeeds, but login doesn't work at all. You can see it's still trying to reference keycloak.json from the old bundle (680) which doesn't exist. It's correctly looking for the web.xml at the new bundle, 681.

      10:48:49,767 | DEBUG | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | getting resource: [/WEB-INF/keycloak.json]                                 
      10:48:49,767 | DEBUG | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | not a URL or invalid URL: [/WEB-INF/keycloak.json], treating as a file path
      10:48:49,768 | DEBUG | pool-7-thread-3  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Searching bundle org.keycloak.example.demo.customer-portal-fuse-example [680] for resource [/WEB-INF/keycloak.json], normalized to [WEB-INF/keycloak.json]                                                                                                                
      10:48:49,768 | DEBUG | pool-7-thread-3  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Resource found as url [bundle://680.0:0/WEB-INF/keycloak.json]     
      10:48:49,768 | DEBUG | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | found resource: bundle://680.0:0/WEB-INF/keycloak.json                     
      10:48:49,768 | WARN  | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | URL canot be accessed: No bundle associated with resource: bundle://680.0:0/WEB-INF/keycloak.json                                                                                                                                                                                 
      10:48:49,768 | DEBUG | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | getting resource: [/WEB-INF/web.xml]                                       
      10:48:49,769 | DEBUG | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | not a URL or invalid URL: [/WEB-INF/web.xml], treating as a file path      
      10:48:49,769 | DEBUG | pool-7-thread-3  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Searching bundle org.keycloak.example.demo.customer-portal-fuse-example [681] for resource [/WEB-INF/web.xml], normalized to [WEB-INF/web.xml]                                                                                                                            
      10:48:49,769 | DEBUG | pool-7-thread-3  | WebAppWebContainerContext        | 251 - org.ops4j.pax.web.pax-web-extender-war - 3.2.9 | Resource found as url [bundle://681.0:0/WEB-INF/web.xml]           
      10:48:49,769 | DEBUG | pool-7-thread-3  | HttpServiceContext               | 93 - org.ops4j.pax.web.pax-web-jetty - 3.2.9 | found resource: bundle://681.0:0/WEB-INF/web.xml
      

      Attachments

        Issue Links

          Activity

            People

              ggrzybek Grzegorz Grzybek
              rhn-support-mrobson Matt Robson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: