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

Having 'java.lang.ClassNotFoundException: javax.xml.bind.ValidationEventHandler' issue with validator 1.5.0 library #149

Open
khanhdx-dev opened this issue Jan 15, 2025 · 0 comments

Comments

@khanhdx-dev
Copy link

khanhdx-dev commented Jan 15, 2025

Hi, currently I'm implementing this code to validate the invoices:

`private fun validateInvoice(textDocument: Path) {

    // Load scenarios.xml from classpath
    val scenarios = URLDecoder.decode(BASE_DIRECTORY.resolve("scenarios.xml").toString(), StandardCharsets.UTF_8)

    //For debug purpose
    //StreamSource(File(scenarios).readText())

    // Load the rest of the specific Validator configuration from classpath
    val config = Configuration.load(File(scenarios).toURI())

    // Use the default validation procedure
    val validator: Check = DefaultCheck(config.build(ProcessorProvider.getProcessor()))

    // Validate a single document
    val document: Input = InputFactory.read(textDocument.resolve("invoice.xml"))

    // Get Result including information about the whole validation
    val report = validator.checkInput(document)
    System.out.println("Is processing succesful=" + report.isProcessingSuccessful())`

After debugging the app, I met this error at line val config = Configuration.load(File(scenarios).toURI()) :
java.lang.ClassNotFoundException: javax.xml.bind.ValidationEventHandler

I'm using:

  • java correctto-21
  • validationtool version 1.5.0
  • jaxb-runtime version 4.0.5

Does anyone know how to resolve this?
Thanks

@khanhdx-dev khanhdx-dev changed the title Having issue with validator 1.5.0 library Having 'java.lang.ClassNotFoundException: javax.xml.bind.ValidationEventHandler' issue with validator 1.5.0 library Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant