Trying to run azure-sample but encountering a "Failed to locate main class" error when a request comes in.
Build project in eclipse with maven. Updated code based on this issue (or else you will get a ClassCast Exception).
Running locally or remotely (after deploy) produces same error.
Didn't change POM from the sample except to point to my functionAppName, Region, ResourceGroup to prepare for deploy.
Executed 'Functions.uppercase' (Failed, Id=349ca69e-4548-4af2-b6a4-84bf5afbedb5)
[4/10/19 9:03:39 PM] System.Private.CoreLib: Exception while executing function: Functions.uppercase. System.Private.CoreLib: Result: Failure
[4/10/19 9:03:39 PM] Exception: IllegalArgumentException: Failed to locate main class
[4/10/19 9:03:39 PM] Stack: java.lang.IllegalStateException: Failed to discover main class. An attempt was made to discover main class as 'MAIN_CLASS' environment variable, system property as well as entry in META-INF/MANIFEST.MF (in that order).
[4/10/19 9:03:39 PM] at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.getStartClass(AbstractSpringFunctionAdapterInitializer.java:279)
[4/10/19 9:03:39 PM] at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.<init>(AbstractSpringFunctionAdapterInitializer.java:99)
[4/10/19 9:03:39 PM] at org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler.<init>(AzureSpringBootRequestHandler.java:44)
[4/10/19 9:03:39 PM] at example.FooHandler.<init>(FooHandler.java:33)
[4/10/19 9:03:39 PM] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[4/10/19 9:03:39 PM] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[4/10/19 9:03:39 PM] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[4/10/19 9:03:39 PM] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[4/10/19 9:03:39 PM] at java.lang.Class.newInstance(Class.java:442)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.broker.JavaMethodExecutor.lambda$execute$1(JavaMethodExecutor.java:54)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.broker.JavaMethodInvokeInfo.invoke(JavaMethodInvokeInfo.java:20)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.broker.JavaMethodExecutor.execute(JavaMethodExecutor.java:54)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:51)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:33)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:10)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45)
[4/10/19 9:03:39 PM] at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92)
[4/10/19 9:03:39 PM] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[4/10/19 9:03:39 PM] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[4/10/19 9:03:39 PM] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[4/10/19 9:03:39 PM] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[4/10/19 9:03:39 PM] at java.lang.Thread.run(Thread.java:748)
[4/10/19 9:03:39 PM] Caused by: java.lang.IllegalArgumentException: Failed to locate main class
[4/10/19 9:03:39 PM] at org.springframework.util.Assert.notNull(Assert.java:198)
[4/10/19 9:03:39 PM] at org.springframework.cloud.function.context.AbstractSpringFunctionAdapterInitializer.getStartClass(AbstractSpringFunctionAdapterInitializer.java:275)
[4/10/19 9:03:39 PM] ... 21 more
EDIT: It seems the jar in the azure-functions folder is different than the final jar that is created by the Thin spring maven plugin. The MANIFEST files contain different mains. The azure-functions jar just seems to be the result of the maven-jar-plugin, but it still references the @SpringBootApplication class as its main. Shouldn't that still work? What is the point of using the thin wrapper at all in this example?