-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Module function cannot be found in 1.2.0 #1132
Comments
I face the same problem. Migrating from 1.1.5 to 1.2.0 |
My problem was that i whas ussing:
So for me you can close the issue. |
Can confirm. This way it works:
However, with a default parameter and @jvmoverloads, it does not. |
Same problem. It is not good that users cannot run projects generated by KTor website :( In
|
I have the same problem. Also macOS, JDK8, ktor 1.2. |
any updates here? I am having the same error, tried the trick with removing the testing boolean, does not work |
The solution for we was removing both the testing parameter and the JvmOverloads annotation so that now it's just |
Same issue here...kind of a big deal that the default generated Ktor project from IntelliJ fails to run |
Fixed in 1.2.1 |
It's Not fixed yet. |
I'm using 1.2.1 too. And get the same error. |
Works fine for me ! Thanks !! |
This is reproducible on 1.2.0 for me too, on a clean project, just created through IntellIJ IDEA. So creating and running a new empty project is broken, this should be a showstopper. I followed Ktor Getting Started docs. |
With 1.2.1 works fine for me -#1132 (comment) |
Verified fixed in 1.2.1 |
Check the package of your kt file |
The name must match what you have in
Fail
Success
|
Try marking |
This worked for me ONLY if my file name was exactly Application.kt (I had chosen server.kt), and my function as: fun Application.module() {} (no parameter). This differs from the ktor docs https://ktor.io/docs/create-server.html#engine-main. The design decision to wrap "main" and force the user to conform to your custom "main" format is never a good one because your lib is not the heart of my program. Let me be in control and pass you a callback function, if you absolutely MUST schedule the run of "main" yourself. The decision to define what is "main" in a conf file is even crazier. What web app needs entry point A today, but tomorrow somehow there's a compelling reason to stop the server (which should never happen) and restart at entry point B? This whole .conf file is just one more thing that can go wrong, and is massive overkill to define the port and IP, as is clear by all the search hits (should be optional). The "embeddedServer" interface is nice clean and kotlin-like. But based on the docs, etc, it seems like it may be meant for debug not deploy? Does it have perf or other limitations? If it does not, it would be nice to make that clear. |
Ktor Version
1.2.0
Ktor Engine Used(client or server and name)
Ktor server
JVM Version, Operating System and Relevant Context
java version "1.8.0_151"
MacOS
Feedback
I've migrated mi running project from 1.1.5 to 1.2.0 and I've the following error.
Exception in thread "main" java.lang.ClassNotFoundException: Module function cannot be found for the fully qualified name 'cat.helm.catformacio.ApplicationKt.module'
Has the configuration changed?
The text was updated successfully, but these errors were encountered: