[ 
https://issues.apache.org/jira/browse/SLING-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15625474#comment-15625474
 ] 

Antonio Sanso commented on SLING-6222:
--------------------------------------

proposed patch 

{code}
Index: 
src/main/java/org/apache/sling/commons/mime/internal/MimeTypeServiceImpl.java
===================================================================
--- 
src/main/java/org/apache/sling/commons/mime/internal/MimeTypeServiceImpl.java   
    (revision 1765930)
+++ 
src/main/java/org/apache/sling/commons/mime/internal/MimeTypeServiceImpl.java   
    (working copy)
@@ -255,11 +255,15 @@
 
     @Override
     public void bundleChanged(BundleEvent event) {
-        if (event.getType() == BundleEvent.RESOLVED) {
-            this.registerMimeType(event.getBundle().getEntry(MIME_TYPES));
+        try {
+            if (event.getType() == BundleEvent.RESOLVED) {
+                this.registerMimeType(event.getBundle().getEntry(MIME_TYPES));
+            }
+        } catch (IllegalStateException ie) {
+            log(LogService.LOG_INFO, "bundleChanged: The bundle is 
uninstalled", null);
         }
     }
-
+    
     // ---------- plugin support 
-----------------------------------------------
 
     Map<String, String> getMimeMap() {
{code}

> [Startup ERROR] org.apache.sling.commons.mime FrameworkEvent ERROR (The 
> bundle is uninstalled.)
> -----------------------------------------------------------------------------------------------
>
>                 Key: SLING-6222
>                 URL: https://issues.apache.org/jira/browse/SLING-6222
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>            Reporter: Antonio Sanso
>            Assignee: Antonio Sanso
>            Priority: Minor
>
> During startup, the following ERROR randomly appears in the logs:
> {code}
> 25.10.2016 07:57:53.712 *ERROR* [FelixDispatchQueue] 
> org.apache.sling.commons.mime FrameworkEvent ERROR 
> (java.lang.IllegalStateException: The bundle is uninstalled.)
> java.lang.IllegalStateException: The bundle is uninstalled.
>       at org.apache.felix.framework.Felix.getBundleEntry(Felix.java:1741)
>       at org.apache.felix.framework.BundleImpl.getEntry(BundleImpl.java:291)
>       at 
> org.apache.sling.commons.mime.internal.MimeTypeServiceImpl.bundleChanged(MimeTypeServiceImpl.java:249)
>       at 
> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:916)
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:835)
>       at 
> org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:1148)
>       at 
> org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:55)
>       at 
> org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:103)
>       at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to