Students taking PROG3060 in the Winter 2015 semester may wish to install all of the various software components required for the course on their own machines. So, in anticipation of student requests for that list of components and how to configure them, here goes.
We will be utilizing:
- Java JDK 1.7.0 r71, 32-bit edition;
- Eclipse Luna 32-bit, the Oracle OEPE (Oracle Enterprise Pack for Eclipse) version 18.104.22.168.1, which contains various additional Web Tools Platform (WTP) Eclipse plugins.
- Java EE 7 32-bit, which includes the Java Enterprise Edition 7 jar files, the Java 1.7.0 JRE, the Derby pure-Java database system (version 10.4.2.0), and the open-source GlassFish 4.1 application server.
- Apache Tomcat 8.0.15 web server.
- Java Hibernate 4.3.6. Hibernate 4.3.7 is now available here. It is unlikely that the upgrade from 4.3.6 to 4.3.7 will significantly impact student work.
In addition, student may desire downloading the Oracle JDBC drivers if they are planning to utilize Oracle with Java applications. These drivers should work well with Oracle 11g servers; only the 12c library is compiled with Java JDK 1.7, whereas 11g drivers use the Java 6 JDK and hence requires the Java 1.6 installation as well.
All of the software is multi-platform (Linux, Mac, Windows) so students should be able to replicate the lab environment on their own machines. Setup, however, is not necessarily straightforward; the issue is that both Glassfish and Tomcat, by default, listen on TCP port 8080 and this requires configuration changes.
Note: If you have an instance of the Oracle XE server installed on your machine, it also contains a web server that listens on port 8080. Since changing this port is NOT RECOMMENDED, you will have to alter the ports for BOTH Glassfish and Tomcat with your installation. I use ports 19600 and 19601 for Glassfish, and 8500 for Tomcat. The Glassfish administrative listener port (4848) can remain unchanged.
Changing the Glassfish listeners’ port numbers
If you use the Java EE7 Windows installer (recommended for Windows installations), it by default configures Glassfish to use 8080 and 8081 for its listener ports. To change them to something else, follow these steps:
- Go to the folder where Glassfish in installed – often on Windows this is “c:\
- Go into the config folder for Glassfish, which will be “c:\glassfish4\glassfish\domains\domain1\config”.
- Open the file “domain.xml” using the text editor of your choice. Look for “8080” in the file, and you will see something like this:
<network-listener port="8080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
<network-listener port="8081" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
<network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>
and change “8080” and “8081” to two other distinct port numbers that do not conflict with other port numbers in use on your machine. On my Windows installation I’ve used 19600 and 19601.
- Save domain.xml.
You can install Tomcat manually by choosing the .zip installation available from apache.org, but for Windows installation the Windows installer brings up a dialog with which you can set the port numbers Tomcat will use. My own installation mimics the installation in College labs by using port 8500.
The pure-Java Derby relational database comes with the Java EE 7 installation, and is placed in the “javadb” subdirectory of the Java EE 7 install. The Derby server listens on registered port 1527, which should not conflict with anything else on your machine BUT the use of that port must be enabled by modifying the policies with your Java JDK installation; otherwise, an attempt to start the Derby server using the default “startNetworkServer.bat” will fail with a security violation.
To re-configure your Java 7 JDK to suit Derby, edit the file “java.policy” in your Java 7 JDK installation directory, something like:
and include the following grant at the end of the file:
permission java.net.SocketPermission "localhost:1527", "listen";
Once Java, Derby, Tomcat, and Glassfish are installed, you should configure Eclipse OEPE to work with Glassfish and Tomcat by installing them as servers using the Eclipse Server dialog:
You can also go to the Database Perspective within Eclipse and, after starting the Derby 10 server, connect to the Derby server from within Eclipse and execute some sample SQL statements to a new Derby database using SQL Scrapbook. The JDBC jar files required for use by SQL Scrapbook can be found in the “javadb\lib” directory (in particular, derbyclient.jar) where Derby is installed (with the Java 7 EE installation).