Giter VIP home page Giter VIP logo

Comments (5)

apenski avatar apenski commented on May 27, 2024 1

I would then close issue and wait for a feature request requesting EAR - support. thank you for sharing your workaround.

from validator.

MrMikeFloyd avatar MrMikeFloyd commented on May 27, 2024

A little update that might help narrowing down the issue: Since we previously worked with two separate modules (api for all frontend-facing code; logic for all business logic, containing the validator) I had a look at how the validator would behave when placing all code in the same module. Using a flat structure with all code in a single maven module, the code initializing the validator wouldn't reside in a separate jar, but in the WAR's classes directory. The validator can then be used without running into a FileNotFoundException. The packaged EAR looks like this:

├───exploded_war
│   ├───META-INF
│   │       MANIFEST.MF
│   └───WEB-INF
│       ├───classes
│       │   ├───de
│       │   │   └───xxxx
│       │   │       └───xxxx
│       │   │           └───xxxx
│       │   │               └───xxxx
│       │   │                   └───api
│       │   │                       ├───config
│       │   │                       │       AppInitializer.class
│       │   │                       │       WebServiceConfig.class
│       │   │                       │
│       │   │                       └───xrechnung
│       │   │                           ├───boundary
│       │   │                           │       *.class files here
│       │   │                           │
│       │   │                           ├───config
│       │   │                           │       *.class files here
│       │   │                           │
│       │   │                           ├───control
│       │   │                           │       *.class files here
│       │   │                           │
│       │   │                           └───logic <-- All code from logic module moved here
│       │   │                               ├───kosit
│       │   │                               │       KositValidator.class <-- Validator is initialized and used here
│       │   │
│       │   └───xRechnung_v120
│       │       │   EN16931-CII-validation.xslt
│       │       │   EN16931-UBL-model.xslt
│       │       │   scenarios.xml
│       │       │
│       │       ├───resources
│       │       │   │   default-report.xsl
│       │       │   │   xrechnung-report.xsl
│       │       │   │
│       │       │   ├───cii
│       │       │   │   └───16b
│       │       │   │       ├───xsd
│       │       │   │       │       CrossIndustryInvoice_100pD16B.xsd
│       │       │   │       │       CrossIndustryInvoice_QualifiedDataType_100pD16B.xsd
│       │       │   │       │       ... other schemas omitted for brevity
│       │       │   │       │
│       │       │   │       └───xsl
│       │       │   │               EN16931-CII-validation.xsl
│       │       │   ├───ubl
│       │       │   │   └───2.1
│       │       │   │       ├───xsd
│       │       │   │       │   ├───common
│       │       │   │       │   │       CCTS_CCT_SchemaModule-2.1.xsd
│       │       │   │       │   │       UBL-CommonAggregateComponents-2.1.xsd
│       │       │   │       │   |       ... other schemas omitted for brevity
│       │       │   │       │   │
│       │       │   │       │   └───maindoc
│       │       │   │       │           UBL-ApplicationResponse-2.1.xsd
│       │       │   │       │           UBL-AttachedDocument-2.1.xsd
│       │       │   │       │           ... other schemas omitted for brevity
│       │       │   │       └───xsl
│       │       │   │               EN16931-UBL-validation.xsl
│       │       │   ├───xrechnung
│       │       │   │   └───1.2.0
│       │       │   │       └───xsl
│       │       │   │               XRechnung-CII-validation.xsl
│       │       │   │               XRechnung-UBL-validation-CreditNote.xsl
│       │       │   │               XRechnung-UBL-validation-Invoice.xsl
│       │       │   │
│       │       │   └───xsd
│       │       │           report.xsd
│       │       │           scenarios.xsd
│       │       │
│       │       └───schematron
│       │               EN16931-CII-validation-expanded.sch
│       │               EN16931-CII-validation-unabstract.sch
│       │               ... other schematron files omitted for brevity
│       │
│       └───lib
│               validationtool-1.1.0.jar <-- Validator lies here
|               ... all other external libraries here
├───META-INF
│       application.xml
│       MANIFEST.MF

This setup looks similar to issue 28 and has already been confirmed to work fine. Since we deploy into an enterprise infrastructure we will need to maintain a maven multi-module setup though- moving all code to the same module is fine for testing purposes, but not a viable approach for production. My question would therefore be: How can the validator successfully load the schema definitions from scenarios.xml in a multi-module project setup? My gut feeling is that this simply isn't possible with the current validator release.

from validator.

apenski avatar apenski commented on May 27, 2024

I don't know whether this is still relevant to you (sorry for the late reply), but loading the scenario contents from a jar should be possible when all of the stuff is packaged in the same jar. There is test case that loads relative resources from a jar.

The problem is, that jar-URIs are opaque, not hierarchical. so loading relative stuff is impossible. To circumvent this, we implemented a workaround (see RelativeUriResolver.java for details).

I guess the problem is somewhat related to the ear-deployment. We need to investigate this.

from validator.

MrMikeFloyd avatar MrMikeFloyd commented on May 27, 2024

I don't know whether this is still relevant to you (sorry for the late reply), but loading the scenario contents from a jar should be possible when all of the stuff is packaged in the same jar. There is test case that loads relative resources from a jar.

The problem is, that jar-URIs are opaque, not hierarchical. so loading relative stuff is impossible. To circumvent this, we implemented a workaround (see RelativeUriResolver.java for details).

I guess the problem is somewhat related to the ear-deployment. We need to investigate this.

Cheers for checking in. In the meantime we simply refrained from putting the Validator into a separate module. Currently we build and ship a single-module application (which results in everything being packaged into the same jar just like you mentioned). This works ok and doesn't pose any issues to us. It might be necessary to seperate the modules at a later point in time, but this is not a requirement we currently have.

from validator.

MrMikeFloyd avatar MrMikeFloyd commented on May 27, 2024

I would then close issue and wait for a feature request requesting EAR - support. thank you for sharing your workaround.

Thanks. We will have a discussion whether EAR support is something we will need in the future and create a feature request if need be.
I wish you happy holidays!

from validator.

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.