[jboss-user] [JBoss AOP] - no such field: jboss
s_singh
do-not-reply at jboss.com
Wed Apr 25 05:25:43 EDT 2007
We've been using jboss-aop for past 6 months or so without any issues, except for one weird problem that crops up now and then.
Whenever a class to be aspectized contains a variable whose name is "org" (without quotes), then the aspectization fails with the error stack pasted below. Pls See sample code.
Mostly, when the source code is in my control i can change the variable name to "org1" or something and proceed, but sometimes changing the variable name can be quite a cumbersome process if source is not owned.
Is this some known issue ? I searched the forum and googled but didnt find anything.
We use load time weaving.
AOP version 1.5.3 GA
Jboss - 4.0.2
JRockit - jrockit-R26.4.0-jdk1.5.0_06
Steps to reproduce : include following package in jboss-service.xml of jboss-aop-jdk50.deployer, and invoke m1 from a JSP or some place.
package com.integral.admin;
public class Test
{
private static String org="Fail";
public void m1()
{
System.out.println("Dummy");
}
}
If variable name is changed from org to org1 it starts working. Weirdly enough, changing the package also fixes the problem. So, it looks to be combination of package name and variable name being org.
---- Error ---
[error] [source error] no such field: jboss.. Do verbose mode if you want full s
tack trace.
[JRockit] WARNING: Error during class preprocessing:
java.lang.RuntimeException: javassist.CannotCompileException: [source error] no
such field: jboss
at org.jboss.aop.deployment.AspectManagerService$1.transform(AspectManag
erService.java:212)
at org.jboss.aop.hook.JDK14TransformerManager.transform(JDK14Transformer
Manager.java:28)
at org.jboss.aop.hook.JRockitPluggableClassPreProcessor.preProcess(JRock
itPluggableClassPreProcessor.java:18)
at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.securit
y.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(Repositor
yClassLoader.java:633)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassL
oader.java:613)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;
(Unknown Source)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(Repositor
yClassLoader.java:162)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask
.java:119)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:385)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
assLoader.java:481)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
oader.java:377)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;
(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;
(Unknown Source)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(
Unknown Source)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:15
0)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71
)
at java.lang.ClassLoader.loadClassFromNative(Ljava.lang.String;)Ljava.la
ng.Class;(Unknown Source)
Caused by: javassist.CannotCompileException: [source error] no such field: jboss
at javassist.CtField$CodeInitializer0.compileIfStatic(CtField.java:757)
at javassist.CtClassType.modifyClassConstructor(CtClassType.java:1237)
at javassist.CtClassType.toBytecode(CtClassType.java:1181)
at javassist.CtClass.toBytecode(CtClass.java:1110)
at org.jboss.aop.AspectManager.translate(AspectManager.java:796)
at org.jboss.aop.deployment.AspectManagerService$1.transform(AspectManag
erService.java:208)
at org.jboss.aop.hook.JDK14TransformerManager.transform(JDK14Transformer
Manager.java:28)
at org.jboss.aop.hook.JRockitPluggableClassPreProcessor.preProcess(JRock
itPluggableClassPreProcessor.java:18)
at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.securit
y.ProtectionDomain;)Ljava.lang.Class;(Unknown Source)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(Repositor
yClassLoader.java:633)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassL
oader.java:613)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;
(Unknown Source)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(Repositor
yClassLoader.java:162)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask
.java:119)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:385)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
assLoader.java:481)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
oader.java:377)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;
(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:580)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;Z)Ljava.lang.Class;
(Unknown Source)
at java.lang.ClassLoader.loadClass(Ljava.lang.String;)Ljava.lang.Class;(
Unknown Source)
at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:15
0)
Caused by: compile error: no such field: jboss
at javassist.compiler.MemberResolver.lookupField(MemberResolver.java:302
)
at javassist.compiler.MemberResolver.lookupFieldByJvmName(MemberResolver
.java:288)
at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:778)
at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:719)
at javassist.compiler.TypeChecker.atExpr(TypeChecker.java:521)
at javassist.compiler.ast.Expr.accept(Expr.java:67)
at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:776)
at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:719)
at javassist.compiler.TypeChecker.atExpr(TypeChecker.java:521)
at javassist.compiler.ast.Expr.accept(Expr.java:67)
at javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:776)
at javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:719)
at javassist.compiler.TypeChecker.atExpr(TypeChecker.java:521)
at javassist.compiler.ast.Expr.accept(Expr.java:67)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:603)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:15
6)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:603)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:15
6)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:45)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:235)
at javassist.compiler.CodeGen.compileExpr(CodeGen.java:222)
at javassist.compiler.Javac.compileExpr(Javac.java:597)
at javassist.compiler.Javac.compileExpr(Javac.java:573)
at javassist.CtField$CodeInitializer.compileExpr(CtField.java:796)
at javassist.CtField$CodeInitializer0.compileIfStatic(CtField.java:752)
at javassist.CtClassType.modifyClassConstructor(CtClassType.java:1237)
at javassist.CtClassType.toBytecode(CtClassType.java:1181)
at javassist.CtClass.toBytecode(CtClass.java:1110)
at org.jboss.aop.AspectManager.translate(AspectManager.java:796)
at org.jboss.aop.deployment.AspectManagerService$1.transform(AspectManag
erService.java:208)
at org.jboss.aop.hook.JDK14TransformerManager.transform(JDK14Transformer
Manager.java:28)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040489#4040489
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040489
More information about the jboss-user
mailing list