Giter VIP home page Giter VIP logo

Comments (7)

 avatar commented on August 21, 2024

I realize this may not be directly an issue of the library, but a consequence of using the ShadowJar plugin.

Note that i have the following file in my generated jar:

kotlinx/ast/grammar/kotlin/target/antlr/kotlin/KotlinGrammarAntlrKotlinParser.class

from ast.

drieks avatar drieks commented on August 21, 2024

Hi @gauthier-roebroeck-mox,
when the class is not found (for example, if you remove the .class file from the jar file) you will get a ClassNotFoundException. NoClassDefFoundError means that there was an exception while running the static initialisation code of the given class. There should be another error in the log before this. This can be a ClassNotFoundException, caused by one of the dependencies not found.

can you send me a list of all kotlinx.ast and org.antlr file in yours jar file? maybe like this:

unzip -l jarfile.jar | grep kotlinx
unzip -l jarfile.jar | grep ast

from ast.

 avatar commented on August 21, 2024

@drieks here is a gist with the 2 greps you provided. Appreciate if you can help finding out what's missing for your library to function.

from ast.

 avatar commented on August 21, 2024

There should be another error in the log before this

There's no other error prior to that one.

Here is the code I use to parse:

fun parseFromStream(input: InputStream, properties: PropertiesProvider): List<Pair<String, List<Schema>>> {
        val source = AstSource.String("", input.bufferedReader().readText())
        val kotlinFile = KotlinGrammarAntlrKotlinParser.parseKotlinFile(source)
        ...
}

from ast.

drieks avatar drieks commented on August 21, 2024

Hi @gauthier-roebroeck-mox,

sadly it is very hard to help in this case because I can't debug it. Can you create a repository containing only the files required to reproduce this problem?

from ast.

 avatar commented on August 21, 2024

Can you create a repository containing only the files required to reproduce this problem?

That may be difficult, it is an internal private project for my employer, i cannot share the code as is.

from ast.

drieks avatar drieks commented on August 21, 2024

Hi @gauthier-roebroeck-mox,

you can start with an empty project/directory and add only the required files, mainly the build file. No additional dependencies (expect kotlinx.ast) are required, only one small example main and the important part, the jar building settings. No other source files are required. This is called "minimal working example" and allows me to debug this problem.

from ast.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.