Issue Details (XML | Word | Printable)

Key: IDE-278
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Minor Minor
Assignee: Christian Dupuis
Reporter: Imported
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring IDE

Spring IDE does not resolve imports from other jars

Created: 04/Apr/06 03:01 AM   Updated: 10/Jan/08 11:00 PM
Component/s: beans.core
Affects Version/s: 1.2.5
Fix Version/s: 2.0.3

Time Tracking:
Not Specified


 Description  « Hide
I have a jar project (A) with a spring configuration which imports another spring configuration file in another jar project (B). The ide doesnt resolve the imported resource even though its on A's class path. I am using Rational Application Developer which is built on Eclipse 3.0.1.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Christian Dupuis added a comment - 04/Apr/06 04:22 PM
Spring IDE does not support the
<import
tag. This is due to classloading restrictions within Eclipse.

Have you tried configuring the BeansConfigSet containing both Spring configuration files?




Torsten Juergeleit added a comment - 06/Apr/06 02:26 AM
What do you mean by "spring ide is still not able to resolve it"?
Do you mean the <import> tag isn't resolved then this is correct because Spring IDE doesn't support this tag. You have to use project references and a BeansConfigSet here (please refer to the wiki:SpringideGuide#AddreferencestootherSpringprojectsoptional Spring IDE Guide on how to do this).
Or do you mean the BeansConfigValidator complains about unresolved bean references?

Please elaborate on the topic "The ide doesnt resolve the imported resource". What should Spring IDE do here?


Christian Dupuis added a comment - 06/Apr/06 09:53 AM
Let me give an example setup:
Config file "mainContext.xml" in jar A.
Config file "dependentContext.xml" in jar B.
Both jars are spring enabled and all the config files are added to the
spring file list.
Jar B has a config set which contains mainContext.xml from jar A.

The file dependentContext.xml contains the following import:

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

Now springIDE reports an error next to the import tag saying it cant
resolve that file:

Here is my .springBeans file on Jar B.

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<beansProjectDescription>
   <configs>
     <config>src/dependentContext.xml</config>
   </configs>
   <configSets>
     <configSet>
        <name>mainConfigSet</name>
        <allowBeanDefinitionOverriding>false</allowBeanDefinitionOverriding>
        <incomplete>true</incomplete>
        <configs>
           <config>/A/src/mainContext.xml</config>
        </configs>
    </configSet>
   </configSets>
</beansProjectDescription>

Am I missing any step here ?

thanks,
sreeni


Torsten Juergeleit added a comment - 06/Apr/06 06:45 PM
Sreeni,

in your example you should create in Jar B a BeansConfigSet containing the externally referenced "/A/src/mainContext.xml" '''and''' the local "src/dependentContext.xml".

This way the BeansConfigValidator knows about the dependency of "src/dependentContext.xml" from "/A/src/mainContext.xml" and creates internally a !BeanFactory with all beans defined in both config files. This !BeanFactory will be used for validation.

If all bean references are solved by including both config files into the BeansConfigSet then you can deselect the checkbox "Is incomplete".

Torsten

PS Please don't reply on mails sent from the bug tracker. Instead enter your anwser as a comment to the corresponding ticket.



Christian Dupuis added a comment - 10/Jan/08 11:00 PM
This will now be covered in IDE-653