Announcement Announcement Module
No announcement yet.
Use imports with multiple projects Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Use imports with multiple projects

    I have (at least) two projects that have spring bean files. proj2 is dependent on proj1.



    clientResources.xml is:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "">

    <beans default-autowire="no" >
    <import resource="clientCacheManager.xml"/>

    I get an error: "Invalid relative resource location 'clientCacheManager.xml'.

    I understand why the error is occuring in Spring-IDE, but is there a way to turn it off? Or better yet, is there a way to resolve the error?

    Thanks. I am using Eclipse 3.3M3, but this occurs in Eclipse 3.2.1 also.

  • #2
    Follow these steps:

    1. Manage your project dependencies (project1 denpends on project 2 ...)
    2. Make all of your projects Spring IDE Enabled (Add Spring Nature)
    3. Add Config files in all projects to the Spring configuration
    4. Create a config Set with all of the spring config files you have configured in step 3. (here you see also config files from other projects)

    Hope that helps.



    • #3
      Re: Use imports with multiple projects

      I added the config set. My beans in the config set in proj2 are:


      I tried changing the imports, but couldn't get it to work.
      <import resource="clientCacheManager.xml"/>
      <import resource="/proj1/resources/clientCacheManager.xml"/>
      <import resource="proj1/resources/clientCacheManager.xml"/>
      <import resource="/resources/clientCacheManager.xml"/>
      <import resource="resources/clientCacheManager.xml"/>

      In my SpringBean's window under the Config Set is an error:
      "Invalid relative resource location 'clientCacheManager.xml' using the first import attempt.

      I also took a look at the FAQ: It gives the directions above. I did the test to verify my Builder was working, since it is set up by Maven. It is working.

      Again thanks for any help.
      Last edited by neilhart; Nov 16th, 2006, 04:57 PM.


      • #4
        Spring IDE's BeansConfigValidator does not check the classpath for imported files.

        I have opened a ticket for this issue.