Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Nullpointer Exception in hte Joinpoint

There is no this or target when referring to a static method.
For more information, see the table at the end of "Join Points" 
in the programming guide semantics appendix.

Wes


> ------------Original Message------------
> From: "Shankaranarayanan G" <shankarg@xxxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Fri, Mar-25-2005 2:26 AM
> Subject: [aspectj-users] Nullpointer Exception in hte Joinpoint
>
> Hi All,
> 
> Am using the following version of AspectJ
> 
> AspectJ Compiler 1.2.1 built on Friday Nov 5, 2004 at 12:30:41 GMT
> 
> Am using AOP to log/profile all the method calls. Pls find the code 
> snippet of the aspect used for profiling below.
> 
>     before():LoggableCalls()
>     {
>         MethodSignature loMethodSignature = 
> (MethodSignature)thisJoinPointStaticPart.getSignature();
>         System.out.println("ØØØØØØØØØØ JoinPoint >>>" + thisJoinPoint);
>         System.out.println("ØØØØØØØØØØ JoinPoint.getThis >>>" + 
> thisJoinPoint.getThis());
>         String lsClassName = 
> thisJoinPoint.getThis().getClass().getName();
>     }
> 
>     after():LoggableCalls()
>     {
>         MethodSignature loMethodSignature = 
> (MethodSignature)thisJoinPointStaticPart.getSignature();
>         System.out.println("ØØØØØØØØØØ JoinPoint >>>" + thisJoinPoint);
>         System.out.println("ØØØØØØØØØØ JoinPoint.getThis >>>" + 
> thisJoinPoint.getThis());
>         String lsClassName = 
> thisJoinPoint.getThis().getClass().getName();
>    }
> 
> I get the following error message while running my project.
> 
> <Mar 25, 2005 3:30:42 PM IST> <Debug> <PartnerDAO> <000000> <poObject 
> is ExternalPartnerSearchCriteriaVO()>
> ??? JoinPoint >>>execution(String 
> de.dl.ucs.partner.helperclasses.PartnerQueryBuilder.getTotalCountQuery(ExternalPartnerSearchCriteriaVO))
> ??? JoinPoint.getThis >>>null
> ??? JoinPoint >>>execution(String 
> de.dl.ucs.partner.helperclasses.PartnerQueryBuilder.getTotalCountQuery(ExternalPartnerSearchCriteriaVO))
> ??? JoinPoint.getThis >>>null
> <Mar 25, 2005 3:30:42 PM IST> <Info> <EJB> <010051> <EJB Exception 
> during invocation from home: 
> de.dl.ucs.partner.controller.PartnerSL_3g1d6p_HomeImpl@20809b threw exception: java.lang.NullPointerException
> java.lang.NullPointerException
>         at 
> ucsmodeler.Profiler.ajc$after$ucsmodeler_Profiler$2$a6e5fd39(Profiler.java:93)
>         at 
> de.dl.ucs.partner.helperclasses.PartnerQueryBuilder.getTotalCountQuery(PartnerQueryBuilder.java:366)
>         at 
> de.dl.ucs.partner.dao.PartnerDAO.getTotalCount(PartnerDAO.java:198)
>         at 
> de.dl.ucs.framework.utils.LBISQuery.getSubSet(LBISQuery.java:26)
>         at 
> de.dl.ucs.partner.controller.PartnerSL.searchExternalPartners(PartnerSL.java:1297)
> 
> If you look at the stack trace. It is able to print the JoinPoint. But 
> when i try to print JointPoint.getThis() or getTarget(). I get a null. 
> Why does this happen. Is it a bug or is it an error in my code.
> 
> 
> Thanks in advance
> Shankar
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 



Back to the top