Announcement Announcement Module
Collapse
No announcement yet.
Use imports with multiple projects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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.

    proj1
    /resources
    clientCacheManager.xml

    proj2
    /resources
    clientResources.xml

    clientResources.xml is:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

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


    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.

    Regards

    Comment


    • #3
      Re: Use imports with multiple projects

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

      /proj1/resources/clientCacheManager.xml
      resource/clientResources.xml

      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: http://springide.org/project/wiki/SpringideFaq#id11. 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.

      Comment


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

        I have opened a ticket for this issue.

        Torsten

        Comment

        Working...
        X