Tuesday, June 28, 2011

SPRING - Installing Spring IDE in Eclipse Ganymede 3.4.2



Steps to install Spring IDE in eclipse ganymede 3.4.2

After some long struggle, I identified a way to install to the Spring IDE for Eclipse Ganymede 3.4.2. Hope it is useful for whoever faces issues in installing the plugin.


  1. Go to Help -> Software Updates -> Available Softwares
  2. Click on Add Site and add this URL http://dist.springframework.org/release/IDE
  3. Uncheck the Spring IDE Mylyn Integration related entries.
  4. Click Install and Accept the terms and conditions
  5. Restart Eclipse once the installation is complete.

TroubleShooting Tips

If you face issues in completing the installation, follow the below steps and then repeat the above steps again.
  1. Go to Help -> Software Updates -> Available Softwares
  2. Click on Manage Sites button and make sure the following are selected.




How to install Hibernate IDE in Eclipse Ganymede 3.4.2? 

Installing Hibernate IDE for Eclipse

MULE - Using the Mule Data Integrator













Steps to use the Mule Data Integrator

1. Install the MDI plugin version 3.1.6 for eclipse.

The MDI designer is distributed though an Eclipse update site: http://www.mulesoft.com/eclipse-updates/mule-data-integrator/.

2. Install the mule MDI runtime for Mule 2.2.1 version in MULE_HOME


3. The MDI runtime that was installed on Step 2, should be having a version greater than or equal to the eclipse MDI plug-in installed on Step 1.

4. Ensure that the saaj module is installed. If not follow the steps provided on the below website to install them.

This is used for transforming the SOAP request to XML and XML back to SOAP request while using an http based inbound endpoint.

5. Use the Soap UI project to test the service.

SPRING - How to obtain Spring Releases from Maven

The following dependencies provides the artifacts that has to be added to your pom.xml for including the SPRING Framework packages.


<!--
Core utilities used by other modules. Define this if you use Spring
Utility APIs (org.springframework.core.*/org.springframework.util.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Expression Language (depends on spring-core) Define this if you use
Spring Expression APIs (org.springframework.expression.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Bean Factory and JavaBeans utilities (depends on spring-core) Define
this if you use Spring Bean APIs (org.springframework.beans.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Aspect Oriented Programming (AOP) Framework (depends on spring-core,
spring-beans) Define this if you use Spring AOP APIs
(org.springframework.aop.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Application Context (depends on spring-core, spring-expression,
spring-aop, spring-beans) This is the central artifact for Spring's
Dependency Injection Container and is generally always defined
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Various Application Context utilities, including EhCache, JavaMail,
Quartz, and Freemarker integration Define this if you need any of
these integrations
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Transaction Management Abstraction (depends on spring-core,
spring-beans, spring-aop, spring-context) Define this if you use
Spring Transactions or DAO Exception Hierarchy
(org.springframework.transaction.*/org.springframework.dao.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
JDBC Data Access Library (depends on spring-core, spring-beans,
spring-context, spring-tx) Define this if you use Spring's
JdbcTemplate API (org.springframework.jdbc.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Object-to-Relation-Mapping (ORM) integration with Hibernate, JPA, and
iBatis. (depends on spring-core, spring-beans, spring-context,
spring-tx) Define this if you need ORM (org.springframework.orm.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Object-to-XML Mapping (OXM) abstraction and integration with JAXB,
JiBX, Castor, XStream, and XML Beans. (depends on spring-core,
spring-beans, spring-context) Define this if you need OXM
(org.springframework.oxm.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Web application development utilities applicable to both Servlet and
Portlet Environments (depends on spring-core, spring-beans,
spring-context) Define this if you use Spring MVC, or wish to use
Struts, JSF, or another web framework with Spring
(org.springframework.web.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Spring MVC for Servlet Environments (depends on spring-core,
spring-beans, spring-context, spring-web) Define this if you use
Spring MVC with a Servlet Container such as Apache Tomcat
(org.springframework.web.servlet.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Spring MVC for Portlet Environments (depends on spring-core,
spring-beans, spring-context, spring-web) Define this if you use
Spring MVC with a Portlet Container
(org.springframework.web.portlet.*)
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc-portlet</artifactId>
<version>${org.springframework.version}</version>
</dependency>

<!--
Support for testing Spring applications with tools such as JUnit and
TestNG This artifact is generally always defined with a 'test' scope
for the integration testing framework and unit testing stubs
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
<scope>test</scope>
</dependency>


<properties>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>

SPRING & MAVEN - Converting a Maven Webapp Project to work with Eclipse WTP Plugin

Steps

1. Create a maven-archetype-webapp project in eclipse.
2. Open Command prompt and go to project folder
3. Open the command prompt and go to project location

>cd c:\webprojects\MyPortal

4. Make sure the following environment variables are set in the command prompt.

4. Run the following two commands

>mvn eclipse:clean

>mvn eclipse:eclipse clean

This would remove the .project, .classpath settings

5. Run the command
>mvn eclipse:eclipse -Dwtpversion=2.0

This would create project facets for eclipse WTP plugin.

6. Refresh the project in eclipse
  • Update the Project Facets to use the latest JDK. By default the JDK 1.4 would be selected. It has to be updated to use a JDK version higher than JDK 1.4

7. Right Click Project -> Maven -> Disable Dependency Management.
8. Right Click Project -> Maven -> Enable Dependency Management.

This would enable Maven Dependencies to your project.

9. To add the Maven dependencies to the runtime environment (since they don't reside on WEB-INF/lib folder), Go to Project Properties, click on Java EE Module Dependencies and check the Maven Dependencies and click on Apply.


10. Include the Apache Runtime libraries to your classpath, Go to Project Build Path, in Libraries tab, click on Add Library, and then select Server Runtime and select Apache Tomcat.

If the Apache Tomcat server is not displayed in the selection pane, Create the Apache Server instance in Eclipse Servers tab and repeat the last procedure.

11. Replace the contents of  web.xml with the following details. This provides more schema details to the web-app root element.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
id="WebApp_ID" version="2.5">
</web-app>

With this your workspace is mavenized and ready to be running using the Eclipse WTP Plugin.