Creating a Windows service for Glassfish V2
Posted on Aug 19, 2007 at 1:26 PM
by Ryan de Laplante · Filed under Java
In the past I have chosen to use the commercial version of Glassfish (Sun Java Application Server 9.0), because it comes with a graphical installer and our customers have the option to buy support for it. Other than those two differences, they are exactly the same product. When used on Windows, the SJAS graphical installer has a checkbox on one of the screens to create a Windows service. Glassfish does not come with a graphical installer, and requires a full JDK for installation. It is still simple to install, but lacks an easy way to create a Windows service.
The final release date for Glassfish V2 (and also Sun Java Application Server 9.1) is September 17 2007. I've been using Glassfish V2 lately because of the features, performance, and I wanted to make sure that my apps run on it. The instructions to create a Windows service look like this:
[
Read More]
Give Glassfish 2/Sun Application Server 9.1 a try
Posted on May 13, 2007 at 7:08 PM
by Ryan de Laplante · Filed under Java
Some of you may know that I really enjoy working with Sun Application Server 9.1, the commercial version of Glassfish. The commercial version is still free to use, and is the only version you can get paid support for. I spoke with some of the Glassfish team at JavaOne, and also saw some presentations on upcoming features.
First I'd like to get everyone's burning question out of the way: Why should I even consider switching app server products? I asked a Glassfish representative at JavaOne this question. She told me that Sun entered the application server market late, after everyone was already using BEA WebLogic, WebSphere, JBoss, etc... Companies have made large investments purchasing commercial application servers and will not switch to Glassfish just because it's there. Developers who do look at Glassfish today will find that it meets all of their functional, availability, scalability, and performance requirements. These developers may choose to use it for new products. I thought these were very good points. The point of this blog entry is to convince developers to give Glassfish a try.
Our company was using JBoss because it is free. The reason I switched to Glassfish was because of its full featured web based admin console. I did not enjoy editing many XML files to configure JBoss. I used to have to search Google to figure out which XML file I need to modify or create, and which syntax to use. With Glassfish's web based admin console, everything you could possibly configure is accessible through a treeview and tabs. Initially I spent a lot of time exploring and discovering features I didn't know existed. For example, the web services monitoring screen. After I enabled monitoring for a specific web service, I was able to view live usage statistics and the raw SOAP messages. This was very useful when debugging. There are also command line tools that you can use to configure anything and everything from your scripts.
Another great feature in Glassfish is the Grizzly framework. Grizzly is a high performance, highly scalable TCP/UDP/SSL framework built on Java NIO sockets. I've seen charts where it outperforms Apache MINA (Multipurpose Infrastructure for Network Applications) framework, and C based servers. Grizzly also has an implentation of the Comet Bayeux protocol for server push to AJAX applications. It is necessary to implement Bayeux at this layer to have thousands of outstanding responses without consuming a thread for each.
The Glassfish team worked directly with Microsoft to enable interoperability between the Java platform and Windows Communication Foundation (WCF). Beyond basic SOAP messages, it was previously not possibly for Java and .NET web services to interoperate with security, reliability, trust, and other advanced features. The Glassfish team created an implementation called Web Services Interoperability Technologies (WSIT) and have built it into the Glassfish 2 (currently in beta). It is built on top of JAX-WS and JAXB. Not a single API has changed, so your existing web service endpoints and clients don't change. You simply add a configuration file to your project to enable these features. There is a NetBeans plugin that makes configuration extremely simple.
New in Glassfish 2 (currently in beta) is support for clustering, virtual servers, load balancing and high availability. A Glassfish representative showed me a demo of how to easily configure a cluster using the web based admin console. Your application doesn't need to change, and your HTTP sessions are automatically replicated to all nodes. Your load balancer can send a user's first request to node #1, a second request to node #8, and the user will never know. You can use a plugin for Apache httpd for load balancing, or use Sun's Web Server product. If you have a hardware load balancer, you can use that instead.
OpenPortal adds JSR-168 portlet support to Glassfish. One of the developers showed me a very impressive demo at JavaOne. He showed me how users can drag/drop portlets around and have it save the new layout using AJAX. The default theme looks sharp, and there are a number of great features such as Web Services for Remote Portlets, inter portlet communication, JSF portlet integration, "communities", NetBeans and Eclipse plugins, etc... Presently they are working on support for the new JSR-286 portlet standard. I think OpenPortal can be deployed to any application server.
Ericsson announced at JavaOne that they are donating their SIP (Session Initiation Protocol) and SIP Servlets technologies to the Glassfish project. This technology is behind many popular services we enjoy today, like Voice-over-IP (VoIP) phone service, instant messaging, presence and buddy list management and web conferencing. SIP Servlets are going to play an even bigger part in building the next generation of Telecommunications services. They will be working towards achieving JSR-289 compatibility, adding high availability and clustering features and integrating with the existing GlassFish services. The Ericsson promo video at JavaOne showed all kinds of neat things you can do with the technology to integrate your TV, cell phones, computers, and those services from your provider. They showed a boy wanting to watch a movie, the request being sent to Mom's cell phone for approval, Mom accepting the request and the movie starting. They showed text messages appearing on your TV, and all kinds of other neat things. Everyone at JavaOne was very impressed.
Something else I love about Glassfish is that they are comitted to staying on the forefront of Java EE technologies. You don't have to wait 1-3 years for them to implement the latest version of Java EE. Glassfish also has RESTful web services support, and SOA support (JBI and BPEL). There is an active user community who communicates through mailing lists. Glassfish developers have been quick to answer my questions, and quick to resolve bugs other people have found. There are Glassfish plugins for both NetBeans and Eclipse.
If that isn't enough to convince you to try Glassfish on your next project, then let me tell you about version 3! At JavaOne they showed a demo of the application server starting in something like 100ms! In version 3, only the pieces that are needed by the deployed applications are loaded. As you deploy and undeploy applications, different modules within Glassfish are dynamically loaded and unloaded. In the demo they deployed a WAR file and showed dynamic bits loading in about one second. Next they restarted the application server in just over one second! Also in version 3, there will be a way to configure which containers are available. Presently supported are Java web applications, Ruby on Rails using JRuby, Phobos using the phobos runtime, and PHP using the resin quercus engine.
With Java EE applications at IJWS, we use the commercial version of Glassfish (Sun Application Server 9.x) by default so that our clients can use it for free or buy support if they want. Soon we will offer BEA WebLogic as an alternative so that we can be flexible for those clients who are already comitted to BEA.
JavaOne, home computers, etc...
Posted on Mar 13, 2007 at 10:31 PM
by Ryan de Laplante · Filed under Java
I have registered for the JavaOne 2007 conference in San Francisco this May and am really looking forward to it. I bought the Conference Plus pass which means I go a day early to attend a one full day class on secure web services using JAX-WS, SAAJ, etc... very useful.
I've managed to convince some people at work to install Centric CRM and Collab.Net on test computers to evaluate them. Once both are fully installed we'll get everyone involved in evaluating. So far the people who have tried them or at least read about them are really excited. There have been a few issues with Centric CRM. It appears that we'll have to wait until mid-summer to get some of the fixes in the upcoming 5.0 beta. However, there are work arounds for some issues, and others are not critical. I'm really excited about what these two systems can do for IJW.
The other day a head hunter emailed me offering a job with a Global 50 company. They need a Solaris admin familiar with Sun Directory Server. I was quite pleased that keywords in my blog have made me rank higher and that she found me because of that. I talk about Solaris a lot :) I had to tell her that I'm a computer programmer, not a network administrator, and am not looking for an other job. Also, I'm just getting started with Solaris and LDAP.
Speaking of Solaris, I purchased a Solaris 10 book to help get me started. I bought two computers almost a year ago to be servers, and the setup I want requires Solaris. I've put off plans for a new JRoller blog, Centric CRM, Collab.Net, Scalix, Sun Directory Server, etc... all this time because I've been waiting for Solaris. Hopefully by the end of Spring I'll have things set up perfectly.. we'll see.
NetBeans 5.5.1 beta and Sun App Server 9.1 beta are out now. I'm looking forward to the final releases this April. There are tons of bug fixes in NetBeans including bugs that I found and reported. The new app server supports clustering and fixes file locking issues in Windows when re-deploying EAR files. I'm sure there are more new features but those are the features I'm most interested in. Learning about clustering will be a whole new learning curve I'll have to fit in sometime. I believe that making your system able to scale up using clusters or grids is one of several requirements in order to call your system an "Enterprise Application". It should be capable of working for 5 users, 5,000 users, 50,000 users, etc..
The Java journey continues. I now know that it will take several more years before I will be happy calling myself a senior java programmer. There is so much to know about architecture and libraries. I can't wait for an other year to go by, hopefully by then I won't be reading books one after the other year round. I said that last year too :/
Today at work I was talking with a couple programmers about making a new blog site or website called OneStopJava.com (which is taken already, but has no website). I can think of many things I have spent days researching, or read entire books on that can be summarized in an article or tutorial. I think that it would be great to have a site with real issues using current libraries. Often I find myself researching the wrong thing because last year that standard was made obsolete and replaced by a new one... or, that works great in Java 1.4 but in Java 1.5 it's done differently. I think I've lost hair over some of these issues (too bad stress doesn't make you lose back hair :).
Bought a tape backup drive
Posted on Jan 24, 2007 at 9:31 PM
by Ryan de Laplante · Filed under General
The home network I'm trying to build is still missing one important piece of hardware.. tape backup. Tonight I found an incredible deal on ebay: An internal 40/80 GB Quantum DLT4000 drive for $37 US, with 15 tapes including 3 cleaning tapes. Shipped, the total was $76 US. I also bought an $8 Adaptec AHA-2940UW SCSI controller, a SCSI cable and terminator. The total, shipped is $135 CAN! I couldn't believe it. The drive itself was probably over $700 new and it's only a few years old. The seller says it was used very lightly, maybe only three times.
It's all compatible with Solaris 10, in case I want to change the server's OS in the future (from Ubuntu Server).
The only concern I have is that it might be a 20/40 GB drive, not a 40/80 GB. I read a few places mention that the DLT4000 is a 20/40 GB drive. The auction says it comes with all of those 40/80 GB tapes. Those are expensive; I can't imagine someone accidentally buying that many tapes the wrong size. Either way, it doesn't matter to me. I probably have less than 1 GB of data to back up for now.
The network I'm creating looks like this:
sv01 (internal)
- Ubuntu Server
- OpenLDAP directory server
- BIND dns server
- Samba file server/print server
- CUPS print server (for use by Samba)
- Bacula tape backup server for whole network
- SSH secure shell
- SFTP secure ftp
sv02 (external)
- Sun Solaris 10
- Collab.Net collaboration suite (similar to sourceforge.net)
- Scalix mail and calendar server (MS exchange clone for linux, and web client)
- Centric CRM
- JRoller for my blog
- Postgres database for the various systems
All of the software on sv02 will authenticate with OpenLDAP on sv01. I can create an account once, and when you change your password it takes effect on all systems. Collab.Net and Scalix both *must* be installed on Red Hat Enterprise Linux, so they will go in a Solaris container for Linux which is compatible with RHEL v3.
Tried working on directory server again
Posted on Nov 12, 2006 at 12:52 AM
by Ryan de Laplante · Filed under Open Source
Today I decided to get back to the servers I bought in the summer. After numerous failed attempts at getting ANY LDAP server software working and client PC's authenticating against it, I put the project on hold for a few months and focused on the SCJP exam. After many many formats I learned a lot about Sun Directory Server 5.2. It's an old Netscape product written in C which Sun rebranded. I think RedHat/Fedora have their own rebranded version of the same product. Sun says it runs on Windows servers, Red Hat Enterprise, SUSE Enterprise and Solaris. Solaris is the only free OS of the four so it was the first OS I tried the directory server on. My hardware wasn't supported and I don't know any of the UNIX commands so I dumped Solaris. I'm using OpenSUSE now. I tried installing with no GUI (gnome or kde) and the directory server won't install properly (library dependancies or something). It will work with OpenSUSE 10.1 and Gnome.
Once I had a working LDAP server and config tool (Sun Administration Console), I wanted to configure PAM so the server could authenticate users against it. I used SUSE's graphical config tool and everything I tried failed. The screens kept talking about OpenLDAP (a different product) and didn't give me many options to configure. When I input what appeared to be correct information it said stuff like "Couldn't connect to server", "feature not supported" etc.. it let me save though. I tried logging in using an LDAP account and it didn't work. I rebooted and it still didn't work. Now I can't even open the settings screen for PAM because it can't connect to the LDAP server. I spent hours on google learning about ldap.conf, PAM, Sun App Server etc.. some places point to Sun's manual. Sun's manual tells you everything you need if you're using Solaris, or tells you to consult your OS's manual if you're using anything else. What an effing head ache. I wonder if I'm going to need to configure certificates, encryption, etc... to get it working. All the sites I went to showed very involved configurations. It's like you need special training to set up LDAP.
It made me think I shouldn't have spent $1300 on the two server computers (total) and should have bought one Sun server complete with Solaris and all the server software pre-installed :) Too bad they are all rackmount servers.. I don't want to buy a $2500 cabinet just for 2 servers.
I need a directory server so I can enable identity management for web services, portal server, and account authentication for various systems I'm installing on the servers. I want central administration of accounts for all my computers too (3 linux, 2 windows). I can't do ANYTHING until I have this effing thing working and I've been on/off it for months. If anyone thinks they can help please email me! If you can come into my computer and make it work, I'll pay you!
I wonder if I had used Red Hat Enterprise or SUSE Enterprise, everything might be super simple. They might have config tools and scripts already made for Sun's software.