Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Create a new Aspect wizard giving error in AJDT.(Create a new Aspect wizard giving a null pointer exception)
Create a new Aspect wizard giving error in AJDT. [message #657499] Thu, 03 March 2011 02:13 Go to next message
Girish  is currently offline Girish
Messages: 3
Registered: March 2011
Junior Member
Hi,
I have installed AJDT plugin(2.1.1) on eclipse 3.6. I'm trying to apply the AspectJ functionality on my existing code. ADJT is installed correctly and working perfectly. It is able to understand all the existing Aspects etc. Excellient !!
But, when I try to create a new aspect , it is giving an error message asking to view the log. In the log, following is the error.... . Did anyone get this error, is this a bug ? Please suggest. Cannot find any help on the web.

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java: 1008)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.perform Finish(NewElementWizard.java:133)
at org.eclipse.ajdt.internal.ui.wizards.NewAspectCreationWizard .performFinish(NewAspectCreationWizard.java:60)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:811)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:430)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHa ndler(WizardHandler.java:254)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:274)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 38)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.NullPointerException
at org.eclipse.ajdt.internal.ui.wizards.AJNewTypeWizardPage.ajc $interMethod$org_eclipse_ajdt_internal_ui_wizards_AJNewTypeW izardPage$org_eclipse_ajdt_internal_ui_wizards_NewTypeWizard Page$createAJType(AJNewTypeWizardPage.aj:268)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.ajc$i nterMethodDispatch2$org_eclipse_ajdt_internal_ui_wizards_AJN ewTypeWizardPage$createAJType(NewTypeWizardPage.java:1)
at org.eclipse.ajdt.internal.ui.wizards.AJNewTypeWizardPage.ajc $interMethodDispatch1$org_eclipse_ajdt_internal_ui_wizards_A JNewTypeWizardPage$org_eclipse_ajdt_internal_ui_wizards_NewT ypeWizardPage$createAJType(AJNewTypeWizardPage.aj)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.creat eType_aroundBody7$advice(NewTypeWizardPage.java:450)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.creat eType(NewTypeWizardPage.java:1)
at org.eclipse.ajdt.internal.ui.wizards.NewAspectCreationWizard .finishPage(NewAspectCreationWizard.java:75)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(N ewElementWizard.java:117)
at org.eclipse.jdt.internal.core.BatchOperation.executeOperatio n(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1975)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4777)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter .run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
Root exception:
java.lang.NullPointerException
at org.eclipse.ajdt.internal.ui.wizards.AJNewTypeWizardPage.ajc $interMethod$org_eclipse_ajdt_internal_ui_wizards_AJNewTypeW izardPage$org_eclipse_ajdt_internal_ui_wizards_NewTypeWizard Page$createAJType(AJNewTypeWizardPage.aj:268)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.ajc$i nterMethodDispatch2$org_eclipse_ajdt_internal_ui_wizards_AJN ewTypeWizardPage$createAJType(NewTypeWizardPage.java:1)
at org.eclipse.ajdt.internal.ui.wizards.AJNewTypeWizardPage.ajc $interMethodDispatch1$org_eclipse_ajdt_internal_ui_wizards_A JNewTypeWizardPage$org_eclipse_ajdt_internal_ui_wizards_NewT ypeWizardPage$createAJType(AJNewTypeWizardPage.aj)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.creat eType_aroundBody7$advice(NewTypeWizardPage.java:450)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.creat eType(NewTypeWizardPage.java:1)
at org.eclipse.ajdt.internal.ui.wizards.NewAspectCreationWizard .finishPage(NewAspectCreationWizard.java:75)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(N ewElementWizard.java:117)
at org.eclipse.jdt.internal.core.BatchOperation.executeOperatio n(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1975)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4777)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter .run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
Re: Create a new Aspect wizard giving error in AJDT. [message #657508 is a reply to message #657499] Thu, 03 March 2011 04:33 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 368
Registered: July 2009
Senior Member
Are you running with jDT weaving enabled? Check Preferences -> JDT Weaving.
Re: Create a new Aspect wizard giving error in AJDT. [message #657732 is a reply to message #657508] Thu, 03 March 2011 18:14 Go to previous messageGo to next message
Girish  is currently offline Girish
Messages: 3
Registered: March 2011
Junior Member
Thanks Andrew , but the JDT weaving is already enabled.
Just to give more details, after the error message (asking to see the logs) , an *.aj file is created but doesn't have any template code in it and even if I manually try to write it , outline view and other views are not getting updated.
Please help !
Re: Create a new Aspect wizard giving error in AJDT. [message #657770 is a reply to message #657732] Thu, 03 March 2011 23:19 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 368
Registered: July 2009
Senior Member
There may be a bug in there somewhere.

Can you attach a simple project where this is failing for you?

As a workaround, you can create a Java class, right click -> AspectJ Tools -> Convert File extension to .aj.

Then change 'class' to 'aspect'.
Re: Create a new Aspect wizard giving error in AJDT. [message #754643 is a reply to message #657770] Thu, 03 November 2011 17:44 Go to previous messageGo to next message
Phani  is currently offline Phani
Messages: 1
Registered: November 2011
Junior Member
Hello Girish,

I just started working on AspectJ. I too face the same problem

Did you get any work around other than creating a class and making it aspect ?


My IDE:

Version: Indigo Release
Build id: 20110615-0604

AspectJ: download.eclipse.org/tools/ajdt/37/update

Any pointer in this regard would be highly helpful


Thanks,
Phani
Re: Create a new Aspect wizard giving error in AJDT. [message #754659 is a reply to message #754643] Thu, 03 November 2011 19:09 Go to previous messageGo to next message
Girish  is currently offline Girish
Messages: 3
Registered: March 2011
Junior Member
ya .. I didn't get a chance to get back to Andrew on this, but I remember the workaround he mentioned works . Here is what he mentioned.

As a workaround, you can create a Java class, right click -> AspectJ Tools -> Convert File extension to .aj.

Then change 'class' to 'aspect'.
Re: Create a new Aspect wizard giving error in AJDT. [message #1243673 is a reply to message #657499] Tue, 11 February 2014 09:36 Go to previous messageGo to next message
Johannes Schad is currently offline Johannes Schad
Messages: 1
Registered: February 2014
Junior Member
I get the same error message but only after converting an existing project (Eclipse RCP) into an AspectJ project. Same problem described by someone else on stackoverflow SO/questions/18175138/create-an-aspect-with-ajdt-in-former-java-project. Is there a solution to this?

eclipse.buildId=4.3.0.M20130911-1000
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.dsl.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.dsl.product

Error
Tue Feb 11 10:23:46 CET 2014
Internal Error

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1028)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:134)
at org.eclipse.ajdt.internal.ui.wizards.NewAspectCreationWizard.performFinish(NewAspectCreationWizard.java:60)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:628)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)
at org.eclipse.jface.window.Window.open(Window.java:802)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:259)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:279)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:243)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:224)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:167)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:420)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.NullPointerException
at org.eclipse.ajdt.internal.ui.wizards.AJNewTypeWizardPage.ajc$interMethod$org_eclipse_ajdt_internal_ui_wizards_AJNewTypeWizardPage$org_eclipse_ajdt_internal_ui_wizards_NewTypeWizardPage$createAJType(AJNewTypeWizardPage.aj:267)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.ajc$interMethodDispatch2$org_eclipse_ajdt_internal_ui_wizards_AJNewTypeWizardPage$createAJType(NewTypeWizardPage.java:1)
at org.eclipse.ajdt.internal.ui.wizards.AJNewTypeWizardPage.ajc$interMethodDispatch1$org_eclipse_ajdt_internal_ui_wizards_AJNewTypeWizardPage$org_eclipse_ajdt_internal_ui_wizards_NewTypeWizardPage$createAJType(AJNewTypeWizardPage.aj)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.createType_aroundBody7$advice(NewTypeWizardPage.java:444)
at org.eclipse.ajdt.internal.ui.wizards.NewTypeWizardPage.createType(NewTypeWizardPage.java:1)
at org.eclipse.ajdt.internal.ui.wizards.NewAspectCreationWizard.finishPage(NewAspectCreationWizard.java:75)
at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:118)
at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5331)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

Re: Create a new Aspect wizard giving error in AJDT. [message #1243972 is a reply to message #1243673] Tue, 11 February 2014 18:21 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 368
Registered: July 2009
Senior Member
Best thing to do is to raise a bugzilla issue for this (http://bugs.eclipse.org). Someone working on the project can help triage this.

As a workaround, create a Java class and then convert to an Aspect.
Previous Topic:Aspectj and ClasCastException
Next Topic:Problem with AspectJ fast-matching
Goto Forum:
  


Current Time: Mon Sep 22 16:35:18 GMT 2014

Powered by FUDForum. Page generated in 0.02592 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software