Comments (3)
I seem to be having the same problem: Could not resolve classpath using Gradle: ClassLoader.getSystemResourceAsStream(scriptName) must not be null
.
This happens as soon as I try to use an external library: I use the sample project for testing the debugger , and it works fine. If I add an external reference, I get the error.
[INFO] main Connected to client
[INFO] async1 Resolving dependencies for 'kotlin-quick-start' through Gradle's CLI using tasks [kotlinLSPProjectDeps]...
[WARN] async1 Could not resolve classpath using Gradle: ClassLoader.getSystemResourceAsStream(scriptName) must not be null
[INFO] async1 Successfully resolved kotlin-stdlib using Maven
[INFO] async1 Starting JVM debug session with main class quick.start.AppKt
Exception in thread "main" java.lang.NoClassDefFoundError: se/magnusgunnarsson/kutil/DBConnectionBuilder
at quick.start.AppKt.main(App.kt:17)
Caused by: java.lang.ClassNotFoundException: se.magnusgunnarsson.kutil.DBConnectionBuilder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 1 more
[INFO] eventBus Sent exit event
[INFO] async0 Exiting JDI session
The project runs without problem when using ./gradlew run
.
Here is the kotlin code:
package quick.start
import java.io.File
import se.magnusgunnarsson.kutil.DBConnectionBuilder
class App {
val greeting: String
get() = "Hello world."
}
fun main(args: Array<String>) {
val conn = DBConnectionBuilder.createConnection( DBConnectionBuilder.DatabaseID.EUL_XGUMAG_TEST )
val qry = """
SELECT institution, year, OVERALL_SCORE_CALC AS score
FROM RANK_ARWU_OVERALL
WHERE country='Sweden'
ORDER BY institution, year
"""
val stmt = conn.createStatement()
val rs = stmt.executeQuery( qry )
while ( rs.next() ){
println( rs.getString(1) )
}
println(App().greeting)
}
I'm on Mac OS X 13.13.1, VSCode 1.77.3 and (to the best of my knowledge) openjdk 11.
from kotlin-debug-adapter.
Your projects are single module projects, right? Do you remember to actually build your projects before trying to debug? the debug adapter does not build anything for you, and depends on the files in the build
-directory. Tried both a Spring and Quarkus project again just now to verify that nothing is suddenly broken, and both work fine after running a ./gradlew build
first.
from kotlin-debug-adapter.
Yes, it is single module, and yes, I build it first.
from kotlin-debug-adapter.
Related Issues (20)
- Unable to attach debugger to a unit test HOT 1
- Problems using within gradle project
- Support variable presentation hints, e.g. for lazy evaluation of values
- Ability to debug a Kotlin program (JVM, not Native), without gradle or maven HOT 1
- Unable to stop at breakpoints and continue execution HOT 8
- Cannot Debug Quarkus Kotlin project HOT 2
- How to debug kotlin-debug-adapter
- Fix issues with the shared module dependency and update it HOT 4
- [Discussion] Instruction on developing new feature on the debug adapter
- Improve source root resolving for multi-module projects
- Gradle dependencies could not be resolved [Kotlin VS Code Extension] HOT 4
- Gradle runtimeOnly dependencies not in classpath HOT 1
- Resolving dependencies not working -> Gradle fails with "configuration linuxCompileClasspath not found" HOT 1
- Debugging unit tests HOT 1
- Fields from outer class not shown, only inner fields
- Can I use this to debug android project?
- Kotlin debug doesn't stop at Clikt subcommand
- VSCode Debug Console not evaluating expressions HOT 1
- Custom Kotlin Script definition can't be debugged
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-debug-adapter.