Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

New AWS Serverless Project wizard fails when SDK has not yet been installed #95

Closed
NetForce1 opened this issue Dec 29, 2017 · 3 comments

Comments

@NetForce1
Copy link

The wizard 'New AWS Serverless Project' only works after a AWS Java Project has been created. The cause seems to be a missing SDK.

Error from Eclipse Error Log:

FreeMarker template error:
The following has evaluated to null or missing:
==> awsJavaSdkVersion  [in template "serverless/article/pom.xml.ftl" at line 44, column 20]

----
Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${awsJavaSdkVersion}  [in template "serverless/article/pom.xml.ftl" at line 44, column 18]
----

Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:108)
	at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:346)
	at freemarker.core.Expression.evalAndCoerceToString(Expression.java:80)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:40)
	at freemarker.core.Environment.visit(Environment.java:257)
	at freemarker.core.MixedContent.accept(MixedContent.java:57)
	at freemarker.core.Environment.visit(Environment.java:257)
	at freemarker.core.Environment.process(Environment.java:235)
	at freemarker.template.Template.process(Template.java:262)
	at com.amazonaws.eclipse.lambda.project.template.CodeTemplateManager.processTemplateWithData(CodeTemplateManager.java:89)
	at com.amazonaws.eclipse.lambda.project.wizard.util.FunctionProjectUtil.emitServerlessPom(FunctionProjectUtil.java:222)
	at com.amazonaws.eclipse.lambda.project.wizard.util.FunctionProjectUtil.createServerlessBlueprintProject(FunctionProjectUtil.java:94)
	at com.amazonaws.eclipse.lambda.project.wizard.NewServerlessProjectWizard.doFinish(NewServerlessProjectWizard.java:107)
	at com.amazonaws.eclipse.core.plugin.AbstractAwsProjectWizard$1$1.execute(AbstractAwsProjectWizard.java:63)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:107)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128)
	at com.amazonaws.eclipse.core.plugin.AbstractAwsProjectWizard$1.run(AbstractAwsProjectWizard.java:70)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

@zhangzhx
Copy link
Contributor

Thanks for reporting this to us. From the error message, it seems Eclipse cannot get a valid Java SDK version which failed the freemarker to replace the awsJavaSdkVersion variable.

I will submit a fix to this to ensure a non-null value for the awsJavaSdkVersion. I will let you know once it's released.

@NetForce1
Copy link
Author

+1

Maybe it helps to know that the wizard works after an AWS Java Project is created. Running that wizard causes the SDK to be downloaded.

@zhangzhx
Copy link
Contributor

zhangzhx commented Jan 5, 2018

This fix has been included in the release. In this fix, the SDK version will fall back to a default value if it cannot be acquired from Maven Central. Let me know if you have more questions.

@zhangzhx zhangzhx closed this as completed Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants