Skip to content
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

[IntelliJ][ReportedByUser] ClassNotFoundException with local deployment of function app that depends on another module in the same project #7063

Closed
sotty opened this issue Nov 4, 2022 · 0 comments

Comments

@sotty
Copy link

sotty commented Nov 4, 2022

IntelliJ build version: 2022.2.3 #IU-222.4345.14
OS: Windows 10
JDK: Adoptium 11.0.9
Plugin version: 3.69.0-2022.2
Maven 3.8.6
Azure Core Tools Version: 4.0.3971
Function Runtime Version: 4.0.1.16815

Hi,
I have a function app enabled module F, and a regular Java library L
Both are Maven-enabled, and F's pom.xml lists a depdendency to L
Both are open in the same project: IntelliJ manages the dependency as a module-module dependency

When I try to deploy the Function App locally, the plugin is apparently unable to honor the module-module dependency:
L's jar is not included in the Temp/azure-functions****/lib folder, and I get a runtime ClassNotFoundException when one of the classes in F tries to instantiate one of the classes in L.

When I build, package and run F via maven azure-functions:run, everything is fine.
The maven build target/azure-functions/F/lib contains L.jar.

I have opened F in a standalone project that does not include L. IntelliJ lists the dependency as a Maven dependency
(not a cross-module dependency), and the local deployment includes all the necessary jars.

This issue has been discussed by others on StackOverflow, but treated as a Maven issue, with no luck

The obvious workaround is to open the Function App module F in a standalone IntelliJ project

Thank you in advance

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

No branches or pull requests

2 participants