You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Balazs Zsoldos (JIRA)" <ji...@apache.org> on 2017/05/23 06:36:04 UTC

[jira] [Created] (FELIX-5643) Exceptions are swallowed on Android

Balazs Zsoldos created FELIX-5643:
-------------------------------------

             Summary: Exceptions are swallowed on Android
                 Key: FELIX-5643
                 URL: https://issues.apache.org/jira/browse/FELIX-5643
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-5.6.2
         Environment: Android
            Reporter: Balazs Zsoldos


In case of Android, the following lines will run on Android:

{code:java}
try
{
    clazz = getDexFileClass((JarContent) content, name, this);
}
catch (Exception ex)
{
    // Looks like we can't
}
{code}

The _getDexFileClass_ function throws an exception only if the OSGi container is started within an Android environment and if there was an exception we want to know about. E.g.:

 - Exception during initialization of class (static block or initialization of static field)
 - ClassNotFoundException. E.g.: The loaded class implements an interface that is not available in the Android environment

If the OSGi container is not started within an Android environment, the _getDexFileClass_ will not throw an exception for sure.

If the OSGi container is started within an Android environment, the content of the exception is important and the fallback logic will be always wrong as the class cannot be loaded in the standard way.

I suggest not to ignore this exception as it makes very hard to solve issues within Android. Problems can be solved only via debugging.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)