felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guo Du (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-1867) ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug mode
Date Sat, 14 Nov 2009 13:30:39 GMT
ModuleImpl diagnoseClassLoadError throw NullPointerException for empty package name in debug

                 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

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)

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)

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.

View raw message