Daffodil Apache не может открыть свои файлы xsd внутри нативного исполняемого файла Linux, произведенного с QuarkusJAVA

Программисты JAVA общаются здесь
Anonymous
Daffodil Apache не может открыть свои файлы xsd внутри нативного исполняемого файла Linux, произведенного с Quarkus

Сообщение Anonymous »

В настоящее время у меня проблемы с попыткой интегрировать нарцискую в нарцискую работу в исполняемого файла Linux, произведенного с помощью Quarkus. /Quarkus-dfdl.
Что я сделал Руководство: https://quarkus.io/guides/getting-started.
[*] Добавлены эти файлы из примеров Daffodil Github в проект: https://github.com/opendfdl/examples /tree/master/helloworld.
[*] Создал нативного исполняемого файла после этого руководства: https://quarkus.io/guides/building-native-image.

Основной класс helloworld.java предоставляется здесь: Br />package org.acme;

import org.apache.daffodil.japi.*;
import org.apache.daffodil.japi.infoset.JDOMInfosetOutputter;
import org.apache.daffodil.japi.infoset.JsonInfosetOutputter;
import org.apache.daffodil.japi.io.InputSourceDataInputStream;
import org.jdom2.Content;
import org.jdom2.Document;
import org.jdom2.Namespace;
import org.jdom2.filter.ContentFilter;
import org.jdom2.output.XMLOutputter;
import org.jdom2.transform.XSLTransformException;
import org.jdom2.xpath.XPathExpression;
import org.jdom2.xpath.XPathFactory;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
* Demonstrates using the Daffodil DFDL processor to
*
  • * compile a DFDL schema
    * parse non-XML data into XML,
    * access the data it using XPath,
    * transform the data using XSLT
    * unparse the transformed data back to non-XML form.
    *
*/
public class HelloWorld {

public void start() throws IOException, XSLTransformException, URISyntaxException {
try(FileOutputStream outputStream = new FileOutputStream("test.txt")) {

URI schemaFileURI = new File("files/helloWorld.dfdl.xsd").toURI();
URI dataFileURI = new File("files/helloWorld.dat").toURI();
URI xsltFileURI = new File("files/helloWorld.xslt").toURI();

outputStream.write(("Schema : " + schemaFileURI + "\n").getBytes());
outputStream.write(("Data : " + dataFileURI + "\n").getBytes());
outputStream.write(("XSLT : " + xsltFileURI + "\n").getBytes());
String fileToLoad = System.getProperty("test.file.toload");
outputStream.write(("Property : " + fileToLoad + "\n").getBytes());

//
// Run the executable with -Dtest.file.toload=path/to/resource/file to test if the file is included in the executable
//
if(fileToLoad != null) {
URL resourceURL = HelloWorld.class.getResource(fileToLoad);
if(resourceURL != null) {
outputStream.write(("Found resource URL : " + resourceURL + "\n").getBytes());
outputStream.write(("Found resource URI : " + resourceURL.toURI() + "\n").getBytes());
try(InputStream inputStream = resourceURL.openStream()) {
outputStream.write(inputStream.readAllBytes());
}
}
}
//
// First compile the DFDL Schema
//
Compiler c = Daffodil.compiler();
ProcessorFactory pf = c.compileSource(schemaFileURI);
outputStream.write("XSD compiled\n".getBytes());
List diags1 = pf.getDiagnostics();
outputStream.write("Diagnostics : \n".getBytes());
for(Diagnostic d : diags1) {
outputStream.write(d.getSomeMessage().getBytes());
outputStream.write("\n".getBytes());
}

if(pf.isError()) {
// didn't compile schema. Must be diagnostic of some sort.
List diags = pf.getDiagnostics();
for(Diagnostic d : diags) {
outputStream.write(d.getSomeMessage().getBytes());
outputStream.write("\n".getBytes());
}
}

DataProcessor dp = pf.onPath("/");
if(dp.isError()) {
// didn't compile schema. Must be diagnostic of some sort.
List diags = dp.getDiagnostics();
for(Diagnostic d : diags) {
outputStream.write(d.getSomeMessage().getBytes());
outputStream.write("\n".getBytes());
}
}
//
// Parse - parse data to XML
//
outputStream.write("**** Parsing data into XML *****".getBytes());
outputStream.write("\n".getBytes());
java.io.InputStream is = dataFileURI.toURL().openStream();
InputSourceDataInputStream dis = new InputSourceDataInputStream(is);
//
// Setup JDOM outputter
//
JDOMInfosetOutputter outputter = new JDOMInfosetOutputter();

// Do the parse
//
ParseResult res = dp.parse(dis, outputter);

// Check for errors
//
boolean err = res.isError();
if(err) {
// didn't parse the data. Must be diagnostic of some sort.
List diags = res.getDiagnostics();
for(Diagnostic d : diags) {
outputStream.write(d.getSomeMessage().getBytes());
outputStream.write("\n".getBytes());
}

}

Document doc = outputter.getResult();
//
// if we get here, we have a parsed infoset result!
// Let's print the XML infoset.
//
// Note that if we had only wanted this text, we could have used
// a different outputter to create XML text directly,
// but below we're going to transform this JDOM tree.
//
XMLOutputter xo = new XMLOutputter(org.jdom2.output.Format.getPrettyFormat());
xo.output(doc, outputStream);
outputStream.write("\n".getBytes());

// If all you need to do is parse things to XML, then that's it.

// Let's display it as JSON also for those that need or prefer JSON
{
outputStream.write("**** Parsing data into JSON ****".getBytes());
outputStream.write("\n".getBytes());
java.io.InputStream is2 = dataFileURI.toURL().openStream();
InputSourceDataInputStream dis2 = new InputSourceDataInputStream(is2);
JsonInfosetOutputter jo = new JsonInfosetOutputter(outputStream, true);
outputStream.write("\n".getBytes());
ParseResult res2 = dp.parse(dis2, jo);
boolean err2 = res2.isError();
if(err2) {
// didn't parse the data. Must be diagnostic of some sort.
List diags = res.getDiagnostics();
for(Diagnostic d : diags) {
outputStream.write(d.getSomeMessage().getBytes());
outputStream.write("\n".getBytes());
}

}
}
//
// XPATH - use it to access the data
//
outputStream.write("**** Access with XPath *****".getBytes());
outputStream.write("\n".getBytes());

XPathExpression xexp = setupXPath("/hw:helloWorld/word[2]/text()");
List clist = xexp.evaluate(doc);
if(clist.isEmpty()) {
outputStream.write("XPath produced nothing.".getBytes());
outputStream.write("\n".getBytes());

} else {
Content content = clist.getFirst();
String txt = content.getValue();
outputStream.write(String.format("XPath says we said hello to %s%n", txt).getBytes());
outputStream.write("\n".getBytes());
}
outputStream.write("End hello world".getBytes());
}
}

/**
* Does the boilerplate stuff needed for xpath expression setup
*
* @return the compiled XPathExpression object which can be evaluated to run it.
*/
private static XPathExpression setupXPath(String xpath) {
// Need this namespace definition since the schema defines the root
// element in this namespace.
//
// A real application would hoist this boilerplate all out so it's done
// once, not each time we need to evaluate an XPath expression.
//
Namespace[] nss = {Namespace.getNamespace("hw", "http://example.com/dfdl/helloworld/")};
XPathFactory xfactory = XPathFactory.instance();
ContentFilter cf = new ContentFilter(ContentFilter.TEXT);
Map variables = Collections.emptyMap();
return xfactory.compile(xpath, cf, variables, nss);
}
}
< /code>
Все скомпилируется и выполняется внутри вирутальной машины, использующей alma linux 8.10 в качестве пользователя root. < /p>
Как объяснено в этом руководстве, я должен был использовать файл Application.Properties для добавления файлов XSD из зависимости Daffodil-Lib в качестве ресурсов для собственного исполняемого файла. Мне также нужно было зарегистрировать некоторые классы для размышлений с классом ReflectionConfiguration. Нативные исполняемые броски бросают следующую ошибку: < /p>
Schema Definition Error: Error loading schema due to Invalid or unsupported schemaLocation URI: Unrecognized URI type: resource:/org/apache/daffodil/xsd/XMLSchema_for_DFDL.xsd
Schema context: L o c a t i o n i n / r o o t / D o c u m e n t s / q u a r k u s / g e t t i n g - s t a r t e d - d f d l / f i l e s / h e l l o W o r l d . d f d l . x s d < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . D F D L S c h e m a F i l e L o a d E r r o r H a n d l e r . $ a n o n f u n $ l o a d e r S D E s $ 1 ( D F D L S c h e m a F i l e . s c a l a : 6 0 ) < b r / > a t s c a l a . c o l l e c t i o n . i m m u t a b l e . L i s t . m a p ( L i s t . s c a l a : 2 9 3 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . D F D L S c h e m a F i l e L o a d E r r o r H a n d l e r . l o a d e r S D E s ( D F D L S c h e m a F i l e . s c a l a : 5 1 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . D F D L S c h e m a F i l e L o a d E r r o r H a n d l e r . h a n d l e L o a d E r r o r s ( D F D L S c h e m a F i l e . s c a l a : 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . D F D L S c h e m a F i l e . $ a n o n f u n $ i i X M L S c h e m a D o c u m e n t $ 1 ( D F D L S c h e m a F i l e . s c a l a : 2 3 6 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y $ l z y c o m p u t e ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . l i f t e d T r e e 1 $ 1 ( O O L A G . s c a l a : 7 0 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y $ l z y c o m p u t e ( O O L A G . s c a l a : 7 0 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y ( O O L A G . s c a l a : 6 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e $ l z y c o m p u t e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . D F D L S c h e m a F i l e . i i X M L S c h e m a D o c u m e n t $ l z y c o m p u t e ( D F D L S c h e m a F i l e . s c a l a : 2 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . D F D L S c h e m a F i l e . i i X M L S c h e m a D o c u m e n t ( D F D L S c h e m a F i l e . s c a l a : 2 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I m p o r t . $ a n o n f u n $ m a p P a i r $ 3 ( I m p o r t . s c a l a : 6 8 ) < b r / > a t s c a l a . O p t i o n . g e t O r E l s e ( O p t i o n . s c a l a : 1 8 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I m p o r t . $ a n o n f u n $ m a p P a i r $ 1 ( I m p o r t . s c a l a : 4 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y $ l z y c o m p u t e ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . l i f t e d T r e e 1 $ 1 ( O O L A G . s c a l a : 7 0 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y $ l z y c o m p u t e ( O O L A G . s c a l a : 7 0 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y ( O O L A G . s c a l a : 6 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e $ l z y c o m p u t e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I m p o r t . m a p P a i r $ l z y c o m p u t e ( I m p o r t . s c a l a : 4 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I m p o r t . m a p P a i r ( I m p o r t . s c a l a : 4 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . $ a n o n f u n $ n o t S e e n T h i s B e f o r e $ 1 ( I I B a s e . s c a l a : 1 4 9 ) < b r / > a t s c a l a . r u n t i m e . j a v a 8 . J F u n c t i o n 0 $ m c Z $ s p . a p p l y ( J F u n c t i o n 0 $ m c Z $ s p . j a v a : 2 3 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y $ l z y c o m p u t e ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . l i f t e d T r e e 1 $ 1 ( O O L A G . s c a l a : 7 0 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y $ l z y c o m p u t e ( O O L A G . s c a l a : 7 0 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y ( O O L A G . s c a l a : 6 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e $ l z y c o m p u t e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . n o t S e e n T h i s B e f o r e $ l z y c o m p u t e ( I I B a s e . s c a l a : 1 4 8 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . n o t S e e n T h i s B e f o r e ( I I B a s e . s c a l a : 1 4 8 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . $ a n o n f u n $ i i S c h e m a F i l e M a y b e $ 1 ( I I B a s e . s c a l a : 2 5 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y $ l z y c o m p u t e ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . l i f t e d T r e e 1 $ 1 ( O O L A G . s c a l a : 7 0 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y $ l z y c o m p u t e ( O O L A G . s c a l a : 7 0 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y ( O O L A G . s c a l a : 6 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e $ l z y c o m p u t e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . i i S c h e m a F i l e M a y b e $ l z y c o m p u t e ( I I B a s e . s c a l a : 2 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . i i S c h e m a F i l e M a y b e ( I I B a s e . s c a l a : 2 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . $ a n o n f u n $ s e e n A f t e r $ 1 ( I I B a s e . s c a l a : 1 7 8 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y $ l z y c o m p u t e ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . l i f t e d T r e e 1 $ 1 ( O O L A G . s c a l a : 7 0 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y $ l z y c o m p u t e ( O O L A G . s c a l a : 7 0 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y ( O O L A G . s c a l a : 6 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e $ l z y c o m p u t e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . s e e n A f t e r $ l z y c o m p u t e ( I I B a s e . s c a l a : 1 7 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . I I B a s e . s e e n A f t e r ( I I B a s e . s c a l a : 1 7 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . $ a n o n f u n $ g e t I m p o r t s O r I n c l u d e s $ 1 ( S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . s c a l a : 2 1 4 ) < b r / > a t s c a l a . c o l l e c t i o n . T r a v e r s a b l e O n c e $ f o l d e r $ 1 . a p p l y ( T r a v e r s a b l e O n c e . s c a l a : 1 9 6 ) < b r / > a t s c a l a . c o l l e c t i o n . T r a v e r s a b l e O n c e $ f o l d e r $ 1 . a p p l y ( T r a v e r s a b l e O n c e . s c a l a : 1 9 4 ) < b r / > a t s c a l a . c o l l e c t i o n . I t e r a t o r . f o r e a c h ( I t e r a t o r . s c a l a : 9 4 3 ) < b r / > a t s c a l a . c o l l e c t i o n . I t e r a t o r . f o r e a c h $ ( I t e r a t o r . s c a l a : 9 4 3 ) < b r / > a t s c a l a . c o l l e c t i o n . A b s t r a c t I t e r a t o r . f o r e a c h ( I t e r a t o r . s c a l a : 1 4 3 1 ) < b r / > a t s c a l a . c o l l e c t i o n . I t e r a b l e L i k e . f o r e a c h ( I t e r a b l e L i k e . s c a l a : 7 4 ) < b r / > a t s c a l a . c o l l e c t i o n . I t e r a b l e L i k e . f o r e a c h $ ( I t e r a b l e L i k e . s c a l a : 7 3 ) < b r / > a t s c a l a . c o l l e c t i o n . A b s t r a c t I t e r a b l e . f o r e a c h ( I t e r a b l e . s c a l a : 5 6 ) < b r / > a t s c a l a . c o l l e c t i o n . T r a v e r s a b l e O n c e . f o l d L e f t ( T r a v e r s a b l e O n c e . s c a l a : 1 9 9 ) < b r / > a t s c a l a . c o l l e c t i o n . T r a v e r s a b l e O n c e . f o l d L e f t $ ( T r a v e r s a b l e O n c e . s c a l a : 1 9 2 ) < b r / > a t s c a l a . c o l l e c t i o n . A b s t r a c t T r a v e r s a b l e . f o l d L e f t ( T r a v e r s a b l e . s c a l a : 1 0 8 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . g e t I m p o r t s O r I n c l u d e s ( S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . s c a l a : 2 1 1 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . g e t I m p o r t s O r I n c l u d e s $ ( S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . s c a l a : 2 0 6 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . X M L S c h e m a D o c u m e n t . g e t I m p o r t s O r I n c l u d e s ( S c h e m a D o c u m e n t . s c a l a : 6 8 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . $ a n o n f u n $ i s m l i _ $ 1 ( S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . s c a l a : 2 2 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y $ l z y c o m p u t e ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . b o d y ( O O L A G . s c a l a : 5 2 0 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . l i f t e d T r e e 1 $ 1 ( O O L A G . s c a l a : 7 0 7 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y $ l z y c o m p u t e ( O O L A G . s c a l a : 7 0 5 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e B a s e . v a l u e A s A n y ( O O L A G . s c a l a : 6 9 9 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e $ l z y c o m p u t e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . l i b . o o l a g . O O L A G $ O O L A G V a l u e . v a l u e ( O O L A G . s c a l a : 7 5 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . o r g $ a p a c h e $ d a f f o d i l $ c o r e $ d s o m $ S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n $ $ i s m l i _ ( S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . s c a l a : 2 2 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . o r g $ a p a c h e $ d a f f o d i l $ c o r e $ d s o m $ S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n $ $ i s m l i _ $ ( S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n . s c a l a : 2 2 4 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . X M L S c h e m a D o c u m e n t . o r g $ a p a c h e $ d a f f o d i l $ c o r e $ d s o m $ S c h e m a D o c I n c l u d e s A n d I m p o r t s M i x i n $ $ i s m l i _ $ l z y c o m p u t e ( S c h e m a D o c u m e n t . s c a l a : 6 8 ) < b r / > a t o r g . a p a c h e . d a f f o d i l . c o r e . d s o m . X M L S c h e m a D o c u m e n t . o r g $ a p a c h e $ d a ffodil$core$dsom$SchemaDocIncludesAndImportsMixin$$ismli_(SchemaDocument.scala:68)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.importStatementsMap(SchemaDocIncludesAndImportsMixin.scala:222)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.importStatementsMap$(SchemaDocIncludesAndImportsMixin.scala:222)
at org.apache.daffodil.core.dsom.XMLSchemaDocument.importStatementsMap(SchemaDocument.scala:68)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.$anonfun$sali_$1(SchemaDocIncludesAndImportsMixin.scala:232)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.body$lzycompute(OOLAG.scala:520)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.body(OOLAG.scala:520)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:707)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:705)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:699)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:754)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:754)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.org$apache$daffodil$core$dsom$SchemaDocIncludesAndImportsMixin$$sali_(SchemaDocIncludesAndImportsMixin.scala:231)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.org$apache$daffodil$core$dsom$SchemaDocIncludesAndImportsMixin$$sali_$(SchemaDocIncludesAndImportsMixin.scala:231)
at org.apache.daffodil.core.dsom.XMLSchemaDocument.org$apache$daffodil$core$dsom$SchemaDocIncludesAndImportsMixin$$sali_$lzycompute(SchemaDocument.scala:68)
at org.apache.daffodil.core.dsom.XMLSchemaDocument.org$apache$daffodil$core$dsom$SchemaDocIncludesAndImportsMixin$$sali_(SchemaDocument.scala:68)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.seenAfter(SchemaDocIncludesAndImportsMixin.scala:229)
at org.apache.daffodil.core.dsom.SchemaDocIncludesAndImportsMixin.seenAfter$(SchemaDocIncludesAndImportsMixin.scala:229)
at org.apache.daffodil.core.dsom.XMLSchemaDocument.seenAfter(SchemaDocument.scala:68)
at org.apache.daffodil.core.dsom.SchemaSetIncludesAndImportsMixin.$anonfun$allSchemaFiles$1(SchemaSetIncludesAndImportsMixins.scala:66)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.body$lzycompute(OOLAG.scala:520)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.body(OOLAG.scala:520)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.liftedTree1$1(OOLAG.scala:707)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.valueAsAny$lzycompute(OOLAG.scala:705)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValueBase.valueAsAny(OOLAG.scala:699)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValue.value$lzycompute(OOLAG.scala:754)
at org.apache.daffodil.lib.oolag.OOLAG$OOLAGValue.value(OOLAG.scala:754)
at org.apache.daffodil.core.dsom.SchemaSetIncludesAndImportsMixin.allSchemaFiles(SchemaSetIncludesAndImportsMixins.scala:64)
at org.apache.daffodil.core.dsom.SchemaSetIncludesAndImportsMixin.allSchemaFiles$(SchemaSetIncludesAndImportsMixins.scala:64)
at org.apache.daffodil.core.dsom.SchemaSet.allSchemaFiles$lzycompute(SchemaSet.scala:92)
at org.apache.daffodil.core.dsom.SchemaSet.allSchemaFiles(SchemaSet.scala:92)
at org.apache.daffodil.core.dsom.SchemaSet.$anonfun$isValid$2(SchemaSet.scala:181)
at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:23)
at org.apache.daffodil.lib.oolag.OOLAG$.keepGoing(OOLAG.scala:65)
at org.apache.daffodil.core.dsom.SchemaSet.isValid$lzycompute(SchemaSet.scala:180)
at org.apache.daffodil.core.dsom.SchemaSet.isValid(SchemaSet.scala:172)
at org.apache.daffodil.core.dsom.SchemaSet.isError$lzycompute(SchemaSet.scala:567)
at org.apache.daffodil.core.dsom.SchemaSet.isError(SchemaSet.scala:566)
at org.apache.daffodil.core.compiler.ProcessorFactory.isError$lzycompute(Compiler.scala:147)
at org.apache.daffodil.core.compiler.ProcessorFactory.isError(Compiler.scala:147)
at org.apache.daffodil.core.compiler.Compiler$.org$apache$daffodil$core$compiler$Compiler$$compileSourceSynchronizer(Compiler.scala:426)
at org.apache.daffodil.core.compiler.Compiler.compileSource(Compiler.scala:359)
at org.apache.daffodil.japi.Compiler.compileSource(Daffodil.scala:170)
at org.apache.daffodil.japi.Compiler.compileSource(Daffodil.scala:156)
at org.acme.HelloWorld.start(HelloWorld.java:72)
< /code>
На первый взгляд, кажется, что этот файл xsd не включен в нативный исполняемый файл. < /p>
Чтобы проверить это, я добавил некоторые Код в класс Helloworld, который стимулируется свойством, предоставленным нативным исполняемом файлу: -Dtest.file.toload =/org/apache/daffodil/xsd/xmlschema_for_dfdl.xsd.
Этот кодовый блок просто открывает файл, приведенный в качестве свойства, и печатает его контент в текстовый файл, расположенный в каталоге выполнения. Это работает так, как предполагалось, а URI точно так же, как и то, что мы можем увидеть в ошибке, которую брошен нарциссом. < /P>
Я не могу понять, почему я могу открыть файл через класс Helloworld, но классы нарциссов не являются. Чтение.

Подробнее здесь: https://stackoverflow.com/questions/794 ... cutable-pr

Вернуться в «JAVA»