Eclipse Con 2011 Tutorial #1987 Software Prereqs: Developing OSGi-enabled Java EE Applications using GlassFish
By arungupta on Mar 22, 2011
Sahoo and I are delivering a tutorial on Developing OSGi-enabled Java EE Applications using GlassFish at EclipseCon 2011 tomorrow.
Date ? Mar 23, Wednesday
Time ? 2 hrs starting at 3:50pm
Where ? Stevens Creek
This blog provides a complete list of software that needs to be downloaded and pre-installed in order to actually spend time on building the application during the lab.
Please install the software following the instructions below. The complete tutorial + a screencast showing all the instructions to build the application will be shared on this blog tomorrow.
Download and extract the source bundle for the tutorial from http://blogs.sun.com/arungupta/resource/osgi-gf-econ-2011.zip. Expanding the folder creates a directory “osgi-gf-econ-2011” with the following structure:
bin/ common/ parent-pom/ pom.xml simple_client/ simple_service/
The directory structure is explained later in the tutorial.
Download Java EE 6 Web Profile SDK Update 2 and Install
- If you have JDK 1.6.0 pre-installed on your machine then download the bundle “without JDK”.
- If not, then download the “with JDK” bundle.
Make sure GlassFish is installed in a directory with no white spaces in the directory name. Otherwise the web-based Admin Console may not function properly.
For convenience, make sure to include “glassfish3/bin” in the system PATH. This can be done using Control Panel in Windows and in a shell in Unix-flavored machines. Note, make sure that GlassFish is installed in a directory with no white spaces in the directory name.
Also set the environment variable JAVA_HOME to point to the location of the JDK installation and include $JAVA_HOME/bin in the system PATH. Note, this will be %JAVA_HOME%\\bin on Windows-based machines.
- Typically Java EE SDK installation starts the GlassFish server for you. However if it has not started then it can be started explicitly by giving the command
The “--verbose” switch may be specified on the command line to view the log output in the console otherwise the logs can be seen in the “glassfish3/glassfish/domains/domain1/logs/server.log” file. Visit “http://localhost:8080” to ensure that the server is up and running.
- Enable OSGi features in GlassFish by executing “config-gf-osgi.[bat|sh]” script in the “bin” directory of the source bundle extracted above.
- Start the database as “asadmin start-database” in a separate window.
- Download Eclipse Helios for Java EE Bundle and install.
- Install the m2eclipse "core" plug-in from http://m2eclipse.sonatype.org/sites/m2e, and only 3 of the m2eclipse "extras" from http://m2eclipse.sonatype.org/sites/m2e-extras including Maven Integration for Eclipse Extras, Maven Integration for Eclipse WTP, and Maven OSGi development (not Maven Integration for Subclipse). Complete installation instructions are available at http://m2eclipse.sonatype.org/installing-m2eclipse.html. Restart Eclipse after the install is completed.
- Maven 2.2.1 – can be downloaded from http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-2.2.1-bin.zip.
- Make sure to set the environment variable MAVEN_HOME to point to the location of the Maven 2.2.1 installation. This will allow you to use the Maven commands from the CLI.
- Configure Maven 2.2.1 in Eclipse - In “Eclipse”, “Preferences...” menu, search for the “maven”, select “Installations”, click on “Add...”, and select the location of unzipped Maven 2.2.1 directory.
See ya tomorrow!