IllegalAccessException
nthx Aug 9, 2004 7:04 AMHi,
I think I have some configuration problem with j2sdk or sth similar, cause you say in earlier thread and in docs, that it's normal to advice private class members.
This is part of my class, and method I want to advice:
public class banking.aspects.persistance.PreparedStatements {.... private Connection getConnection(){ ... } ^^^^^ ...}
That's part of jboss-aop.xml:
<aspect class="banking.jbossaop.transactions.DbConnectionAspect" scope="PER_VM" /> <bind pointcut="call(* banking.aspects.persistance.DatabaseGateway->getConnection()) OR call(* banking.aspects.persistance.PreparedStatements->getConnection())"> <advice name="switchConnection" aspect="banking.jbossaop.transactions.DbConnectionAspect" /> </bind>
And error from ant looks...
run-static: internal:parametrisied-java: [java] ==DB==[main] Initializing database connection.. [java] ==DB==[main] Generating connection.. [java] ==DB==[main] Generating normal connection from DB.. [java] ==DB==[main] Connection: com.mysql.jdbc.Connection@adb1d4 generated successfully. [java] ==JB==[main] *PersistanceAspectCustomerManager->getNextId [java] java.lang.IllegalAccessException: Class org.jboss.aop.joinpoint.MethodCalledByMethodInvocation can not access a member of class banking.aspects.persistance.PreparedStatements with modifiers "private" [java] at sun.reflect.Reflection.ensureMemberAccess(Unknown Source) [java] at java.lang.reflect.Method.invoke(Unknown Source) [java] at org.jboss.aop.joinpoint.MethodCalledByMethodInvocation.invokeNext(MethodCalledByMethodInvocation.java:71) [java] at banking.jbossaop.transactions.DbConnectionAspect.switchConnection(Unknown Source) [java] at org.jboss.aop.advice.banking.jbossaop.transactions.DbConnectionAspect0.invoke(DbConnectionAspect0.java) [java] at org.jboss.aop.joinpoint.MethodCalledByMethodInvocation.invokeNext(MethodCalledByMethodInvocation.java:60) [java] at org.jboss.aop.ClassAdvisor.invokeCaller(ClassAdvisor.java:1453) .... cut
Any ideas about sth wrong here?
Thanks..
--
nthx