I think I found a bug in the implementation of URL Bundle.getEntry(String name);
It raises a ClassCastException when called on the system bundle since its content loader
is not a ContentLoaderImpl but actually a SystemBundleContentLoader. :-(
class BundleImpl
public URL getEntry(String name)
{
Object sm = System.getSecurityManager();
if (sm != null)
{
try
{
((SecurityManager) sm).checkPermission(new AdminPermission(this,
AdminPermission.RESOURCE));
}
catch (Exception e)
{
return null; // No permission
}
}
return m_felix.getBundleEntry(this, name);
}
class Felix
/**
* Implementation for Bundle.getEntry().
**/
protected URL getBundleEntry(BundleImpl bundle, String name)
{
if (bundle.getInfo().getState() == Bundle.UNINSTALLED)
{
throw new IllegalStateException("The bundle is uninstalled.");
}
==>> return ((ContentLoaderImpl) bundle.getInfo().getCurrentModule()
.getContentLoader()).getResourceFromContent(name);
}
Here is a patch for this problem.
It is basically moving the getResourceFromContent from ContentLoaderImpl to Felix,
which required to modify the FindEntriesEnumeration slightly.
Best regards,
Olivier Gruber, Ph.D.
Persistent & Distributed Object Platforms and Frameworks
IBM TJ Watson Research Center
- Re: Felix problem on jamvm/NSLU2 Niclas Hedhman
- Re: Felix problem on jamvm/NSLU2 Alex Karasulu
- Re: Felix problem on jamvm/NSLU2 Niclas Hedhman
- Re: Felix problem on jamvm/NSLU2 Michael E. Brown
- Re: Felix problem on jamvm/NSLU2 Jeff McAffer
- Re: Felix problem on jamvm/NSLU2 Didier Donsez
- Small bug... Olivier Gruber
- Re: Small bug... Richard S. Hall
- Bundle.getResources Olivier Gruber
- Re: Bundle.getResources Richard S. Hall
- Bug in Bundle.getEntry ? Olivier Gruber
- Re: Bug in Bundle.getEntry ? Richard S. Hall
- RE: Bug in Bundle.getEntry ? santillan
- Re: Bug in Bundle.getEntry ? Richard S. Hall
- Bundle.getResources Olivier Gruber
- Re: Bundle.getResources Jeff McAffer
- Re: Bundle.getResources Richard S. Hall
- Re: Bundle.getResources Olivier Gruber
- Re: Bundle.getResources Richard S. Hall