Announcement Announcement Module
Collapse
No announcement yet.
Initialising resource from relative filename Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Initialising resource from relative filename

    Basically, I need to initialise a LocalSessionFactoryBean using it's mappingJarLocations property. I find using a url of the file:// scheme works if I specify an absolute path to the jar. I need to specify a relative path though. I am unable to figure out what the pathname needs to be relative to to find the jar though. Can anyone help?
    Thanks in advance.

  • #2
    Simply use a relative path like "/WEB-INF/mypath": The application context will automatically convert this to a context-relative resource. In case of a web app (XmlWebApplicationContext), this will be relative to the web app root. In case of a standalone app, it will either be relative to the VM execution directory (FileSystemXmlApplicationContext) or relative to the classpath root (ClassPathXmlApplicationContext).

    Juergen

    Comment


    • #3
      And if I am using ContextSingletonBeanFactoryLocator to get a handle to the applicationcontext?

      Comment


      • #4
        Ahhh...solved it... it turns out the directory the jar is in should be on the classpath.
        8)

        Comment

        Working...
        X