Back

[Solved] Build Failure On Java Starter Function Deployment

  • 0
  • Functions
palani
6 Oct, 2023, 05:31

Hi Folks, I am new to appwrite and learning things.

I have installed appwrite, setup appwrite cli, configured java runtime 17.0.0 I deployed a sample java function (the default starter java function).

I am getting the below error message

Docker Error: Preparing for build ... Building ... Compiling ... Downloading https://services.gradle.org/distributions/gradle-7.5.1-bin.zip ...........10%............20%...........30%............40%...........50%............60%...........70%............80%...........90%............100%

Welcome to Gradle 7.5.1!

Here are the highlights of this release:

  • Support for Java 18
  • Support for building with Groovy 4
  • Much more responsive continuous builds
  • Improved diagnostics for dependency resolution

For more details see https://docs.gradle.org/7.5.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

Task :compileJava FAILED /usr/local/server/src/main/java/io/openruntimes/java/src/Main.java:33: error: cannot find symbol Map<String, Object> json = new HashMap<>(); ^ symbol: class Map location: class Main Note: /usr/local/server/src/main/java/io/openruntimes/java/Server.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/local/server/src/main/java/io/openruntimes/java/Server.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':compileJava'.

    Compilation failed; see the compiler error output for details.

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 37s 1 actionable task: 1 executed

TL;DR
[Solved] Build Failure On Java Starter Function Deployment. The user was experiencing a build failure while deploying a Java starter function in the Appwrite platform. They received a compilation error stating that the symbol 'Map' could not be found. A community member suggested checking if the import statement `import java.util.Map;` was included in the code. The user confirmed that they did include the import statement. The issue was resolved when the user refactored their code and it started working successfully. No further assistance was required.
palani
6 Oct, 2023, 05:33

I am self hosting appwrite. Using Java17 runtime

Danish
6 Oct, 2023, 09:03

did you include import java.util.Map;?

palani
6 Oct, 2023, 09:26

Yup refactored it now and it's working

palani
6 Oct, 2023, 09:26

[Solved] Build Failure On Java Starter Function Deployment

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more