Menu

Packaging files-core and files-fpml to a jar

Help
2012-03-03
2013-01-02
  • Gary Kennedy

    Gary Kennedy - 2012-03-03

    Nice library.
    I am still learning how to use the library, but i keep hitting a problem which
    i am sure is a silly mistake on my part.
    I tried to tar up the files-core and files-fpml folders (removing files-
    fpml/examples and files-fpml/test-cases to reduce size), so that my
    application would simply rely upon handcoded.jar and handcode-resources.jar.
    When i try to make the demo example validate work, i keep getting the error
    below.
    The error does not occur when the files-core and files-fpml are folder in my
    eclipse project.
    Any ideas?

    Gary

    03-Mar-2012 12:32:25 com.handcoded.xml.resolver.Catalog <init>
    INFO: Creating catalog 'files-fpml/catalog-fpml-5-2.xml'
    03-Mar-2012 12:32:25 com.handcoded.meta.Specification <clinit>
    INFO: Bootstrapping Specifications
    03-Mar-2012 12:32:28 com.handcoded.meta.Specification <clinit>
    INFO: Completed
    03-Mar-2012 12:32:28 com.handcoded.xml.resolver.Catalog <init>
    INFO: Creating catalog 'files-fpml/catalog-fpml.xml'
    03-Mar-2012 12:32:28 com.handcoded.xml.SchemaSet getSchema
    SEVERE: Unexpected SAX Exception
    org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'Document'
    to a(n) 'type definition' component.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
    Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown
    Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown
    Source)
    at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseNamedEleme
    nt(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseGlobal(Unk
    nown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseSchemas(Unknown
    Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
    at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown
    Source)
    at com.handcoded.xml.SchemaSet.getSchema(SchemaSet.java:119)

     
    • Abhijit Patharkar

      Hello Gary,

      Im also facing the same exact issue.

      Can you tell me how was your approach to tackle this problem.

      Regards,
      Abhijit

       
      • Gary Kennedy

        Gary Kennedy - 2012-12-29

        I did not get it to work after several attempts. I switched to use xmlbeans to get some basic interaction with FpML, however I will try again soon. I am sure it is something silly, but I just ran out of time.

        gary

         
  • Andrew Jacobs

    Andrew Jacobs - 2012-03-04

    I created 'an all in one' JAR version for a previous version. The code will
    attempt to locate schemas and other data files from the JAR if they are not
    found in the local file system (see Application.openStream). I haven't
    rechecked this with the latest release recently.

    The only other magic incantation needed is that you need to define the XML
    catalog as a JAR file like this:

    java -cp HandCoded.jar;xml-apis.jar;xercesImpl.jar
    demo.com.handcoded.fpml.Validate -catalog jar:file:HandCoded.jar!/files
    /catalog-fpml.xml -schemaOnly examples

     
  • Gary Kennedy

    Gary Kennedy - 2013-01-02

    The changes at revision 706 have done the trick, schema files can be packed into a jar for deployment. Yippee!!!

    One minor change I made to the build file demo target in previous post, I changed the schemaOnly argument to look at the local files which I think is OK for the demo code.

    arg value="${basedir}/files-fpml/examples/fpml5-4/confirmation"

    instead of

    arg value="files-fpml/examples/fpml5-4/confirmation"

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.