Hi again,

I'm trying to package my Castor interface as a JAR package, so that several
"client" applications can use my object models to access our database. Ideally,
there would be no need for each application to have a local copy of the mapping
file -- that would be obtained directly from the JAR and hence be automatically
in sync with the model.

I'm not sure how to get hold of the mapping file from within a JAR file,
though. Just trying

public class XMLUtil {
...
public static Mapping getMapping() {
    Mapping mapping = new Mapping();
    try {
        mapping.loadMapping("hdom-xml-map.xml");
    ...
    }
    return mapping;
}

doesn't work either when building the JAR (I'm using Maven, so have to use
"mapping.loadMapping("target/classes/hdom-xml-map.xml");" --- the classes
directory isn't automatically checked) nor when calling XMLUtil.getMapping()
from a client application. I've had a go at using
XMLUtil.class.getResource("hdom-xml-map.xml") but that just returns null, even
though the file I'm looking for is in that JAR:

[EMAIL PROTECTED]:~/.../hepdata-migration$ jar tf
/mt/home/buckley/.m2/repository/cedar/hepdata/hepdata-xml/1.0-SNAPSHOT/hepdata-xml-1.0-20061213.131638-7.jar
META-INF/
META-INF/MANIFEST.MF
cedar/
cedar/hepdata/
cedar/hepdata/xml/
hdom-xml-map.xml
cedar/hepdata/xml/XMLUtil.class
...

Any suggestions?

Andy

-- 
Andy Buckley: CEDAR @ IPPP, Durham
Work: www.cedar.ac.uk
www.insectnation.org

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to