-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run Helloworld application locally for Java #950
Comments
Interesting that the TestNG plugin says that the yaml is executable. If you open the template, there are gutter icons next to the Lambda logical ID. Use that to execute instead of right clicking on the template file itself. |
Tried that, it gives me the same: SAM build failed |
Sorry, I got focused on the second half of your post. If you click the icon above the pin (with the > on it) in the build window, you should see more info. |
I see, this is what I get : Here is the complete trace :
Looks like samscli doesn't like the me have my intellij project on another drive |
The template needs to swap in the code-uri to a relative path on your machine, since your build-dir and template file are on different drives (e.g. I'm a little bit confused as to why the build-dir is being passed as |
I think it builds the command by using the user's 'TEMP' environment variable , as I changed it to a proxy one in D and now it seems to work, although I am getting some other error now:
Regardless, is there in way in the plugin where we can send the build dir explicitly , as doing it this way looks like a hack |
We should probably update the toolkit so that it builds in a temporary location inside the workspace rather than the system's temp directory. |
Unrelated , but if possible can someone point me to the right direction for the current error I am getting: Looks like the container in docker that is pulled by aws tool kit doesn't seem to have the maven dependencies for some reason |
What is in the folder " D:\Temp\lambdaBuild1\HelloWorldFunction"? |
It has:
|
@zhangzhx Why is this still tagged response requested? |
Out of curiosity, does it contain everything when you do |
Okay, so it is probably caused by the temp directory issues. We need to move the temp directory into the project. |
@abrooksv Finally found what was causing this , I was using dockertoolbox as oppose to docker for windows. After Following this thread for samcli : When I ran it using docker(not toolbox) it gave me an warning that firewall was blocking docker from sharing my D drive. So I fixed that using the instructions here : Now the question is does dockertoolbox fails silently for aws sam cli incase of a firewall blocking a drive or it doesn't work at all is yet to be answered .. |
For the record, the same bug also prevents the AWS Toolkit for PyCharm from working properly with projects on non-C: drives.
|
The fix has been released in the 1.5 eap. Can you try that out? If you still see this problem, feel free to open another issue. |
The issue still happens in IntelliJ. Same error! I have changed the Temp directory environmental variable to D: drive which didn't solve the issue.
|
Describe the bug
When ever I try to run the sample Hello world application for java I get an error saying SAM build command failed
To reproduce
Create new AWS serverless project
File>New>AWS>AWS serverless application:
Runtime: java8
SAM Template : AWS SAM Hello World(Maven)
Project SDK : 1.8(java version "1.8.0_144")
Go to App.java> Run application
Enter configs as:
(Also tried to specify the docker network connected to java image explixitlly)
Errors out saying : Sam build command failed
Expected behavior
Function to run locally
Screenshots
Also when I right on the template.yml file and run it gives me some other error ,
Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/TestNG
Your Environment
Additional context
The text was updated successfully, but these errors were encountered: