Hi Steve,

well if that's the case, then I am having trouble doing this.

So In this case I have a base schema in "base.jar" and I add a dependency to 
this in "protocol" module.
If I try to use it I get an error message that daffodil has found something but 
it unable to open it.

[ERROR] getTestsuiteTests[40]  Time elapsed: 0.013 s  <<< ERROR!
org.apache.daffodil.exceptions.Abort: 
Invariant broken. Unexpected exception type 
org.apache.daffodil.exceptions.Abort: Invariant broken. found resource but 
couldn't open
org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:175)
org.apache.daffodil.xml.DFDLCatalogResolver.resolveResource(DaffodilXMLLoader.scala:244)
org.apache.xerces.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source)
org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
org.apache.daffodil.exceptions.Assert$.invariantFailed(Assert.scala:175)
org.apache.daffodil.dsom.DFDLSchemaFile.$anonfun$iiXMLSchemaDocument$1(DFDLSchemaFile.scala:155)
org.apache.daffodil.oolag.OOLAG$OOLAGValue.liftedTree1$1(OOLAG.scala:585)
        at 
org.apache.plc4x.protocols.AbstractProtocolTest.lambda$getTestsuiteTests$0(AbstractProtocolTest.java:54)


Chris



Am 09.05.19, 13:25 schrieb "Steve Lawrence" <[email protected]>:

    You should be able to import/include files in jars on the classpath
    using the full path inside the jar, i.e. what "jar -jt foo.jar" outputs.
    So if foo.jar was on your classpath and contained the following
    
      $ jar -jt foo.jar
      META-INF/MANIFEST.MF
      com/foo/dfdl/types.dfdl.xsd
    
    Your schema could reference the types.dfdl.xsd file with:
    
      <xs:include schemaLocation="com/foo/dfdl/types.dfdl.xsd" />
    
    You don't need to specify  which jar to import from or even that the
    file comes from a jar. Daffodil will just search for that path in all
    jars on the classpath.
    
    - Steve
    
    
    On 5/9/19 6:19 AM, Christofer Dutz wrote:
    > Hi all,
    > 
    > after solving my last problem, I am stuck with another one … as I 
mentioned in 
    > the other thread I have one DFDL schema, which defines all the simple 
types that 
    > will be used by any PLC4X schema.
    > 
    > In order to do so, this is located in a dedicated maven module and a 
dedicated jar.
    > 
    > Now I added a dependency to that jar an now want to reference this in my 
    > protocol jar.
    > 
    > No matter what I try, DFDL always complains about not being able to 
resolve this.
    > 
    > So how can I reference and/or import schemas contained in another jar 
that’s in 
    > my classpath?
    > 
    > Chris
    > 
    
    

Reply via email to