0
私は奇妙な問題に直面しています。私はファイルを検証するためにXMLスキーマを作成しようとしています。私は私の機能に次のようにやっている:JenkinsでSAXExceptionがスローされました
String schemaFilename = ApplicationConfiguration.xsdConfiguration.getTypeMappings().get(fileType);
ClassLoader classLoader = getClass().getClassLoader();
File schemaFile = new File(classLoader.getResource(ApplicationConfiguration.xsdConfiguration.getXsdSchemasLocation()+schemaFilename).getFile());
final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = null;
try
{
schema = schemaFactory.newSchema(schemaFile);
}
catch (SAXException e) {
logger.error("Could not instantiate XSD schema from file: {}", schemaFile.getName());
e.printStackTrace();
validXML = false;
}
私はWindows上のいずれかにすべてが正常に動作のIntelliJを介して、またはMavenを介して、私のテストを実行すると。私はCentOSに上で実行して、ジェンキンス上に構築しようとしているとき、私は(編集したスタックトレース)
org.xml.sax.SAXParseException; systemId: file:/...myfile.xsd; lineNumber: 48; columnNumber: 39; src-resolve: Cannot resolve the name 'AnElement' to a(n) 'type definition' component.
間違って行くことができるものを上の任意のアイデアSAXExceptionsを取得していますか?