azure-functions-java-worker icon indicating copy to clipboard operation
azure-functions-java-worker copied to clipboard

Java worker fails to start if dependencies are missing in the class path

Open pragnagopa opened this issue 7 years ago • 3 comments

Need to handle dependency load errors and report to the user instead of killing java process. Here is an example

Microsoft.Azure.WebJobs.Script.Rpc.LanguageWorkerProcessExitException : D:\Program Files\FunctionsJava\zulu8.30.0.1-jdk8.0.172-win_x64\bin\java exited with code -1
 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".,[SEVERE] {Application.main}: Unexpected Exception causes system to exit

D:\Program Files\FunctionsJava\zulu8.30.0.1-jdk8.0.172-win_x64\bin\java exited with code -1
 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".,[SEVERE] {Application.main}: Unexpected Exception causes system to exit

pragnagopa avatar Nov 06 '18 19:11 pragnagopa

Notes from @FinVamp1

https://www.slf4j.org/codes.html#StaticLoggerBinder to avoid this error to begin with.

This warning message is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.

pragnagopa avatar Nov 06 '18 19:11 pragnagopa

This ended up being resolved by removing the logging section from the customer Host.json.

{ "version": "2.0", "functionTimeout": "00:10:00", "logging": { "photo": "Debug", "default": "Debug" } }

They are also running with an older Library in their Pom.xml

    <dependency>
        <groupId>com.microsoft.azure.functions</groupId>
        <artifactId>azure-functions-java-library</artifactId>
        <version>1.0.0-beta-5</version>
    </dependency>

Checking if they can reproduce on the latest library.

FinVamp1 avatar Nov 23 '18 15:11 FinVamp1

@amamounelsayed - can you verify if this is fixed? Thanks!

kulkarnisonia16 avatar Dec 17 '19 19:12 kulkarnisonia16

Never see similar issue again, will have this one closed.

kaibocai avatar Feb 23 '23 22:02 kaibocai