konik-io / konik

A library to create, read and validate ZUGFeRD compliant invoices. Available for Java and .NET
https://konik.io
Other
48 stars 19 forks source link

error during validation of io.konik.zugferd.Invoice@142ce1f #85

Closed Frogrek closed 5 years ago

Frogrek commented 5 years ago

We try to implement a ZUGFErD interface in our software on a Windows/Dotnet/C# platform on the based on your zugferd.dll. In our test project derived from your master example, it works pretty good. But in our main project (same platform) we get during the validation phase always the following exception: error during validation of io.konik.zugferd.Invoice@142ce1f

with the inner exception: interface javax.validation.constraints.NotNull is not visible from class loader

We googled but found none solution for this problem. Here is the sample of our validation method:

   public List<String> Validate(Invoice invoice)
    {
        List<String> err = new List<String>();
        InvoiceValidator Validator = new InvoiceValidator();

        try
        {
            Set violations = Validator.validate(invoice);

            if (violations.size() > 0)
            {
                err.Add("....);
                foreach (ConstraintViolation violation in violations.toArray())
                {
                    err.Add(violation.getMessage() + " @ " + violation.getPropertyPath() + "\n");
                }
            }
        }
        catch (Exception ex)
        {
            err.Add(ex.Message);
        }
        return (err);
    }
Vad1mo commented 5 years ago

can you add:

ikvm.runtime.Startup.addBootClassPathAssembly(typeof(javax.validation.constraints.NotNull).Assembly)
Frogrek commented 5 years ago

Dear Vadim,

 

in my IKVM.runtime library (version 8.1.5717.0) there is no namespace Startup included.

So I am doing something wrong?

 

Best regard

Waldemar Schlonsok

 

Gesendet: Montag, 04. November 2019 um 16:19 Uhr Von: "Vadim Bauer" notifications@github.com An: konik-io/konik konik@noreply.github.com Cc: Frogrek rogorek@gmx.de, Author author@noreply.github.com Betreff: Re: [konik-io/konik] error during validation of io.konik.zugferd.Invoice@142ce1f (#85)

can you add: ikvm.runtime.Startup.addBootClassPathAssembly(typeof(javax.validation.constraints.NotNull ).Assembly);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

 

 

Vad1mo commented 5 years ago

Take a look at the example code in https://github.com/konik-io/ZUGFeRD.NET-Example/blob/master/KonikNetExample/NetExampleInvoice.cs#L57

Frogrek commented 5 years ago

Hallo Vadim,

 

great thanks it works.

 

Best regards

Waldemar Schlonsok

 

Gesendet: Dienstag, 05. November 2019 um 11:11 Uhr Von: "Vadim Bauer" notifications@github.com An: konik-io/konik konik@noreply.github.com Cc: Frogrek rogorek@gmx.de, Author author@noreply.github.com Betreff: Re: [konik-io/konik] error during validation of io.konik.zugferd.Invoice@142ce1f (#85)

Take a look at the example code in https://github.com/konik-io/ZUGFeRD.NET-Example/blob/master/KonikNetExample/NetExampleInvoice.cs#L57

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.