AEM Eclipse Plugin - create Project | Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" | Community
Skip to main content
Clodo
Adobe Employee
Adobe Employee
October 17, 2021
Solved

AEM Eclipse Plugin - create Project | Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()"

  • October 17, 2021
  • 4 replies
  • 5125 views

Hello Team

 

Trying follow the https://experienceleague.adobe.com/docs/experience-manager-65/developing/devtools/aem-eclipse.html?lang=en# (AEM Developer Tools for Eclipse)

 

And when try to create a new project type AEM Sample Multi Module Project, on the second step when I try to pick the archetype, my Eclipse throws below error

 

Any idea ? 

 

 

 

eclipse.buildId=4.21.0.I20210906-0500
java.version=16.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CL
Framework arguments: -product org.eclipse.epp.package.jee.product -keyring /Users/clodoaldopaiva/.eclipse_keyring
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring /Users/clodoaldopaiva/.eclipse_keyring

org.eclipse.ui
Error
Sun Oct 17 19:33:11 CLST 2021
Unhandled event loop exception

java.lang.RuntimeException: Could not process archetype: Cannot invoke "java.util.List.iterator()" because the return value of "org.eclipse.m2e.core.internal.archetype.ArchetypeManager.getRequiredProperties(org.apache.maven.archetype.catalog.Archetype, org.apache.maven.artifact.repository.ArtifactRepository, org.eclipse.core.runtime.IProgressMonitor)" is null
at com.adobe.granite.ide.eclipse.ui.wizards.np.AdvancedSettingsComponent.initialize(AdvancedSettingsComponent.java:276)
at com.adobe.granite.ide.eclipse.ui.wizards.np.SimplerParametersWizardPage.setVisible(SimplerParametersWizardPage.java:160)
at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1252)
at org.eclipse.jface.wizard.WizardDialog.lambda$3(WizardDialog.java:1222)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1222)
at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:917)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:468)
at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
at org.eclipse.jface.window.Window.open(Window.java:799)
at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:119)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "org.eclipse.m2e.core.internal.archetype.ArchetypeManager.getRequiredProperties(org.apache.maven.archetype.catalog.Archetype, org.apache.maven.artifact.repository.ArtifactRepository, org.eclipse.core.runtime.IProgressMonitor)" is null
at com.adobe.granite.ide.eclipse.ui.wizards.np.AdvancedSettingsComponent.initialize(AdvancedSettingsComponent.java:270)
... 53 more

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ankur_Khare

Hello Ankur

 

getting the error on my terminal, I did the following steps

 

1 # on a empty folder, as admin

git clone https://github.com/adobe/aem-project-archetype.git

 

2 # from instructions on the source ran:

Source (ExperienceLeague-sourceDoc ) and (git-aem-project-archetype )

mvn -B archetype:generate  -D archetypeGroupId=com.adobe.aem  -D archetypeArtifactId=aem-project-archetype  -D archetypeVersion=30  -D appTitle="My Site"  -D appId="mysite"  -D groupId="com.mysite"

 

 


Try these steps-

 

1 # on a empty folder, as admin

run below and see-

mvn -B archetype:generate  -D archetypeGroupId=com.adobe.aem  -D archetypeArtifactId=aem-project-archetype  -D archetypeVersion=30  -D appTitle="My Site"  -D appId="mysite"  -D groupId="com.mysite"

4 replies

Sanjay_Bangar
Community Advisor
Community Advisor
October 18, 2021

Hi @clodo ,

Can you  try to create the project using command line and then import into Eclipse as a Maven project because most of time In Eclipse AEM developer tools throws error.

 

Regards,

Sanjay

 

 

 

 

Clodo
Adobe Employee
ClodoAdobe EmployeeAuthor
Adobe Employee
October 18, 2021

sure me try this one

 

Thanks Sanjay

Asutosh_Jena_
Community Advisor
Community Advisor
October 18, 2021

Hi @clodo 

 

I see you are using Oracle JDK version 16 which is not supported on any of the version of AEM.

 

java.version=16.0.2
java.vendor=Oracle Corporation

 

Please downgrade Java version to either Oracle JDK 11 or 1.8 and try. It will defintely resolve the issue.

 

Also Effective May 30th, 2021, AEM customers can develop and operate their AEM
applications with distributions of the Azul Zulu builds of OpenJDK, standards compliant with Java SE.

 

Support for the Azul Zulu JDKs is also provided by Adobe to the AEM customers. The relevant versions of the Azul Zulu JDKs can be downloaded from the Adobe Software Distribution web site.
The usage rights for the Oracle Java technology as distributed by Adobe will expire by the end of December 2022. 

 

https://experienceleague.adobe.com/docs/experience-manager-65/assets/adobe-azul-openjdk-license-agreement.pdf?lang=en

 

Download Azul:

https://www.azul.com/downloads/

 

 

Thanks!

Clodo
Adobe Employee
ClodoAdobe EmployeeAuthor
Adobe Employee
October 18, 2021

Hello Asutosh

 

thanks, let me do 11 or 1.8

Anny0505
Community Advisor
Community Advisor
October 18, 2021

@clodo,

 

Please use jdk 11 or jdk 1.8 to resolve your build issue.

 

please check the below documentation for the pre-requisites to set up local aem instance.

 

https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/set-up-a-local-aem-development-environment.html?lang=en

 

 

Clodo
Adobe Employee
ClodoAdobe EmployeeAuthor
Adobe Employee
October 18, 2021

thanks Aruna

 

let me try right version then

Ankur_Khare
Community Advisor
Community Advisor
October 18, 2021

Hi,

 

Try using java 11 and then try these steps.

 

Regards

Ankur

Clodo
Adobe Employee
ClodoAdobe EmployeeAuthor
Adobe Employee
October 20, 2021

Team thanks for the tips,  java compatibility is fixed.

 

Now any idea about this one?

 

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate (default-cli) on project aem-project-archetype: Unable to add module to the current project as it is not of packaging type 'pom'

 

 

Caused by: org.apache.maven.plugin.MojoFailureException: Unable to add module to the current project as it is not of packaging type 'pom'

 

 

When run via command line the following

 

path/aem-project-archetype>$ mvn -X -B archetype:generate  -D archetypeGroupId=com.adobe.aem  -D archetypeArtifactId=aem-project-archetype  -D archetypeVersion=30  -D appTitle="My Site"  -D appId="mysite"  -D groupId="com.mysite"

 

 Thanks in advance

Ankur_Khare
Community Advisor
Community Advisor
October 20, 2021

When are u getting this error ? as i tried using above command and got it generated successfully-