You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benoit Pradelle <ze...@yahoo.fr> on 2007/06/21 16:53:01 UTC

hprof with Felix

Hi all,

I'm working on a project which use Felix and I want to use Hprof (a java 
profiler from Sun) with it. I tried to launch the project simply adding 
the -agentlib:hprof command line argument.

The problem is that for every bundle loaded at the begining of the app, 
I got this error :  "java.lang.NoClassDefFoundError: 
sun/tools/hprof/Tracker".
I'm sure that it's a little setting to do but I'm not familiar with 
Felix and I don't know how to solve this.
Can you tell me how to do ?

(I tried to add sun.tools.hprof to the 
org.osgi.framework.system.packages variable but it didn't solve the problem)

Thanks in advance,
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: hprof with Felix

Posted by Benoit Pradelle <ze...@yahoo.fr>.
Ok this works, I had to switch to java6 but now it's working, thank you 
very much for your quick and precise help !

Ben

Richard S. Hall a écrit :
> I tried this:
>
> /usr/java/jdk1.6.0_01/bin/java -agentlib:hprof -jar bin/felix.jar
>
> and got this:
>
> Welcome to Felix.
> =================
>
> Enter profile name: profiler
>
> DEBUG: WIRE: 1.0 -> org.ungoverned.osgi.service.shell -> 1.0
> DEBUG: WIRE: 1.0 -> org.osgi.service.startlevel -> 0
> DEBUG: WIRE: 1.0 -> org.apache.felix.shell -> 1.0
> DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 1.0 -> org.osgi.service.packageadmin -> 0
> ERROR: Error starting 
> file:bundle/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar 
> (org.osgi.framework.BundleException: Activator start error.)
> java.lang.NoClassDefFoundError: com/sun/demo/jvmti/hprof/Tracker
>        at org.apache.felix.shell.impl.Activator.start(Activator.java:38)
>        at 
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589) 
>
>        at org.apache.felix.framework.Felix._startBundle(Felix.java:1309)
>        at org.apache.felix.framework.Felix.startBundle(Felix.java:1243)
>        at 
> org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:838)
>        at 
> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:256)
>        at java.lang.Thread.run(Thread.java:619)
>
> So I added this to config.properties:
>
> org.osgi.framework.bootdelegation=com.sun.demo.jvmti.hprof.*
>
> And then I got this:
>
> heavy:felix-trunk/main$ /usr/java/jdk1.6.0_01/bin/java -agentlib:hprof 
> -jar bin/felix.jar
>
> Welcome to Felix.
> =================
>
> Enter profile name: profiler
>
> DEBUG: WIRE: 1.0 -> org.ungoverned.osgi.service.shell -> 1.0
> DEBUG: WIRE: 1.0 -> org.osgi.service.startlevel -> 0
> DEBUG: WIRE: 1.0 -> org.apache.felix.shell -> 1.0
> DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 1.0 -> org.osgi.service.packageadmin -> 0
> DEBUG: WIRE: 2.0 -> org.apache.felix.shell -> 1.0
> DEBUG: WIRE: 2.0 -> org.osgi.framework -> 0
> -> DEBUG: WIRE: 3.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 3.0 -> org.osgi.service.obr -> 3.0
> DEBUG: WIRE: 3.0 -> org.apache.felix.shell -> 1.0
>
> -> shutdown
> -> Dumping Java heap ... allocation sites ... done.
>
> So, that looks ok.
>
> -> richard
>
>
> Benoit Pradelle wrote:
>> I tried what you suggested sadly it's not working to me, nothing 
>> changes, I still got the same exception.
>>
>> Ben
>>
>> Richard S. Hall a écrit :
>>> You probably want to add sun.tools.hprof to the 
>>> org.osgi.framework.bootdelegation property, which is used to provide 
>>> bundles implicit access to stuff on the class 
>>> path...org.osgi.framework.system.packages still requires bundles to 
>>> explicitly import the package, which is not what you want.
>>>
>>> -> richard
>>>
>>> Benoit Pradelle wrote:
>>>> Hi all,
>>>>
>>>> I'm working on a project which use Felix and I want to use Hprof (a 
>>>> java profiler from Sun) with it. I tried to launch the project 
>>>> simply adding the -agentlib:hprof command line argument.
>>>>
>>>> The problem is that for every bundle loaded at the begining of the 
>>>> app, I got this error :  "java.lang.NoClassDefFoundError: 
>>>> sun/tools/hprof/Tracker".
>>>> I'm sure that it's a little setting to do but I'm not familiar with 
>>>> Felix and I don't know how to solve this.
>>>> Can you tell me how to do ?
>>>>
>>>> (I tried to add sun.tools.hprof to the 
>>>> org.osgi.framework.system.packages variable but it didn't solve the 
>>>> problem)
>>>>
>>>> Thanks in advance,
>>>> Ben
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: hprof with Felix

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I tried this:

/usr/java/jdk1.6.0_01/bin/java -agentlib:hprof -jar bin/felix.jar

and got this:

Welcome to Felix.
=================

Enter profile name: profiler

DEBUG: WIRE: 1.0 -> org.ungoverned.osgi.service.shell -> 1.0
DEBUG: WIRE: 1.0 -> org.osgi.service.startlevel -> 0
DEBUG: WIRE: 1.0 -> org.apache.felix.shell -> 1.0
DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 1.0 -> org.osgi.service.packageadmin -> 0
ERROR: Error starting 
file:bundle/org.apache.felix.shell-0.9.0-incubator-SNAPSHOT.jar 
(org.osgi.framework.BundleException: Activator start error.)
java.lang.NoClassDefFoundError: com/sun/demo/jvmti/hprof/Tracker
        at org.apache.felix.shell.impl.Activator.start(Activator.java:38)
        at 
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
        at org.apache.felix.framework.Felix._startBundle(Felix.java:1309)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1243)
        at 
org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:838)
        at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:256)
        at java.lang.Thread.run(Thread.java:619)

So I added this to config.properties:

org.osgi.framework.bootdelegation=com.sun.demo.jvmti.hprof.*

And then I got this:

heavy:felix-trunk/main$ /usr/java/jdk1.6.0_01/bin/java -agentlib:hprof 
-jar bin/felix.jar

Welcome to Felix.
=================

Enter profile name: profiler

DEBUG: WIRE: 1.0 -> org.ungoverned.osgi.service.shell -> 1.0
DEBUG: WIRE: 1.0 -> org.osgi.service.startlevel -> 0
DEBUG: WIRE: 1.0 -> org.apache.felix.shell -> 1.0
DEBUG: WIRE: 1.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 1.0 -> org.osgi.service.packageadmin -> 0
DEBUG: WIRE: 2.0 -> org.apache.felix.shell -> 1.0
DEBUG: WIRE: 2.0 -> org.osgi.framework -> 0
-> DEBUG: WIRE: 3.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 3.0 -> org.osgi.service.obr -> 3.0
DEBUG: WIRE: 3.0 -> org.apache.felix.shell -> 1.0

-> shutdown
-> Dumping Java heap ... allocation sites ... done.

So, that looks ok.

-> richard


Benoit Pradelle wrote:
> I tried what you suggested sadly it's not working to me, nothing 
> changes, I still got the same exception.
>
> Ben
>
> Richard S. Hall a écrit :
>> You probably want to add sun.tools.hprof to the 
>> org.osgi.framework.bootdelegation property, which is used to provide 
>> bundles implicit access to stuff on the class 
>> path...org.osgi.framework.system.packages still requires bundles to 
>> explicitly import the package, which is not what you want.
>>
>> -> richard
>>
>> Benoit Pradelle wrote:
>>> Hi all,
>>>
>>> I'm working on a project which use Felix and I want to use Hprof (a 
>>> java profiler from Sun) with it. I tried to launch the project 
>>> simply adding the -agentlib:hprof command line argument.
>>>
>>> The problem is that for every bundle loaded at the begining of the 
>>> app, I got this error :  "java.lang.NoClassDefFoundError: 
>>> sun/tools/hprof/Tracker".
>>> I'm sure that it's a little setting to do but I'm not familiar with 
>>> Felix and I don't know how to solve this.
>>> Can you tell me how to do ?
>>>
>>> (I tried to add sun.tools.hprof to the 
>>> org.osgi.framework.system.packages variable but it didn't solve the 
>>> problem)
>>>
>>> Thanks in advance,
>>> Ben
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: hprof with Felix

Posted by Benoit Pradelle <ze...@yahoo.fr>.
I tried what you suggested sadly it's not working to me, nothing 
changes, I still got the same exception.

Ben

Richard S. Hall a écrit :
> You probably want to add sun.tools.hprof to the 
> org.osgi.framework.bootdelegation property, which is used to provide 
> bundles implicit access to stuff on the class 
> path...org.osgi.framework.system.packages still requires bundles to 
> explicitly import the package, which is not what you want.
>
> -> richard
>
> Benoit Pradelle wrote:
>> Hi all,
>>
>> I'm working on a project which use Felix and I want to use Hprof (a 
>> java profiler from Sun) with it. I tried to launch the project simply 
>> adding the -agentlib:hprof command line argument.
>>
>> The problem is that for every bundle loaded at the begining of the 
>> app, I got this error :  "java.lang.NoClassDefFoundError: 
>> sun/tools/hprof/Tracker".
>> I'm sure that it's a little setting to do but I'm not familiar with 
>> Felix and I don't know how to solve this.
>> Can you tell me how to do ?
>>
>> (I tried to add sun.tools.hprof to the 
>> org.osgi.framework.system.packages variable but it didn't solve the 
>> problem)
>>
>> Thanks in advance,
>> Ben
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: hprof with Felix

Posted by "Richard S. Hall" <he...@ungoverned.org>.
You probably want to add sun.tools.hprof to the 
org.osgi.framework.bootdelegation property, which is used to provide 
bundles implicit access to stuff on the class 
path...org.osgi.framework.system.packages still requires bundles to 
explicitly import the package, which is not what you want.

-> richard

Benoit Pradelle wrote:
> Hi all,
>
> I'm working on a project which use Felix and I want to use Hprof (a 
> java profiler from Sun) with it. I tried to launch the project simply 
> adding the -agentlib:hprof command line argument.
>
> The problem is that for every bundle loaded at the begining of the 
> app, I got this error :  "java.lang.NoClassDefFoundError: 
> sun/tools/hprof/Tracker".
> I'm sure that it's a little setting to do but I'm not familiar with 
> Felix and I don't know how to solve this.
> Can you tell me how to do ?
>
> (I tried to add sun.tools.hprof to the 
> org.osgi.framework.system.packages variable but it didn't solve the 
> problem)
>
> Thanks in advance,
> Ben
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org