Skip Headers

# Packaging With TopLink Metadata File Resource Paths

Previous

Next

If you do not store the `project.xml` or `sessions.xml` files at the root of the JAR file, then you must provide the full resource path to the files when accessing them. Ensure that you use "`/`" in resources paths, not "`\`". Using "`\`" will not work in Java.

For example, in the `jar` element, reference the `project.xml` and `sessions.xml` files as follows:

    <jar>/myapp/ordersys/persist/sessions.xml
    <jar>/myapp/ordersys/persist/project.xml

In the `sessions.xml` file, reference the `project.xml` as follows:

    myapp/ordersys/persist/project.xml

To acquire the session, use the following:

    SessionManager.getManager().getSession(
        new XMLSessionConfigLoader("myapp/ordersys/persist/sessions.xml"),
        "OrdersysSession",
        getClass().getClassLoader()
    );

For more information about acquiring sessions at run time, see "Acquiring a Session From the Session Manager".