Has this got something to do with FELIX-143? --
Manuel Santillán <[EMAIL PROTECTED]> http://www.dit.upm.es/santillan Departamento de Ingeniería de Sistemas Telemáticos Escuela Técnica Superior de Ingenieros de Telecomunicación Universidad Politécnica de Madrid Avda. Complutense, s/n 28040 Madrid SPAIN Tel. +34 913367366 ext.3034 -----Mensaje original----- De: Richard S. Hall [mailto:[EMAIL PROTECTED] Enviado el: martes, 19 de septiembre de 2006 18:21 Para: felix-dev@incubator.apache.org Asunto: Re: Bug in Bundle.getEntry ? The patch appears to not have been attached to the message... Better yet, perhaps you could create a JIRA issue for this on the framework component and attach the patch to it. http://issues.apache.org/jira/browse/Felix Thanks. -> richard Olivier Gruber wrote: > > 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 >