Skip to content

docs: Adding Kotlin example. #1454

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

Merged
merged 43 commits into from
Oct 23, 2023
Merged

Conversation

jasoniharris
Copy link
Contributor

@jasoniharris jasoniharris commented Oct 3, 2023

Issue #, if available:

Description of changes:

Adding an example for Kotlin with Gradle- [email protected]

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jasoniharris jasoniharris changed the title Adding Kotlin example. docs: Adding Kotlin example. Oct 3, 2023
@jasoniharris jasoniharris marked this pull request as ready for review October 3, 2023 15:57
Copy link
Contributor

@scottgerring scottgerring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jasoniharris thanks for the contribution!

Apropos build - I think something funny is going on in actions. I will re-run tomorrow and see if it self-resolves, else we can dive deeper. Doesn't seem to be related to your change.

@scottgerring
Copy link
Contributor

scottgerring commented Oct 3, 2023

Deploying with SAM:

./gradlew build
sam deploy --guided

I end up with:

curl https://ggb2st3t75.execute-api.eu-central-1.amazonaws.com/Prod/hello/ 
{"message": "Internal server error"}

and a stacktrace in the logs:

2023/10/03/[$LATEST]b0a62771de7d455ebe580d40e170ffb1 2023-10-03T16:39:15.982000 Class not found: helloworld.App: java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: helloworld.App
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)

Have I missed something?

@AlexeySoshin
Copy link
Contributor

Deploying with SAM:

./gradlew build
sam deploy --guided

I end up with:

curl https://ggb2st3t75.execute-api.eu-central-1.amazonaws.com/Prod/hello/ 
{"message": "Internal server error"}

and a stacktrace in the logs:

2023/10/03/[$LATEST]b0a62771de7d455ebe580d40e170ffb1 2023-10-03T16:39:15.982000 Class not found: helloworld.App: java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: helloworld.App
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)

Have I missed something?

I think we need to update the instructions. The correct way with SAM should be sam build && sam deploy --guided

Copy link
Contributor

@scottgerring scottgerring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for me. The E2E tests fail because of the security config, not an issue with the PR. @jeromevdl do you want to have a skim before we merge to make sure i've not missed anything funny given recent repo structure issues?

Copy link
Contributor

@jeromevdl jeromevdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few minor things and we're good

pom.xml Outdated
@@ -55,7 +55,7 @@
<module>powertools-large-messages</module>
<module>powertools-e2e-tests</module>
<module>powertools-batch</module>
<module>examples</module>
<!-- <module>examples</module>-->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed

Suggested change
<!-- <module>examples</module>-->

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@scottgerring scottgerring merged commit aed398b into aws-powertools:main Oct 23, 2023
@scottgerring
Copy link
Contributor

Thanks @jasoniharris and @AlexeySoshin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants