qarks.com Forum Index qarks.com
AVS forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JLeak

 
Post new topic   Reply to topic    qarks.com Forum Index -> JLeak
View previous topic :: View next topic  
Author Message
simonInOz



Joined: 17 Nov 2008
Posts: 2

PostPosted: Mon Nov 17, 2008 2:02 am    Post subject: JLeak Reply with quote

Hi - JLeak looks interesting.
But I can't seem to make it function properly (Windows XP).
The log says
Quote:

could not instantiate dynamically the enhancer for class loader sun.misc.Launcher$ExtClassLoader@1f6a7b9
Exception in thread "main" java.lang.NoClassDefFoundError: com/qarks/leakdetector/util/LeakLogListener
at com.sun.crypto.provider.SunJCE$1.<init>(DashoA13*..)
at com.sun.crypto.provider.SunJCE.<init>(DashoA13*..)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.security.jca.ProviderConfig$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Security.getImpl(Unknown Source)
at java.security.KeyStore.getInstance(Unknown Source)
at com.voiceworx.util.security.SymmetricCipherUtil.loadKey(SymmetricCipherUtil.java:120)
at com.voiceworx.util.security.SymmetricCipherUtil.decrypt(SymmetricCipherUtil.java:52)
at com.voiceworx.util.security.License.readFile(License.java:102)
at com.voiceworx.util.security.License.init(License.java:61)
at com.voiceworx.util.security.License.getLicense(License.java:84)
at com.voiceworx.Runner.<init>(Runner.java:113)
at com.voiceworx.Run.main(Run.java:7)

and stops.

Which is pretty boring of it, cause it looks like what I need. Am I running in the wrong mode (ie not ?
This is running in Eclipse , though I had the same result running in a dos box. (I also want to run it with Tomcat, but 1 step at a time).

JVM is JRE1.6.0_05

thanks, Simon
Back to top
View user's profile Send private message
spampete
Site Admin


Joined: 04 May 2007
Posts: 89

PostPosted: Mon Nov 17, 2008 11:00 am    Post subject: Reply with quote

Hello Simon

can you make another test using http://www.qarks.com/jleak/jleak.jar ?

let me know if it helps.

Pierre
Back to top
View user's profile Send private message Send e-mail
simonInOz



Joined: 17 Nov 2008
Posts: 2

PostPosted: Tue Nov 18, 2008 1:23 am    Post subject: Reply with quote

Hi Pierre,

I tried the new jar, with the same result. Just to be sure it was not something silly like spaces in file paths, I made sure the file paths were clear of spaces, moving Eclipse to c:\eclipse and the workspace to c:\workspace
This was running inside Eclipse (clean install of current version as of yesterday). Java 1.6.0_05

Annoying - it looks like some weird security problem.

The JLeak box pops up nicely, listing 4 classes I do indeed want to track, but does not actually work of course, unfortunately.

Any ideas? (I tried removing JMX to see if that was it, but no go - see logs below).

Simon (in Sydney where it is surprisingly cold and windy)


Quote:

could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@19f953d
cannot enhance sun/reflect/GeneratedMethodAccessor2
New enhancer for class loader sun.reflect.DelegatingClassLoader@19f953d
could not instantiate dynamically the enhancer for class loader javax.management.remote.rmi.NoCallStackClassLoader@99681b
cannot enhance com/sun/jmx/remote/internal/PRef
New enhancer for class loader javax.management.remote.rmi.NoCallStackClassLoader@99681b
could not instantiate dynamically the enhancer for class loader javax.management.remote.rmi.NoCallStackClassLoader@1808199
New enhancer for class loader javax.management.remote.rmi.NoCallStackClassLoader@1808199
cannot enhance com/sun/jmx/remote/internal/ProxyStub
could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@13a317a
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor1
New enhancer for class loader sun.reflect.DelegatingClassLoader@13a317a
could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@14a8cd1
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor2
New enhancer for class loader sun.reflect.DelegatingClassLoader@14a8cd1
could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@1551f60
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor3New enhancer for class loader sun.reflect.DelegatingClassLoader@1551f60

New enhancer for class loader sun.misc.Launcher$AppClassLoader@130c19b
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor4
could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@9ced8e
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor5
New enhancer for class loader sun.reflect.DelegatingClassLoader@7bb290
New enhancer for class loader sun.reflect.DelegatingClassLoader@9ced8e
could not instantiate dynamically the enhancer for class loader sun.misc.Launcher$ExtClassLoader@1f6a7b9
New enhancer for class loader sun.misc.Launcher$ExtClassLoader@1f6a7b9
Exception in thread "main" java.lang.NoClassDefFoundError: com/qarks/leakdetector/util/LeakLogListener
at com.sun.crypto.provider.SunJCE$1.<init>(DashoA13*..)
at com.sun.crypto.provider.SunJCE.<init>(DashoA13*..)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.security.jca.ProviderConfig$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Security.getImpl(Unknown Source)
at java.security.KeyStore.getInstance(Unknown Source)
at com.voiceworx.util.security.SymmetricCipherUtil.loadKey(SymmetricCipherUtil.java:120)
at com.voiceworx.util.security.SymmetricCipherUtil.decrypt(SymmetricCipherUtil.java:52)
at com.voiceworx.util.security.License.readFile(License.java:102)
at com.voiceworx.util.security.License.init(License.java:61)
at com.voiceworx.util.security.License.getLicense(License.java:84)
at com.voiceworx.Runner.<init>(Runner.java:113)
at com.voiceworx.Run.main(Run.java:7)


I TRIED RUNNING WITHOUT JMX

Quote:

New enhancer for class loader sun.misc.Launcher$AppClassLoader@130c19b
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor1
New enhancer for class loader sun.reflect.DelegatingClassLoader@16672d6
could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@1386000
New enhancer for class loader sun.reflect.DelegatingClassLoader@1386000
cannot enhance sun/reflect/GeneratedSerializationConstructorAccessor2
could not instantiate dynamically the enhancer for class loader sun.misc.Launcher$ExtClassLoader@1f6a7b9
New enhancer for class loader sun.misc.Launcher$ExtClassLoader@1f6a7b9
Exception in thread "main" java.lang.NoClassDefFoundError: com/qarks/leakdetector/util/LeakLogListener
at com.sun.crypto.provider.SunJCE$1.<init>(DashoA13*..)
at com.sun.crypto.provider.SunJCE.<init>(DashoA13*..)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.security.jca.ProviderConfig$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getProvider(Unknown Source)
at sun.security.jca.ProviderList.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Security.getImpl(Unknown Source)
at java.security.KeyStore.getInstance(Unknown Source)
at com.voiceworx.util.security.SymmetricCipherUtil.loadKey(SymmetricCipherUtil.java:120)
at com.voiceworx.util.security.SymmetricCipherUtil.decrypt(SymmetricCipherUtil.java:52)
at com.voiceworx.util.security.License.readFile(License.java:102)
at com.voiceworx.util.security.License.init(License.java:61)
at com.voiceworx.util.security.License.getLicense(License.java:84)
at com.voiceworx.Runner.<init>(Runner.java:113)
at com.voiceworx.Run.main(Run.java:7)
New enhancer for class loader sun.reflect.DelegatingClassLoader@d6c16c
could not instantiate dynamically the enhancer for class loader sun.reflect.DelegatingClassLoader@d6c16c
cannot enhance sun/reflect/GeneratedMethodAccessor2
Back to top
View user's profile Send private message
spampete
Site Admin


Joined: 04 May 2007
Posts: 89

PostPosted: Tue Nov 18, 2008 4:31 pm    Post subject: Reply with quote

I have updated the test jar, can you have another try with http://www.qarks.com/jleak/jleak.jar ?

It contains a fix which I never had to use until now, but which can solve the ClassNotFoundException issue you are experiencing. This fix is non deterministic since it relies on the fact the given class loader used to instantiate your classes extends URLClassLoader, and you do not necesarily own the class loader...

If it does not help, I would suggest that you isolate the class instantiation which fails, SymmetricCipherUtil, and create the most simple eclipse project possible showing the issue, that you could send me over by mail so I can try debugging.

Pierre
Back to top
View user's profile Send private message Send e-mail
spampete
Site Admin


Joined: 04 May 2007
Posts: 89

PostPosted: Tue Dec 02, 2008 4:59 pm    Post subject: Reply with quote

So, just to let people know, since we ended up fixing this issue by email..

the ClassNotFoundException has indeed been fixed through adding the jleak archive to all the application class loaders involved. The fix is not fully deterministic since all class loaders do not necessarily extend URLClassLoader nor use a parent class loader extending it.

At least, it fixed Simon's issue, but then another one I cannot reproduce showed up on Simon's environment, with a strange LinkageError when opening the 2nd window showing where the instance have been created.

The release 1.0.2 fixes issues on serialized classes which used to generate unmarshalling exceptions due to incompatible serialVersionUID. Most of the issue is fixed, but some classes on my test bench still produce the issue, so not fully fixed. An exclude list allows filtering those classes, but this is just a workaround. If anyone has a clue on this one, just let us know !!

JLeak is not as perfect as commercial memory leak detectors, but remember it is free. I hope it can also be considered as a good example for developers who would like working with javassist.

cheers
Back to top
View user's profile Send private message Send e-mail
spampete
Site Admin


Joined: 04 May 2007
Posts: 89

PostPosted: Thu Dec 04, 2008 10:05 am    Post subject: javassist and serialVersionUID Reply with quote

ok, issue with the few classes which still had unmarshalling exceptions is fixed with a small patch within javassist.

If you are interested in the topic, please go to http://www.jboss.com/index.html?module=bb&op=viewtopic&t=146712

cheers
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    qarks.com Forum Index -> JLeak All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group