Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
property-placeholder location in other bundle Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • property-placeholder location in other bundle

    I have two bundles A and B, where B contains a properties file at de/linsin/sample/test.properties. The package de/linsin/sample is exported. Bundle A imports package de/linsin/sample and tries to use the test.properties file in ins applicationContext.xml when Equinox starts the context like this:

    Code:
    <context:property-placeholder location="classpath:de/linsin/sample/test.properties"/>
    Unfortunately I get the following Exception (stack trace shortened):

    Code:
    Caused by: java.io.FileNotFoundException: OSGi resource[classpath:de/linsin/sample/test.properties|bnd.id=23|bnd.sym=de.linsin.sample.A] cannot be resolved to URL because it does not exist
    I tried variations like classpath* or bundleentry but they don't work either. Any idea how to load properties from another bundle?

  • #2
    Well, it definitely should work the way you describe it.
    I would suggest to check your packaging and make sure that the property file does make its way into the bundle.
    I was able to replicate your scenario and the only way I can force the aforementioned exception if the properties file is not there or if package is not imported.

    Comment


    • #3
      Hi Oleg,

      thanks for your reply, after re-checking I found the mistake: as you suggested the package was not properly imported.

      Comment

      Working...
      X