[jboss-user] [JBoss AOP] - Re: Multiple ClassLoaders problem?

fr0w do-not-reply at jboss.com
Thu Jun 26 15:31:54 EDT 2008


After some careful debuggin I managed to trace what's probably causing my issues:

That's the execution Stack of my thread.

  | Thread [FtpConn thread 20 from <iphidden> - pool-3-thread-1] (Suspended)	
  | 	AspectManager.registerClassLoader(ClassLoader) line: 762	
  | 	AspectManager.findClassPool(ClassLoader) line: 750	
  | 	MethodJoinPointGenerator(JoinPointGenerator).doGenerateJoinPointClass(ClassLoader, JoinPointInfo) line: 283	
  | 	JoinPointGenerator.access$300(JoinPointGenerator, ClassLoader, JoinPointInfo) line: 77	
  | 	JoinPointGenerator$GenerateJoinPointClassAction$2.generateJoinPointClass(ClassLoader, JoinPointGenerator, JoinPointInfo) line: 1729	
  | 	MethodJoinPointGenerator(JoinPointGenerator).generateJoinPointClass(ClassLoader, JoinPointInfo) line: 250	
  | 	DirectoryHandle$DirectoryHandleAdvisor(GeneratedClassAdvisor).generateJoinPointClass(MethodInfo) line: 1042	
  | 	DirectoryHandle$DirectoryHandleAdvisor(InodeHandle$InodeHandleAdvisor).toString6853976482757027775(InodeHandle) line: not available	
  | 	DirectoryHandle(InodeHandle).toString() line: not available	
  | 	String.valueOf(Object) line: 2827	
  | 	StringBuilder.append(Object) line: 115	
  | 	LIST.list(CommandRequest, boolean) line: 364	
  | 	LIST.doLIST(CommandRequest) line: 406	
  | 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
  | 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
  | 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
  | 	Method.invoke(Object, Object...) line: 597	
  | 	StandardCommandManager.execute(CommandRequestInterface) line: 238	
  | 	BaseFtpConnection$CommandThread.run() line: 634	
  | 	ThreadPoolExecutor$Worker.runTask(Runnable) line: 885	
  | 	ThreadPoolExecutor$Worker.run() line: 907	
  | 	Thread.run() line: 619	
  | 

And here is the code from AspectManager.findClassPool(ClassLoader) line: 750	


  |    public ClassPool findClassPool(ClassLoader cl)
  |    {
  |       if (!(cl instanceof Translatable))
  |       {
  |          // findClassPool has problems with boot and system classes.
  |          return registerClassLoader(SecurityActions.getContextClassLoader());
  |       }
  |       return registerClassLoader(cl);
  |    }
  | 

Through the debug interface I managed to see that the "cl" argument of the findClassPool() method is a JPF ClassLoader but seems like this ClassLoader isn't an instance of Translatable (whatever this means, maybe you can explain me). So the class loader that is passed as an argument of AspectManager.registerClassLoader() is actually something that is returned by SecurityActions.getContextClassLoader() (I also managed to see what kind of ClassLoader this method returns and it is an instance of Launcher$AppClassLoader (Sun's JVM main ClassLoader)), then even though the ClassLoader was correct the ClassPool that is returned by the findClassPool() method has the 'classLoader' property set to something improper!


  | Thread [FtpConn thread 20 from <iphidden> - pool-3-thread-1] (Suspended)	
  | 	StandaloneClassPool(ClassPool).get(String) line: 430	
  | 	MethodJoinPointGenerator(JoinPointGenerator).generateJoinpointClass(ClassPool, JoinPointInfo, ClassLoader, ProtectionDomain) line: 359	
  | 	MethodJoinPointGenerator(JoinPointGenerator).doGenerateJoinPointClass(ClassLoader, JoinPointInfo) line: 285	
  | 	JoinPointGenerator.access$300(JoinPointGenerator, ClassLoader, JoinPointInfo) line: 77	
  | 	JoinPointGenerator$GenerateJoinPointClassAction$2.generateJoinPointClass(ClassLoader, JoinPointGenerator, JoinPointInfo) line: 1729	
  | 	MethodJoinPointGenerator(JoinPointGenerator).generateJoinPointClass(ClassLoader, JoinPointInfo) line: 250	
  | 	DirectoryHandle$DirectoryHandleAdvisor(GeneratedClassAdvisor).generateJoinPointClass(MethodInfo) line: 1042	
  | 	DirectoryHandle$DirectoryHandleAdvisor(InodeHandle$InodeHandleAdvisor).toString6853976482757027775(InodeHandle) line: not available	
  | 	DirectoryHandle(InodeHandle).toString() line: not available	
  | 	String.valueOf(Object) line: 2827	
  | 	StringBuilder.append(Object) line: 115	
  | 	LIST.doLIST(CommandRequest) line: 406	
  | 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
  | 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
  | 	LIST.list(CommandRequest, boolean) line: 364	
  | 	Method.invoke(Object, Object...) line: 597	
  | 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
  | 	StandardCommandManager.execute(CommandRequestInterface) line: 238	
  | 	BaseFtpConnection$CommandThread.run() line: 634	
  | 	ThreadPoolExecutor$Worker.runTask(Runnable) line: 885	
  | 	ThreadPoolExecutor$Worker.run() line: 907	
  | 	Thread.run() line: 619	
  | 
  | 

MethodJoinPointGenerator(JoinPointGenerator).generateJoinpointClass(ClassPool pool, JoinPointInfo newInfo, ClassLoader classloader, ProtectionDomain pd)

  | this	MethodJoinPointGenerator  (id=458)	
  | pool	StandaloneClassPool  (id=1339)	
  | newInfo	MethodInfo  (id=102)	
  | classloader	StandardPluginClassLoader  (id=423)	
  | pd	ProtectionDomain  (id=541)	
  | 

A view of the pool variable.

  | pool	StandaloneClassPool  (id=1339)	
  | 	classLoader	WeakReference<T>  (id=1353)	
  | 		discovered	null	
  | 		next	null	
  | 		queue	ReferenceQueue$Null  (id=124)	
  | 		referent	Launcher$AppClassLoader  (id=143)	
  | 
	
So right now my bet is that due to some problem(?) a JPF ClassLoader cannot be an instance of Translatable.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160969#4160969

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160969



More information about the jboss-user mailing list