Results 1 to 4 of 4

Thread: Initialising resource from relative filename

  1. #1
    Join Date
    Aug 2004
    Posts
    16

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    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

  3. #3
    Join Date
    Aug 2004
    Posts
    16

    Default

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

  4. #4
    Join Date
    Aug 2004
    Posts
    16

    Default

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

Similar Threads

  1. Replies: 6
    Last Post: Feb 23rd, 2010, 02:40 PM
  2. Replies: 4
    Last Post: May 2nd, 2007, 08:55 PM
  3. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  4. Replies: 2
    Last Post: Jul 21st, 2005, 04:07 AM
  5. Quartz problem
    By khem in forum Web
    Replies: 4
    Last Post: Aug 17th, 2004, 02:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •