You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guo Du (JIRA)" <ji...@apache.org> on 2009/11/14 14:30:39 UTC

[jira] Created: (FELIX-1867) ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode

ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode
-------------------------------------------------------------------------------------------------

                 Key: FELIX-1867
                 URL: https://issues.apache.org/jira/browse/FELIX-1867
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: felix-2.0.2
         Environment: java 1.5/1.6
            Reporter: Guo Du


THE PROBLEM
org.apache.felix.framework.ModuleImpl$ModuleClassLoader throw
NullPointerException when try to load class with default package name
(empty package name) in debug mode (felix.log.level=4).
Felix framework version 2.0.0 (2.0.2 have the same problem)

BACKGROUND
I installed groovy 1.6.5 official release to felix framework, when
evaluate my script, it throw the NullPointerException because groovy
try to dynamically load java.util.Calendar. During the scan, it will
try to load class "java$util$Calendar". The wired format will be
treated by felix class loader as a class with an empty package name.
Following are the stack trace.
Caused by: java.lang.NullPointerException
       at org.apache.felix.framework.FelixResolverState.getResolvedCandidates(FelixResolverState.java:652)
       at org.apache.felix.framework.Felix$FelixResolver.getResolvedCandidates(Felix.java:3993)
       at org.apache.felix.framework.ModuleImpl.diagnoseClassLoadError(ModuleImpl.java:2144)
       at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:60)
       at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1644)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
       at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:660)

EXCEPTION POINT
org.apache.felix.framework.ModuleImpl
line:2136        try
line:2137        {
line:2138            pkgReq = new
Requirement(ICapability.PACKAGE_NAMESPACE, "(package=" + pkgName +
")");
line:2139        }
line:2140        catch (InvalidSyntaxException ex)
line:2141        {
line:2142            // This should never happen.
line:2143        }
line:2144        PackageSource[] exporters =
line:2145            resolver.getResolvedCandidates(pkgReq);

We need handle the exception at line:2142 or do something different
before line 2138.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1867) ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall resolved FELIX-1867.
------------------------------------

    Resolution: Fixed

I have committed a patch to address this. It affected not only the class loading error diagnosis code, but also dynamic import resolution. I think it is fixed in both places now. Please close this issue if you are satisfied with the result. Thanks.

> ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1867
>                 URL: https://issues.apache.org/jira/browse/FELIX-1867
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-2.0.2
>         Environment: java 1.5/1.6
>            Reporter: Guo Du
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> THE PROBLEM
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader throw
> NullPointerException when try to load class with default package name
> (empty package name) in debug mode (felix.log.level=4).
> Felix framework version 2.0.0 (2.0.2 have the same problem)
> BACKGROUND
> I installed groovy 1.6.5 official release to felix framework, when
> evaluate my script, it throw the NullPointerException because groovy
> try to dynamically load java.util.Calendar. During the scan, it will
> try to load class "java$util$Calendar". The wired format will be
> treated by felix class loader as a class with an empty package name.
> Following are the stack trace.
> Caused by: java.lang.NullPointerException
>        at org.apache.felix.framework.FelixResolverState.getResolvedCandidates(FelixResolverState.java:652)
>        at org.apache.felix.framework.Felix$FelixResolver.getResolvedCandidates(Felix.java:3993)
>        at org.apache.felix.framework.ModuleImpl.diagnoseClassLoadError(ModuleImpl.java:2144)
>        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:60)
>        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1644)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
>        at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:660)
> EXCEPTION POINT
> org.apache.felix.framework.ModuleImpl
> line:2136        try
> line:2137        {
> line:2138            pkgReq = new
> Requirement(ICapability.PACKAGE_NAMESPACE, "(package=" + pkgName +
> ")");
> line:2139        }
> line:2140        catch (InvalidSyntaxException ex)
> line:2141        {
> line:2142            // This should never happen.
> line:2143        }
> line:2144        PackageSource[] exporters =
> line:2145            resolver.getResolvedCandidates(pkgReq);
> We need handle the exception at line:2142 or do something different
> before line 2138.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-1867) ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode

Posted by "Guo Du (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guo Du closed FELIX-1867.
-------------------------


thanks

> ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1867
>                 URL: https://issues.apache.org/jira/browse/FELIX-1867
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-2.0.2
>         Environment: java 1.5/1.6
>            Reporter: Guo Du
>            Assignee: Richard S. Hall
>             Fix For: felix-2.0.3
>
>
> THE PROBLEM
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader throw
> NullPointerException when try to load class with default package name
> (empty package name) in debug mode (felix.log.level=4).
> Felix framework version 2.0.0 (2.0.2 have the same problem)
> BACKGROUND
> I installed groovy 1.6.5 official release to felix framework, when
> evaluate my script, it throw the NullPointerException because groovy
> try to dynamically load java.util.Calendar. During the scan, it will
> try to load class "java$util$Calendar". The wired format will be
> treated by felix class loader as a class with an empty package name.
> Following are the stack trace.
> Caused by: java.lang.NullPointerException
>        at org.apache.felix.framework.FelixResolverState.getResolvedCandidates(FelixResolverState.java:652)
>        at org.apache.felix.framework.Felix$FelixResolver.getResolvedCandidates(Felix.java:3993)
>        at org.apache.felix.framework.ModuleImpl.diagnoseClassLoadError(ModuleImpl.java:2144)
>        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:60)
>        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1644)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
>        at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:660)
> EXCEPTION POINT
> org.apache.felix.framework.ModuleImpl
> line:2136        try
> line:2137        {
> line:2138            pkgReq = new
> Requirement(ICapability.PACKAGE_NAMESPACE, "(package=" + pkgName +
> ")");
> line:2139        }
> line:2140        catch (InvalidSyntaxException ex)
> line:2141        {
> line:2142            // This should never happen.
> line:2143        }
> line:2144        PackageSource[] exporters =
> line:2145            resolver.getResolvedCandidates(pkgReq);
> We need handle the exception at line:2142 or do something different
> before line 2138.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1867) ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode

Posted by "Guo Du (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831146#action_12831146 ] 

Guo Du commented on FELIX-1867:
-------------------------------

verified against 2.0.3 release candidate:
https://repository.apache.org/content/repositories/orgapachefelix-001/

> ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1867
>                 URL: https://issues.apache.org/jira/browse/FELIX-1867
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-2.0.2
>         Environment: java 1.5/1.6
>            Reporter: Guo Du
>            Assignee: Richard S. Hall
>             Fix For: felix-2.0.3
>
>
> THE PROBLEM
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader throw
> NullPointerException when try to load class with default package name
> (empty package name) in debug mode (felix.log.level=4).
> Felix framework version 2.0.0 (2.0.2 have the same problem)
> BACKGROUND
> I installed groovy 1.6.5 official release to felix framework, when
> evaluate my script, it throw the NullPointerException because groovy
> try to dynamically load java.util.Calendar. During the scan, it will
> try to load class "java$util$Calendar". The wired format will be
> treated by felix class loader as a class with an empty package name.
> Following are the stack trace.
> Caused by: java.lang.NullPointerException
>        at org.apache.felix.framework.FelixResolverState.getResolvedCandidates(FelixResolverState.java:652)
>        at org.apache.felix.framework.Felix$FelixResolver.getResolvedCandidates(Felix.java:3993)
>        at org.apache.felix.framework.ModuleImpl.diagnoseClassLoadError(ModuleImpl.java:2144)
>        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:60)
>        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1644)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
>        at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:660)
> EXCEPTION POINT
> org.apache.felix.framework.ModuleImpl
> line:2136        try
> line:2137        {
> line:2138            pkgReq = new
> Requirement(ICapability.PACKAGE_NAMESPACE, "(package=" + pkgName +
> ")");
> line:2139        }
> line:2140        catch (InvalidSyntaxException ex)
> line:2141        {
> line:2142            // This should never happen.
> line:2143        }
> line:2144        PackageSource[] exporters =
> line:2145            resolver.getResolvedCandidates(pkgReq);
> We need handle the exception at line:2142 or do something different
> before line 2138.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1867) ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall updated FELIX-1867:
-----------------------------------

    Fix Version/s: felix-2.2.0
         Assignee: Richard S. Hall

> ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode
> -------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-1867
>                 URL: https://issues.apache.org/jira/browse/FELIX-1867
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-2.0.2
>         Environment: java 1.5/1.6
>            Reporter: Guo Du
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> THE PROBLEM
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader throw
> NullPointerException when try to load class with default package name
> (empty package name) in debug mode (felix.log.level=4).
> Felix framework version 2.0.0 (2.0.2 have the same problem)
> BACKGROUND
> I installed groovy 1.6.5 official release to felix framework, when
> evaluate my script, it throw the NullPointerException because groovy
> try to dynamically load java.util.Calendar. During the scan, it will
> try to load class "java$util$Calendar". The wired format will be
> treated by felix class loader as a class with an empty package name.
> Following are the stack trace.
> Caused by: java.lang.NullPointerException
>        at org.apache.felix.framework.FelixResolverState.getResolvedCandidates(FelixResolverState.java:652)
>        at org.apache.felix.framework.Felix$FelixResolver.getResolvedCandidates(Felix.java:3993)
>        at org.apache.felix.framework.ModuleImpl.diagnoseClassLoadError(ModuleImpl.java:2144)
>        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:60)
>        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1644)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:300)
>        at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:660)
> EXCEPTION POINT
> org.apache.felix.framework.ModuleImpl
> line:2136        try
> line:2137        {
> line:2138            pkgReq = new
> Requirement(ICapability.PACKAGE_NAMESPACE, "(package=" + pkgName +
> ")");
> line:2139        }
> line:2140        catch (InvalidSyntaxException ex)
> line:2141        {
> line:2142            // This should never happen.
> line:2143        }
> line:2144        PackageSource[] exporters =
> line:2145            resolver.getResolvedCandidates(pkgReq);
> We need handle the exception at line:2142 or do something different
> before line 2138.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.