Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Newbie got a NullPointerException :)
Newbie got a NullPointerException :) [message #56704] Sat, 24 September 2005 18:51 Go to next message
Eclipse User
Originally posted by: Dominik.pich.info

Well, I'm quite new to AOP,aspectJ and AJDT, so I cannot really judge when
it is ME making a mistake or the computer(aspectj/ajdt)
Anyway, when compiled the code below with eclipse 3.1 using ajdt throws a
NullPointerException...

---

Eclipse AspectJ Development Tools

Version: 1.3.0
Build id: 20050921231918
AspectJ version: 1.5.0.20050919101948

---

package org.implemented.ed2kRelay.aspects;

import org.implemented.library.net.IDataPool;
import org.implemented.library.net.messaging.Message;

/**
* This class provides support for throwing exceptions when a call to a
data pool fails
* Only applicaple for pools typed <Message, Integer>
*/
public aspect Validate {
pointcut valid(IDataPool pool, Message value, Integer key):
call(public boolean IDataPool.validate(Message, Integer))
&& target(pool)
&& args(value, key);


after(IDataPool pool, Message value, Integer key) returning(boolean
validated): valid(pool,value,key) {
doConditionalThrow(value, (Message)pool.get(key), validated);
}

/*
* From here on, it's an ordinary class implementation.
*/

private void doConditionalThrow(Message value, Message keyed, boolean
b) {
//look at bool passed
}
}
Re: Newbie got a NullPointerException :) [message #56786 is a reply to message #56704] Mon, 26 September 2005 12:52 Go to previous messageGo to next message
Matt Chapman is currently offline Matt Chapman
Messages: 429
Registered: July 2009
Senior Member
Hi Dominik,

The syntax looks okay to me. Did the NullPointerException appear in a
dialog box when building the project? If so, it probably indicates a
compiler bug. Can you do "Show view > Error log" and see if you can
extract a stack trace for the exception?

Regards,

Matt.

Dominik Pich wrote:

> Well, I'm quite new to AOP,aspectJ and AJDT, so I cannot really judge when
> it is ME making a mistake or the computer(aspectj/ajdt)
> Anyway, when compiled the code below with eclipse 3.1 using ajdt throws a
> NullPointerException...

> ---

> Eclipse AspectJ Development Tools

> Version: 1.3.0
> Build id: 20050921231918
> AspectJ version: 1.5.0.20050919101948

> ---

> package org.implemented.ed2kRelay.aspects;

> import org.implemented.library.net.IDataPool;
> import org.implemented.library.net.messaging.Message;

> /**
> * This class provides support for throwing exceptions when a call to a
> data pool fails
> * Only applicaple for pools typed <Message, Integer>
> */
> public aspect Validate {
> pointcut valid(IDataPool pool, Message value, Integer key):
> call(public boolean IDataPool.validate(Message, Integer))
> && target(pool)
> && args(value, key);


> after(IDataPool pool, Message value, Integer key) returning(boolean
> validated): valid(pool,value,key) {
> doConditionalThrow(value, (Message)pool.get(key), validated);
> }

> /*
> * From here on, it's an ordinary class implementation.
> */

> private void doConditionalThrow(Message value, Message keyed, boolean
> b) {
> //look at bool passed
> }
> }
Re: Newbie got a NullPointerException :) [message #56840 is a reply to message #56786] Mon, 26 September 2005 15:06 Go to previous messageGo to next message
Eclipse User
Originally posted by: Dominik.pich.info

Thanks for helping :)

NullPointerException thrown: null

trace:
----
java.lang.NullPointerException
at
org.aspectj.weaver.ResolvedType.lookupResolvedMember(Resolve dType.java:350)
at
org.aspectj.weaver.ResolvedMemberImpl.accumulateMembersMatch ing(ResolvedMemberImpl.java:212)
at
org.aspectj.weaver.ResolvedMemberImpl.getJoinPointSignatures (ResolvedMemberImpl.java:166)
at
org.aspectj.weaver.MemberImpl.getJoinPointSignatures(MemberI mpl.java:917)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(Signatu rePattern.java:150)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(Kin dedPointcut.java:111)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:63)
at org.aspectj.weaver.Advice.match(Advice.java:101)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1727)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstructi on(BcelClassWeaver.java:1716)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1529)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInit(BcelClassW eaver.java:1393)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1322)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:381)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:96)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:141 5)
at
org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeav er.java:1380)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver .java:1157)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:100 1)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(A jCompilerAdapter.java:286)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCo mpiling(AjCompilerAdapter.java:165)
at
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after Returning$org_aspectj_ajdt_internal_compiler_CompilerAdapter $2$f9cc9ca0(CompilerAdapter.aj:70)
at
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compi le(Compiler.java:367)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.perfor mCompilation(AjBuildManager.java:728)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuil d(AjBuildManager.java:229)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.increm entalBuild(AjBuildManager.java:147)
at
org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAd apter.java:115)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread .run(AspectJBuildManager.java:191)
Re: Newbie got a NullPointerException :) [message #56918 is a reply to message #56840] Mon, 26 September 2005 17:51 Go to previous messageGo to next message
Matt Chapman is currently offline Matt Chapman
Messages: 429
Registered: July 2009
Senior Member
That's definitely a compiler bug. Please could you make sure it still
happens with the latest dev build of AJDT, then raise a bug:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ

Please attach a testcase, as I couldn't reproduce the problem with just
the code you gave, so maybe other classes are significant.

Regards,

Matt.

Dominik Pich wrote:

> Thanks for helping :)

> NullPointerException thrown: null

> trace:
> ----
> java.lang.NullPointerException
> at
> org.aspectj.weaver.ResolvedType.lookupResolvedMember(Resolve dType.java:350)
> at
>
org.aspectj.weaver.ResolvedMemberImpl.accumulateMembersMatch ing(ResolvedMemberImpl.java:212)
> at
>
org.aspectj.weaver.ResolvedMemberImpl.getJoinPointSignatures (ResolvedMemberImpl.java:166)
> at
> org.aspectj.weaver.MemberImpl.getJoinPointSignatures(MemberI mpl.java:917)
> at
>
org.aspectj.weaver.patterns.SignaturePattern.matches(Signatu rePattern.java:150)
> at
>
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(Kin dedPointcut.java:111)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at
> org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at
> org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at
> org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:63)
> at org.aspectj.weaver.Advice.match(Advice.java:101)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1727)
> at
>
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstructi on(BcelClassWeaver.java:1716)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1529)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.matchInit(BcelClassW eaver.java:1393)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1322)
> at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:381)
> at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:96)
> at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:141 5)
> at
> org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeav er.java:1380)
> at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver .java:1157)
> at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:100 1)
> at
>
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(A jCompilerAdapter.java:286)
> at
>
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCo mpiling(AjCompilerAdapter.java:165)
> at
>
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after Returning$org_aspectj_ajdt_internal_compiler_CompilerAdapter $2$f9cc9ca0(CompilerAdapter.aj:70)
> at
>
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compi le(Compiler.java:367)
> at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.perfor mCompilation(AjBuildManager.java:728)
> at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuil d(AjBuildManager.java:229)
> at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.increm entalBuild(AjBuildManager.java:147)
> at
> org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAd apter.java:115)
> at
>
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread .run(AspectJBuildManager.java:191)
Re: Newbie got a NullPointerException :) [message #57023 is a reply to message #56918] Tue, 27 September 2005 07:41 Go to previous message
Eclipse User
Originally posted by: Dominik.pich.info

Sure! Got an exam tomorrow but after that I definitly will file a report!
Thanks,
Dominik
Re: Newbie got a NullPointerException :) [message #590118 is a reply to message #56704] Mon, 26 September 2005 12:52 Go to previous message
Matt Chapman is currently offline Matt Chapman
Messages: 429
Registered: July 2009
Senior Member
Hi Dominik,

The syntax looks okay to me. Did the NullPointerException appear in a
dialog box when building the project? If so, it probably indicates a
compiler bug. Can you do "Show view > Error log" and see if you can
extract a stack trace for the exception?

Regards,

Matt.

Dominik Pich wrote:

> Well, I'm quite new to AOP,aspectJ and AJDT, so I cannot really judge when
> it is ME making a mistake or the computer(aspectj/ajdt)
> Anyway, when compiled the code below with eclipse 3.1 using ajdt throws a
> NullPointerException...

> ---

> Eclipse AspectJ Development Tools

> Version: 1.3.0
> Build id: 20050921231918
> AspectJ version: 1.5.0.20050919101948

> ---

> package org.implemented.ed2kRelay.aspects;

> import org.implemented.library.net.IDataPool;
> import org.implemented.library.net.messaging.Message;

> /**
> * This class provides support for throwing exceptions when a call to a
> data pool fails
> * Only applicaple for pools typed <Message, Integer>
> */
> public aspect Validate {
> pointcut valid(IDataPool pool, Message value, Integer key):
> call(public boolean IDataPool.validate(Message, Integer))
> && target(pool)
> && args(value, key);


> after(IDataPool pool, Message value, Integer key) returning(boolean
> validated): valid(pool,value,key) {
> doConditionalThrow(value, (Message)pool.get(key), validated);
> }

> /*
> * From here on, it's an ordinary class implementation.
> */

> private void doConditionalThrow(Message value, Message keyed, boolean
> b) {
> //look at bool passed
> }
> }
Re: Newbie got a NullPointerException :) [message #590147 is a reply to message #56786] Mon, 26 September 2005 15:06 Go to previous message
Eclipse User
Originally posted by: Dominik.pich.info

Thanks for helping :)

NullPointerException thrown: null

trace:
----
java.lang.NullPointerException
at
org.aspectj.weaver.ResolvedType.lookupResolvedMember(Resolve dType.java:350)
at
org.aspectj.weaver.ResolvedMemberImpl.accumulateMembersMatch ing(ResolvedMemberImpl.java:212)
at
org.aspectj.weaver.ResolvedMemberImpl.getJoinPointSignatures (ResolvedMemberImpl.java:166)
at
org.aspectj.weaver.MemberImpl.getJoinPointSignatures(MemberI mpl.java:917)
at
org.aspectj.weaver.patterns.SignaturePattern.matches(Signatu rePattern.java:150)
at
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(Kin dedPointcut.java:111)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at
org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:63)
at org.aspectj.weaver.Advice.match(Advice.java:101)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1727)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstructi on(BcelClassWeaver.java:1716)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1529)
at
org.aspectj.weaver.bcel.BcelClassWeaver.matchInit(BcelClassW eaver.java:1393)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1322)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:381)
at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:96)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:141 5)
at
org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeav er.java:1380)
at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver .java:1157)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:100 1)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(A jCompilerAdapter.java:286)
at
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCo mpiling(AjCompilerAdapter.java:165)
at
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after Returning$org_aspectj_ajdt_internal_compiler_CompilerAdapter $2$f9cc9ca0(CompilerAdapter.aj:70)
at
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compi le(Compiler.java:367)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.perfor mCompilation(AjBuildManager.java:728)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuil d(AjBuildManager.java:229)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.increm entalBuild(AjBuildManager.java:147)
at
org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAd apter.java:115)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread .run(AspectJBuildManager.java:191)
Re: Newbie got a NullPointerException :) [message #590166 is a reply to message #56840] Mon, 26 September 2005 17:51 Go to previous message
Matt Chapman is currently offline Matt Chapman
Messages: 429
Registered: July 2009
Senior Member
That's definitely a compiler bug. Please could you make sure it still
happens with the latest dev build of AJDT, then raise a bug:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ

Please attach a testcase, as I couldn't reproduce the problem with just
the code you gave, so maybe other classes are significant.

Regards,

Matt.

Dominik Pich wrote:

> Thanks for helping :)

> NullPointerException thrown: null

> trace:
> ----
> java.lang.NullPointerException
> at
> org.aspectj.weaver.ResolvedType.lookupResolvedMember(Resolve dType.java:350)
> at
>
org.aspectj.weaver.ResolvedMemberImpl.accumulateMembersMatch ing(ResolvedMemberImpl.java:212)
> at
>
org.aspectj.weaver.ResolvedMemberImpl.getJoinPointSignatures (ResolvedMemberImpl.java:166)
> at
> org.aspectj.weaver.MemberImpl.getJoinPointSignatures(MemberI mpl.java:917)
> at
>
org.aspectj.weaver.patterns.SignaturePattern.matches(Signatu rePattern.java:150)
> at
>
org.aspectj.weaver.patterns.KindedPointcut.matchInternal(Kin dedPointcut.java:111)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at
> org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at
> org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at
> org.aspectj.weaver.patterns.AndPointcut.matchInternal(AndPoi ntcut.java:61)
> at org.aspectj.weaver.patterns.Pointcut.match(Pointcut.java:151 )
> at org.aspectj.weaver.ShadowMunger.match(ShadowMunger.java:63)
> at org.aspectj.weaver.Advice.match(Advice.java:101)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1727)
> at
>
org.aspectj.weaver.bcel.BcelClassWeaver.matchInvokeInstructi on(BcelClassWeaver.java:1716)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1529)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.matchInit(BcelClassW eaver.java:1393)
> at
> org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeave r.java:1322)
> at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:381)
> at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeave r.java:96)
> at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:141 5)
> at
> org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeav er.java:1380)
> at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver .java:1157)
> at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:100 1)
> at
>
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(A jCompilerAdapter.java:286)
> at
>
org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCo mpiling(AjCompilerAdapter.java:165)
> at
>
org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$after Returning$org_aspectj_ajdt_internal_compiler_CompilerAdapter $2$f9cc9ca0(CompilerAdapter.aj:70)
> at
>
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compi le(Compiler.java:367)
> at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.perfor mCompilation(AjBuildManager.java:728)
> at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuil d(AjBuildManager.java:229)
> at
>
org.aspectj.ajdt.internal.core.builder.AjBuildManager.increm entalBuild(AjBuildManager.java:147)
> at
> org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAd apter.java:115)
> at
>
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread .run(AspectJBuildManager.java:191)
Re: Newbie got a NullPointerException :) [message #590206 is a reply to message #56918] Tue, 27 September 2005 07:41 Go to previous message
Eclipse User
Originally posted by: Dominik.pich.info

Sure! Got an exam tomorrow but after that I definitly will file a report!
Thanks,
Dominik
Previous Topic:Reweaving Jar library
Next Topic:strange bug with .aj files in jar-packager
Goto Forum:
  


Current Time: Thu Jul 31 15:46:55 EDT 2014

Powered by FUDForum. Page generated in 0.02008 seconds