You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by galaxy <ti...@gmail.com> on 2009/08/03 12:21:43 UTC
A problem when debug in classloading of felix
Hi all
I have encountered a rather strange problem in debug when I want to see the
classloading in felix
Below is the setting
First launch the framework ,then the following code fragments :
....
bundle = m_felix.getBundleContext().getBundle(1); // 1 is the ID
of Apache Felix Shell Service (1.2.0)
clazz = bundle.loadClass("org.apache.felix.shell.impl.HelpCommandImpl");
System.out.println(clazz.getClassLoader());
....
So I set a breakpoint in the BundleImpl.loadClass() ,which I expected to
encounter but never got there .
Instead , when I press F5 at line (
"clazz = bundle.loadClass("org.apache.felix.shell.impl.HelpCommandImpl"); "
in eclipse , it came to the red line in [1].
I did some search but still don't know why this happens .
Could anyone help me ?Thanks
[1]BundleImpl
void setPersistentStateActive()
{
try
{
m_archive.setPersistentState(Bundle.ACTIVE);
}
catch (Exception ex)
{
getFramework().getLogger().log(
Logger.LOG_ERROR,
"Error writing persistent state to bundle archive.",
ex);
}
}
--
regards
Tian
Re: A problem when debug in classloading of felix
Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 8/3/09 6:21, galaxy wrote:
> Hi all
> I have encountered a rather strange problem in debug when I want to see the
> classloading in felix
>
> Below is the setting
>
> First launch the framework ,then the following code fragments :
> ....
> bundle = m_felix.getBundleContext().getBundle(1); // 1 is the ID
> of Apache Felix Shell Service (1.2.0)
> clazz = bundle.loadClass("org.apache.felix.shell.impl.HelpCommandImpl");
> System.out.println(clazz.getClassLoader());
> ....
>
> So I set a breakpoint in the BundleImpl.loadClass() ,which I expected to
> encounter but never got there .
> Instead , when I press F5 at line (
> "clazz = bundle.loadClass("org.apache.felix.shell.impl.HelpCommandImpl");"
> in eclipse , it came to the red line in [1].
> I did some search but still don't know why this happens .
> Could anyone help me ?Thanks
>
Are you sure your source version matches your binary version?
-> richard
> [1]BundleImpl
> void setPersistentStateActive()
> {
> try
> {
> m_archive.setPersistentState(Bundle.ACTIVE);
> }
> catch (Exception ex)
> {
> getFramework().getLogger().log(
> Logger.LOG_ERROR,
> "Error writing persistent state to bundle archive.",
> ex);
> }
> }
>
>