[ 
http://jira.jboss.com/jira/browse/JBCACHE-37?page=comments#action_12314997 ]
     
Andrew May commented on JBCACHE-37:
-----------------------------------

Firstly, could I ask whether this is still being looked at in light of my 
previous comment? If so, could you re-open the bug.

I've been trying to see if using more recent versions of various parts of the 
code (jboss-cache, javaassist, jboss-aop etc.) would help, but they don't, and 
now that I look at where the stack overflow is occuring, I can see how it 
happens (if not why).

JBossClassPool extends AOPClassPool extends ClassPool (from javaassist).

In JBossClassPool.toClass(CtClass, ClassLoader) (which overrides the method in 
ClassPool):

   public Class toClass(CtClass cc, ClassLoader loader)
           throws CannotCompileException
   {
      if (dcl == null || tempdir == null)
      {
         return super.toClass(cc);
      }

In ClassPool.toClass(CtClasss):

   public Class toClass(CtClass clazz) throws CannotCompileException {
      return toClass(clazz, Thread.currentThread().getContextClassLoader());
   }                      

Therefore, if either dcl or tempdir are null in JBossClassPool a Stack Overflow 
is, I think, inevitable.

Any ideas how/why this happens?

-Andrew

> Stack Overflow when using Collection classes in TreeCacheAop
> ------------------------------------------------------------
>
>          Key: JBCACHE-37
>          URL: http://jira.jboss.com/jira/browse/JBCACHE-37
>      Project: JBoss Cache
>         Type: Bug
>     Versions: 1.2
>  Environment: JBoss 4.0.1, JDK 1.5 (and also 1.4.2), Linux (Mandrake 10.0)
>     Reporter: Andrew May
>     Assignee: Ben Wang
>      Fix For: 1.2.1
>  Attachments: cachetest.jar, cachetest.zip, jboss-aop.xml, project.zip, 
> treeCacheAop-service.xml
>
>
> Stack overflow when calling TreeCacheAop.putObject(Fqn, Object) for an 
> aspectized object that contains a Collection class (tested with HashSet, 
> ArrayList and HashMap):
> Thread [http-0.0.0.0-7001-Processor25] (Suspended (exception 
> java.lang.StackOverflowError))
>       
> org.jboss.aop.deployment.JBossClassPool(javassist.ClassPool).toClass(javassist.CtClass)
>  line: 713
>         ...
>       org.jboss.aop.deployment.JBossClassPool.toClass(javassist.CtClass, 
> java.lang.ClassLoader) line: 50
>       
> org.jboss.aop.deployment.JBossClassPool(javassist.ClassPool).toClass(javassist.CtClass)
>  line: 713
>       org.jboss.aop.deployment.JBossClassPool.toClass(javassist.CtClass, 
> java.lang.ClassLoader) line: 50
>       
> org.jboss.aop.deployment.JBossClassPool(javassist.ClassPool).toClass(javassist.CtClass)
>  line: 713
>       org.jboss.aop.deployment.JBossClassPool.toClass(javassist.CtClass, 
> java.lang.ClassLoader) line: 50
>       javassist.CtNewClass(javassist.CtClass).toClass() line: 1000
>       org.jboss.aop.proxy.ClassProxyFactory.generateProxy(java.lang.Class) 
> line: 138
>       org.jboss.aop.proxy.ClassProxyFactory.newInstance(java.lang.Class) 
> line: 52
>       
> org.jboss.cache.aop.CollectionInterceptorUtil.getMethodMap(java.lang.Class) 
> line: 50
>       
> org.jboss.cache.aop.CachedSetInterceptor.<init>(org.jboss.cache.aop.TreeCacheAop,
>  org.jboss.cache.Fqn, java.lang.Class) line: 41
>       org.jboss.cache.aop.TreeCacheAop._putObject(org.jboss.cache.Fqn, 
> java.lang.Object) line: 372
>       org.jboss.cache.aop.TreeCacheAop._putObject(org.jboss.cache.Fqn, 
> java.lang.Object) line: 265
>       org.jboss.cache.aop.TreeCacheAop.putObject(org.jboss.cache.Fqn, 
> java.lang.Object) line: 130
> Originally this was happening within our application, but I've managed to 
> write a simple test bean that demonstrates the problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to