Comments (5)
I would then close issue and wait for a feature request requesting EAR - support. thank you for sharing your workaround.
from validator.
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.
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.
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.
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)
- Make createReport optional HOT 2
- Role is null in FailedAssert HOT 9
- Loading of XSLT throws exception HOT 3
- Absolute path required
- Jakarta support HOT 2
- Deamon Mode Exception at startup HOT 4
- IllegalArgumetException wenn Repository Parameter nicht angegeben HOT 2
- BR-17 BT-59 Same name für Payee and Seller is an error since xrechnung-2.3 HOT 3
- Multi language support for reports
- Assertion results output
- Saxon throws exception with new 1.5.0 validator (Java) HOT 4
- Documentation for version 1.5.0 not updated
- Accent support HOT 2
- IllegalStateException wenn TXT-Datei validiert wird HOT 13
- java.lang.NoSuchMethodException using Java 17 HOT 5
- Docsify has CVE-2020-7680 and CVE-2021-21306 HOT 6
- High Memory Usage HOT 1
- Fehlermeldung "Leitweg-ID ungültig" bei ungültigen XML-Dateien umformulieren HOT 1
- Validator fails on xslt compiled by schxslt 1.9.x and saxon-he 11.3 HOT 5
- Make schemaValidate optional
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 validator.