Followers

Friday, 30 March 2012

Spring Intergration to Eclipse IDE


Now that we have downloaded Spring Framework, we will see how to integrate it with Eclipse IDE.
Eclipse IDE by default is just a platform for development, which doesn’t carry all the JEE features required. It doesn’t ship with support for Spring Framework as you would know by now. So we will see how to integrate Spring Framework with Eclipse IDE using a standard plugin available called SpringIDE. Eclipse IDE is available in different releases, and these steps are almost similar to all of them. This post demonstrates using Eclipse Galileo (Eclipse version 3.5.0 release). If you have any doubts related to Eclipse IDE releases or its download / installation / configuration, refer to Eclipse IDE Installation & Configuration post.

What is Spring IDE
SpringIDE provides a user interface for Spring configuration files, built as a set of plugins on the Eclipse platform. It is a set of free plugins for the Eclipse platform that helps in developing Spring Application. The IDE provides a wizard for creating Spring projects, and using the Graphical Editing Framework, displays graphs of all beans (objects) and relationships either within a single configuration file or within a set of configuration files. The files, or sets, are also validated as they are added / modified. There’s also support for Spring AOP, so pointcut expressions are validated in your Spring configuration. 
Spring IDE (http://www.springsource.com/products/springide) is a product from Spring Source (http://www.springsource.com/). Refer to Spring Primer for details. Latest SpringIDE version avaiable is 2.0.3.

Follow the steps below: 
  • Once Eclipse is up and running, use the Eclipse Software Update wizard either by navigating to Help->Install New Software (Eclipse 3.5 onwards) or Help->Software Updates (prior to Eclispe 3.5 version) as shown below: 

 or


 
or 
 

  •  For Eclipse versions 3.5 and above, click on Add button shown and then you will get the Add Site wizard. Enter the name as Spring IDE or likewise for your reference later and click ok as shown below:

  • Select all the Spring IDE features and click Next or Install for Eclipse 3.5 version onwards and Eclipse prior to this version respectively as shown below:

 or 

  • In case you don’t get any error by now, you will be presented with a License Agreement wizard. Select ‘I Accept the terms of the license agreement’ and click ‘Finish’. By doing this, Spring IDE plugin should be installed and integrated in your Eclipse IDE successfully as shown below:


  •   Restart Eclipse IDE as prompted and you should be ready to use Spring IDE:

  
  • After Eclipse restarts, we need to verify whether the plugin got installed successfully. We will do this by first choosing the Windows menu and the Preferences option of Eclipse.
 

  • We can then see Spring option in the left hand side item nodes in the preferences dialog. Choose the Spring option and it will expand to show three sub items.
     - AOP Support
    -  Beans Support
     - Web Flow Support
  • This confirms that our Spring IDE plugin has been installed successfully in Eclipse.
  
  
  
  
Troubleshooting Installation & Integration:
If you have any problems while installing as per above steps and get any error message in Eclipse IDE, read through the error message and don’t hesitate to uncheck that perticular plugin in the list where you have a problem (provided its optional). You can always install the plugin manually anytime again.
For example:
When you click on Next / Install after chosing the plugins you want to install, you might get an error message saying:
Cannot complete the install because one or more required items could not be found.  Software being installed: Spring IDE AJDT Integration (optional) 2.2.8.200911091054-RELEASE
In this case, as AJDT (AspectJ Development Tools) integration plugin is an optional update and if you have trouble installing it while updating the entire Spring Framework plugin, you can uncheck this plugin from the displayed list and continue to install other updates.  You can always install the plugin manually anytime again.


After doing so, and clicking on ‘Next’, you should do away with the error message and be presented with the License Agreement wizard upon selecting which your installation should be complete.

No comments:

Post a Comment