Expand my Community achievements bar.

SOLVED

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

Avatar

Level 3

Hello Team

 

Trying follow the https://experienceleague.adobe.com/docs/experience-manager-65/developing/devtools/aem-eclipse.html?l...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

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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"

View solution in original post

12 Replies

Avatar

Community Advisor

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

 

 

 

 

Avatar

Community Advisor

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-agre...

 

Download Azul:

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

 

 

Thanks!

Avatar

Community Advisor

@_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-loc...

 

 

Avatar

Community Advisor

Hi,

 

Try using java 11 and then try these steps.

 

Regards

Ankur

Avatar

Level 3

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

Avatar

Community Advisor

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

 

Ankur_Khare_0-1634701368112.png

 

Avatar

Level 3

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"

 

 

Avatar

Correct answer by
Community Advisor

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"

Avatar

Level 3

Hello Ankur

 

yes you spotted on, thank you so much for that

 

The error was folder had the archetype locally downloaded.

 

My mistake

 

Really appreciate the hits shared