Thursday, October 06, 2011

Jenkins, Glassfish 3 and Windows 2008 R2

Right lets get cracking. First thing you going to want to do is grab the Jenkins files available at http://mirrors.jenkins-ci.org/. Select the package you looking for. The WAR file is the web application deployable to containers such as Tomcat or Glassfish. There is also a standalone version but seeing as I want to brush up my Glassfish skills I decided to grab the WAR file.

 

Now this is were I generally start getting extremely nervous. In my experience, deploying these things on app servers is always a nightmare requiring tweaking and additional work. So here we go.

 

In the Glassfish administration console, select the applications link. This will give you a list of currently deployed applications on the server. Right now I have zero Smile So, select the deploy button on the grid header, select the browse button and navigate to your jenkins.war file.

 

Once you have done all this you will notice that Glassfish has conveniently detected that it is a web application, suggested a context root and an application name. Select the the item “server” in the virtual servers list and make sure “Enabled” is checked. Proceed to select anything else you want the server to handle. I just want to get this deployed so I am going to keep it minimal. Once you are satisfied click the “OK” button on the bottom right of the page. I was pleasantly suppressed to see that the deployment went off with out a hitch! If successful you will be returned to the Applications list with jenkins listed there now. On the right of the grid you will see links to perform actions. Select the “Launch” link. This will take you to a web page giving you the URL for the http location and the https location.

 

Click the link you want and wait for jenkins to perform it’s initial operations. If all goes well, you will be presented with the dashboard to perform your configuration and maintenance.

 

Just as a side note, having been involved with Glassfish 1 and 2 then slacking off during development of 3 I must admit that the level of the application server has increased significantly! I am very impressed at how the admin UI has been fixed and the ease of use and deployment. Hats off to the development team.

 

Oh, just as point, for those that think they have to go buy super powered machines, this box is running 1GB RAM with one of the first AMD 64 bit processors and runs fine, so now need to empty the wallet just yet Smile Bear in mind that this is a personal machine so it isn’t subject to huge loads. Will do some stress testing and see where it gets me.

 

Other than that, have fun!

Glassfish 3 on Windows Server 2008 R2

First things first. Lets get the downloads out the way.

 

Go grab java 7 from http://www.oracle.com/technetwork/java/javase/downloads/index.html

Then go and grab Glassfish 3 from http://glassfish.java.net/public/downloadsindex.html#top (I went with the open source edition)

 

Install Java 7 (you only need to do this if you don’t have a JRE 6 or higher). Then you need to install Glassfish. Follow the prompts. I left the installation location the same (c:glassfish3).

 

Next thing you need to do is navigate to c:glassfish3bin. I had to open the asadmin.bat file and edit it. I had to change all virtual references to physical references (perhaps because the environment variables hadn’t been set yet)

 

Next thing, open a command prompt and navigate to c:glassfish3bin. We are going to create a domain now, you can do this by entering the command asadmin create-domain. This will walk you through the domain creation process. Once that is done you can run the command asadmin start-domain. To verify that the domain has started navigate http://localhost:4848 (or change the port to the admin port you stipulated). If you see the admin console everything is running 100%

 

Next post I am going to explore deploying Jenkins http://jenkins-ci.org/

 

References:

http://glassfish.java.net/public/downloadsindex.html#top

http://blogs.eteration.com/blog/?p=494

http://www.oracle.com/technetwork/java/javase/downloads/index.html

file:///C:/glassfish3/glassfish/docs/quickstart.html