Comments (7)
@asc-schleupen
Hab das gleiche Problem. Nur kommt bei mir ein JBoss zum Einsatz und der liefert Xerces (xercesImpl-2.11.0) auch gleich mit.
Die SchemaFactory
, die von Xerces implementiert wird mit org.apache.xerces.jaxp.validation.XMLSchemaFactory
läßt sicher allerdings nicht konfigurieren wie ich feststellen mußte.
Wie schon @apenski erwähnt hat, solte man eine eigene Resolving-Strategie entwickeln.
In dieser habe ich allerdings die com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory
aus dem JDK
eingesetzt und festgestellt, dass es funktioniert.
from validator.
@Cakmakli-a
Vielen Dank für den Tipp. Es hat funktioniert. Die CustomStrategy habe ich von StrictLocalResolvingStrategy übernommen und die createSchemaFactory-Methode wie folgt überschrieben:
@Override
public SchemaFactory createSchemaFactory() {
forceOpenJdkXmlImplementation();
final SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI, "com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory", this.getClass().getClassLoader() );
disableExternalEntities(sf);
allowExternalSchema(sf, "vfs");
return sf;
}
from validator.
Cannot cast object 'de.kosit.validationtool.config.ConfigurationLoader@475d59c0' with class 'de.kosit.validationtool.config.ConfigurationLoader' to class 'de.kosit.validationtool.api.Configuration'
da hat sich ein Fehler in der Doku eingeschlichen. Es muss heißen:
Configuration.load(scenarios.toURI()).build()
Hintergrund: man kann die geladene Konfiguration mit dem Builder noch etwas anpassen. Ich denke da müssen wir die API noch etwas selbsterklärender gestalten.
Can not disable external DTD access. Maybe an unsupported JAXP implementation is used.
der Validator setzt bzgl. Security auf die XML-Implementierung vom OpenJDK. Wenn diese nicht verwendet wird (nicht OpenJDK oder XercesJ im Classpath o.ä.) kann die XML-Sicherheit nicht gewährleistet werden. Um die Sicherheit nicht gefährden, hab wir da auch keinen Ignore-Switch o.ä.
Möchte man das trotzdem machen, muss man eine eigene Resolving-Strategie entwickeln (also die XML-Factories in konfigurierter Form bereitstellen). Siehe Security Dokumentation
from validator.
Danke fuer die Informationen.
Welche OpenJDK Distributions und Version sollte man am besten nutzen bzw. was nutzt Ihr eigentlich?
from validator.
also eigentlich alles was als als OpenJDK-Distribution durchgeht, sollte gehen. Wir testen aktiv die in der CI-Definition aufgeführten
from validator.
Hallo,
wir sind auf den gleichen Fehler gelaufen
URL scenarios = this.getClass().getClassLoader().getResource("/resources/scenarios.xml");
Configuration config = Configuration.load(scenarios.toURI()).build();
Das Laden der Konfiguration führt zu folgender Exception
2020-12-18 08:50:13,514 ERROR [de.schleupen.cs.ap.bi.birtreportingservice.businesscases.XRechnungValidationControllerImpl] (default task-1) Fehler beim Erstellen des Prüfberichts: java.lang.IllegalStateException: Can not disable external DTD access. Maybe an unsupported JAXP implementation is used.
at deployment.BirtReportingService.war//de.kosit.validationtool.impl.xml.BaseResolvingStrategy.setProperty(BaseResolvingStrategy.java:85)
at deployment.BirtReportingService.war//de.kosit.validationtool.impl.xml.BaseResolvingStrategy.disableExternalEntities(BaseResolvingStrategy.java:127)
at deployment.BirtReportingService.war//de.kosit.validationtool.impl.xml.BaseResolvingStrategy.disableExternalEntities(BaseResolvingStrategy.java:115)
at deployment.BirtReportingService.war//de.kosit.validationtool.impl.xml.StrictRelativeResolvingStrategy.createSchemaFactory(StrictRelativeResolvingStrategy.java:91)
at deployment.BirtReportingService.war//de.kosit.validationtool.impl.ContentRepository.<init>(ContentRepository.java:99)
at deployment.BirtReportingService.war//de.kosit.validationtool.config.ConfigurationLoader.build(ConfigurationLoader.java:137)
[xercesImpl-2.12.0.SP02.zip](https://github.com/itplr-kosit/validator/files/5714541/xercesImpl-2.12.0.SP02.zip)
es wird folgendes JDK verwendet
java --version
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
Die Xerces Implementierung kommt durch den Wildfly-Server Version (>= 18.0.1) : xercesImpl-2.12.0.SP02.jar
Die Prüfung des JDKs in BaseResolvingStrategy.isOpenJdkXmlImplementationAvailable ist erfolgreich. Welche Optionen haben wir die Prüfung zum Laufen zu bringen?
from validator.
OpenJDK bei mir:
adopt-openj9-1.8.0_265
from validator.
Related Issues (20)
- 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
- ValidationTool 1.5.0 Fails with "java.lang.IllegalArgumentException: No repository location for scenario definition 'default_1'" HOT 2
- Broken matching in multiple scenario files
- maven pom doesn't specify transitive dependencies HOT 2
- Document valid on https://kositvalidator.service-bw.de/ (1.4.2) not valid locally (neither 1.4.2 nor 1.5.0) HOT 5
- Custom Level ignored in Result via Java Api HOT 1
- Update README: "Third party validation configurations"
- Command line output says "reject", validation result document says "accept" HOT 1
- Outdated API Documentation for 1.5.0
- Check result to stdout causes an exception
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.