Announcement Announcement Module
Collapse
No announcement yet.
Spring IDE and PropertyPlaceholderConfigurer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring IDE and PropertyPlaceholderConfigurer

    We extend PropertyPlaceholderConfigurer to provide environment specific (D, Q, P) properties, but the Spring IDE seems to choke on lines like this:

    <constructor-arg index="0">
    <ref bean="${dataSourceBeanId}"/>
    </constructor-arg>

    It doesn't seem to understand the ${bla} notation for property placeholders. Am I missing something, or am I stuck with red X's every time I use a property value?

    Thanks,
    Dan

  • #2
    Hello dan,

    thanks for your report. I've entered a ticket at http://springide.org/project/ticket/33 . With version http://springide.org/project/changeset/299 I've just commited a small change which now checks if an invalid bean reference is caused by an property placeholder. If yes the validator creates a warning insteed of an error.

    Hope that works for you.

    Geetings
    Christian

    Comment


    • #3
      Spring IDE's validator isn't able to create a "real" BeanFactory with all it's bells and whistles, e.g. auto-wiring or PlaceholderConfigurer. This is because it lives within it's own little world of an Eclipse plugin. It is isolated by it's own Eclipse plugin class loader and doesn't know about all the fancy stuff which is feasible with the Spring framework ;-).

      Meaning Spring IDE isn't able to instantiate any bean class defined in a Spring project's config file. So Spring IDE's validator is only able to create a "lightweight" version of a Spring BeanFactory holding bean descriptions (aka RootBeanDefinition or ChildBeanDefinition). Auto-wiring or PlaceholderConfigurer magic isn't feasable due to classloader restrictions. It makes no sense to fire-up a full-blown BeanFactory (which may contain e.g. JNDI lookups for Stateless EJBs or DataSources) only for validation purposes.

      Sorry, we can only provide the workaround which Christian already implemented.

      Cheers,
      Torsten

      Comment


      • #4
        Thanks!

        No problem. I understand the limitations, and I'm impressed with how quickly you responded! Having that be a warning is very workable.

        Comment

        Working...
        X