Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] StackOverflowError

Your cflow includes the advice advising the join points
(and the advice does nothing, runs even when exceptions thrown?)

 pointcut nestedCall(): cflow(printing());
 after(): nestedCall(){};

http://dev.eclipse.org/viewcvs/indextech.cgi/%7Echeckout%7E/aspectj-home/doc/faq.html#q:infiniterecursion

Wes

> ------------Original Message------------
> From: Valerio Schiavoni <ervalerio@xxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Mon, Mar-7-2005 10:06 AM
> Subject: [aspectj-users] StackOverflowError
>
> i'm getting this error:
> 
> Exception in thread "main" java.lang.StackOverflowError
>         at 
> java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:225)
>         at java.lang.ThreadLocal.get(ThreadLocal.java:127)
>         at 
> org.aspectj.runtime.internal.cflowstack.ThreadStackFactoryImpl$ThreadCounterImpl.getThreadCounter(ThreadStackFactoryImpl.java:38)
>         at 
> org.aspectj.runtime.internal.cflowstack.ThreadStackFactoryImpl$ThreadCounterImpl.isNotZero(ThreadStackFactoryImpl.java:43)
>         at 
> org.aspectj.runtime.internal.CFlowCounter.isValid(CFlowCounter.java:45)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         at 
> TrackHelloWorld.ajc$after$TrackHelloWorld$3$1633d7b6(TrackHelloWorld.aj:20)
>         %------CUT MORE LINES LIKE THE ABOVE ONES-----%
> 
> 
> this is the TrackHelloWorld aspect:
> 
> public aspect TrackHelloWorld {
> 
>         pointcut printing(): execution(* ServerImpl.print(..));
> 
>         pointcut doNothing(): execution(* ServerImpl.doNothing());
> 
>         pointcut nestedCall(): cflow(printing());
> 
>         before(): printing() {
>                 //System.out.println("Before printing...");
>         }
>         after(): printing() {
>                 //System.out.println("After printing...");
>         }
> 
>         after(): nestedCall(){};
> 
> }
> 
> and this is the ServerImpl :
> 
> public class ServerImpl implements Service, ServiceAttributes {
> 
>         private String header = "";
> 
>         private int count = 0;
> 
> 
>         public void print (final String msg) {
> 
>                 doNothing();
> 
>                 return;
>         }
> 
> 
>         public String getHeader () {
>                 return header;
>         }
> 
>         public void setHeader (final String header) {
>                 this.header = header;
>         }
> 
>         public int getCount () {
>                 return count;
>         }
> 
>         public void setCount (final int count) {
>                 this.count = count;
>         }
> 
> 
>         public void doNothing() {
> 
>                 return;
> 
>         }
> }
> 
> 
> what I do is to call the print() method thousands of times (say 100K, 
> but i have to get even higher) to see
> processing time.
> i defined the cflow pointcut to be able to capture the calls to 
> doNothing() when occuring from inside the print(String s) method.
> 
> I get the error even if I call the method only 1 or 10 (or less then 
> thousands) times.
> 
> thanks for any help
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 



Back to the top