Skip to content

IntelliJ Azure Function SQL Library is not copied to lib folder when running locally #7116

@hannosgit

Description

@hannosgit

Hi,

I am currently trying to use the @SQLOutput annotation to insert data into a MS SQL Server (Azure SQL) but when my function runs, it throws a NullPointerException.

The annotation looks like this: @SQLOutput(name = "diagram", commandText = "dbo.generatedDiagram", connectionStringSetting = "SqlConnectionString") OutputBinding<GeneratedDiagram> output

I am using the following dependencies (Maven):

<dependency>
    <groupId>com.microsoft.azure.functions</groupId>
    <artifactId>azure-functions-java-library-sql</artifactId>
    <version>0.1.1</version>
</dependency>
<dependency>
    <groupId>com.microsoft.azure.functions</groupId>
    <artifactId>azure-functions-java-library</artifactId>
    <version>2.2.0</version>
</dependency>

The error message:

No action performed. Extension bundle is configured in C:\Users\XXXXXX\azure-functions13375142058260838316\host.json.
Using port : 57,416

Azure Functions Core Tools
Core Tools Version:       4.0.4829 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.11.2.19273


Functions:

	UMLGenerator: queueTrigger

For detailed output, run func with --verbose flag.
[2022-11-20T14:39:50.537Z] Worker process started and initialized.
[2022-11-20T14:39:53.759Z] Host lock lease acquired by instance ID '000000000000000000000000794D106B'.
[2022-11-20T14:40:41.461Z] Executing 'Functions.UMLGenerator' (Reason='New queue message detected on 'my-queue'.', Id=2068a795-a892-4dc4-9672-2b8a9b8a9435)
[2022-11-20T14:40:41.462Z] Trigger Details: MessageId: 7a9fa072-da30-4ded-932e-e0a3dc97972e, DequeueCount: 1, InsertedOn: 2022-11-20T14:40:40.000+00:00
[2022-11-20T14:40:41.612Z] Executed 'Functions.UMLGenerator' (Failed, Id=2068a795-a892-4dc4-9672-2b8a9b8a9435, Duration=172ms)
[2022-11-20T14:40:41.612Z] System.Private.CoreLib: Exception while executing function: Functions.UMLGenerator. System.Private.CoreLib: Result: Failure
Exception: NullPointerException: 
Stack: java.lang.NullPointerException
[2022-11-20T14:40:41.612Z] 	at com.microsoft.azure.functions.worker.binding.BindingDataStore.isDataTargetValid(BindingDataStore.java:145)
[2022-11-20T14:40:41.612Z] 	at com.microsoft.azure.functions.worker.binding.BindingDataStore.getOrAddDataTarget(BindingDataStore.java:123)
[2022-11-20T14:40:41.612Z] 	at com.microsoft.azure.functions.worker.broker.ParameterResolver.resolve(ParameterResolver.java:56)
[2022-11-20T14:40:41.612Z] 	at com.microsoft.azure.functions.worker.broker.ParameterResolver.resolve(ParameterResolver.java:42)
[2022-11-20T14:40:41.613Z] 	at com.microsoft.azure.functions.worker.broker.EnhancedJavaMethodExecutorImpl.execute(EnhancedJavaMethodExecutorImpl.java:53)
[2022-11-20T14:40:41.613Z] 	at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:61)
[2022-11-20T14:40:41.613Z] 	at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:37)
[2022-11-20T14:40:41.613Z] 	at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:12)
[2022-11-20T14:40:41.613Z] 	at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45)
[2022-11-20T14:40:41.613Z] 	at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92)
[2022-11-20T14:40:41.613Z] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[2022-11-20T14:40:41.613Z] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[2022-11-20T14:40:41.613Z] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[2022-11-20T14:40:41.614Z] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[2022-11-20T14:40:41.614Z] 	at java.base/java.lang.Thread.run(Thread.java:834)
[2022-11-20T14:40:41.614Z] .

The error does not occur when I manually copy the azure-functions-java-library-sql-0.1.1.jar into the lib folder of the temporary function folder, e.g. C:\Users\XXX\AppData\Local\Temp\azure-functions2359841041595521895\lib.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions