Archive for December, 2010


I’m going to assume that you have already created a new SVN repository for your project in preparation for the import. As a headsup, I came into problems when I created a SVN repository with default folder structure (branches/tags/trunk) so if you encounter issues trying to import the dump file (step 6) you may need to remove your default folder structure from the SVN repository and try again.

Note. I would not attempt to import the CVS Repository from a production environment, work from a copy.

  1. Download cvs2svn (http://cvs2svn.tigris.org/) and untar the tarball cvs2svn-2.3.0.tar.gz.
  2. If you are on a Windows box, download and install Cygwin (http://Cygwin.com/setup.exe). Choose the following options during installation:
    - Install from the Internet
    - Choose install location E.g. C:\cygwin (all users)
    - Use IE5 Settings
    - Select Download Site: E.g. ftp://mirror.internode.on.net
    - Select the following packages: cvs, svn, cvs2svn, python, gnutls and rxvt (and any others you would like)
  3. Copy the extracted cvs2svn contents into your Cygwin user directory E.g. C:\cygwin\home\user\cvs2svn-2.3.0.
  4. Copy the “CVSROOT” folder and the module folder “yourProject” for your project from your CVS repository into a new folder “cvs” in your Cygwin user directory (C:\cygwin\home\user\cvs\).
  5. Run Cygwin and enter the following command *:
    $./cvs2svn-2.3.0/cvs2svn --dump-only --dumpfile ./cvs2svn.dump --fallback-encoding utf_8 ./cvs/
  6. Locate the svnadmin tool on the server hosting the SVN repository. It is now time to import the cvs2svn dump file into the SVN repository (where pathToDumpFile is the location of cvs2svn.dump generated in step 5).
    C:\Program Files\visualSVN Server\bin>svnadmin --parent-dir yourProject load pathToSVNRepository < pathToDumpFile
  7. Now is a good time to checkout the contents of the SVN repository (command line/TortoiseSVN) and check that everything is there as expected and the full history for your project is available.

* If the repository you are converting is huge and/or contains large binary files you may see “Memory Error” in the cvs2svn output which means it has fallen over. To easily fix this I suggest trimming the offending files out of the repository and repeating step 5. Note. the fallback encoding is optional, I found it was required when I converted my project due to the encoding of some commit comments.

Suitable for:

  • Glassfish Application Server V2.1
  • Windows XP

In a production environment we want Glassfish Application Server to be running with no users logged into the host machine (WinXP in this case). This post explains how to run Glassfish as a service which will automatically start up when the host machine is rebooted.

To create the service:

>sc create domain1 binPath= "C:\Sun\AppServer\lib\appservService.exe \"C:\Sun\AppServer\bin\asadmin.bat start-domain\" \"C:\Sun\AppServer\bin\asadmin.bat stop-domain\""

To check that the service has been successfully created right click on My Computer –> Manage –> Services and Applications -> Services. The service domain1 should appear in the list. Right click on the service –>Properties –> change the startup type to be Automatic and select Apply, then OK. The service should run as Local System (default).

If you need to remove the service, run the following command (make sure the Computer Management window is closed first):

sc delete domain1

Note. Glassfish can be controlled by the command line, through an IDE or as a service. It is not recommended to mix these approaches when stopping and starting the server.

Recently I started noticing this irritating message (repeated multiple times) in my NetBeans Glassfish Application Server log. The message is triggered by Glassfish start up and on application deployment.

SEC5046: Audit: Authentication refused for [admin].
Web login failed: Login failed: javax.security.auth.login.LoginException: Failed file login for admin.

It annoys me because when I installed NetBeans, I specified my own admin password for Glassfish (instead of the default admin/adminadmin). Later when starting the Glassfish server through NetBeans, it prompts me for my password and I supply it yet stubbornly this message continues to appear in my log. What the hell NetBeans?

So I’ll admit I ignored it for a while.

Today, I fixed it. I simply went into the Glassfish admin console (http://localhost:4848) and changed the Administrator’s password to the one specified during NetBeans installation. I restarted Glassfish and what do you know the message is no more.