Tuesday, September 30, 2008

Using HTTP-based Subversion Repository for Local Maven 2 Repository

Maven 2 repository could be exposed to public using several protocols. The protocol will be reflected by how we access the repository. The popular ones are HTTP, HTTPS, Subversion, and of course direct file system access which should be reflected by URIs:
  • http://repo1.maven.org/maven2
  • https://localmaven.jugi.or.id
  • svn://kutukupret
  • file:///opt/maven2/repo
Subversion which is a source code management (SCM) software could also be exposed to public through HTTP/HTTPS protocol. 

Because most developers should have at least read only access to the source code base of the SCM software, any SCM software that is exposed through HTTP/HTTPS protocol could be easily tuned to be Maven 2 local repository as well. I will show the way to use SCM as Maven 2 repository using Subversion  but the principles will apply to any HTTP/HTTPS based SCMs.

Here is how we do it.

When you look to Maven 2 repositories such as http://repo1.maven.org/maven2, the structure is quite simple.
Grab the example the resource specified in this URL: 

We need to break down this URL into these fields:
  • artifactId: openjpa
  • groupId: org.apache.openjpa
  • version: 1.2.0
  • Maven 2 repository root URL: http://repo1.maven.org/maven2/



Saturday, September 27, 2008

Setup New Installation of Sun VirtualBox 2.0.2


VirtualBox is a x86 architecture virtualization package developed by Innotek, a Germany company which acquired by Sun on February 2008 to add to its portfolio of open source software. Innotek had a significant experience in developing add ons to make it smoother for the interaction and switching between the host and guest operating system. Sun has made some improvements in it as well after the acquisition.
Okay, for those who are not familiar with the virtualization term, host operating system means the operating system that we are running. The guest operating system is the operating system that is run on top of the VirtualBox virtualization software. This is of course a loose definition. You might be able to run virtualization software on the guest operating system.

As part of its commitment to open source, aside from the PUEL (personal use and evaluation license)  licensing, Sun has made it available to public the OSE (open source edition) version to public. In plain English, this means that we can use the OSE version unsupported for free (under GNU GPL). For personal use only, we can use the PUEL version which is richer in features.

Download the installer from here. Download the PUEL binaries.

For those who want to play around with operating system other than ones installed in your computer, I will demonstrate how to install VirtualBox on Windows Vista, as this is currently the environment that I have at home. I downloaded the the x86 version, it's because I'm using a 32-bit Windows Vista though my laptop's processor is AMD Turion64/x2 (dual core). I would be able to install the AMD64 version when I run it in my laptop under OpenSolaris. I'm not interested to switch to Windows Vista 64-bit version in near future.

Run the executable. You will probably encounter this dialog when running the Windows installer on Vista default security setting:



Click the "Run" button.

The welcome screen will be displayed.

Click "Next".
Click on the "I accept the terms in the License Agreement" if you agree with the license agreement. Click "Next".

Click "Next" to accept the default installation folder.

Click "Install" to start the installation.


Windows will confirm whether we want to install these device adapters (USB and network adapter):

Just click "Install" on each of those confirmations.

If everything ok, the installer will finish with this screen.


Just click "Finsh" button and there you are!

Try to find "Sun xVM VirtualBox > VirtualBox" in the Start Menu, click to execute the application.





Wednesday, September 24, 2008

Upgrading to VirtualBox 2.0.2

I'm using VirtualBox for personal usage under PUEL license. There is another version, Open Source Edition (OSE) which you may use for it is free of charge under GNU GPL 2.

With VirtualBox I can do some experiments and even try other enviroments without having to reboot my box. 

I keep these 2 installation on my VirtualBox: 



  • OpenSolaris 11

  • Ubuntu



A newer version of VirtualBox has been launched, it is recommended to upgrade to this latest version 2.0.2. Download the version that match your platform here.


I'm upgrading my box to 2.0.2 from previous 1.6.2 version.

This is the screen capture of a VirtualBox:



After upgrading, I try to run the OpenSolaris, it boots correctly:
Seems that there is a minor glitch here, an warning  message appeared:

WARNING: cpu0: failed to update microcode code from version 0x0 to 0x2

The microcode of the CPU emulated between 1.6.2 and 2.0.2 might be a bit different and OpenSolaris detected it.

Anyway, the OpenSolaris does not seem to have problem running on the new version.


My Ubuntu installation also ran well on the new installation:


WARNING:

Please take note that the saved state of previous version might not work in the newer version. Make sure to shutdown your guest operating system on the old installation before upgrading.


SQL Server 2005 Express: Lost the sa password

Today's development requires most people to be able to connect to multiple SQL database. Changing database environment might become a hassle. Today I have to setup a new database environment running on SQLServer Express (a local development database) , while I already have another database running. Previously I already set the database to use Mixed Mode which means I could login through Windows Authentication (the default setting a more sophisticated and manageable approach) and through the old school username and password.
For development environment in your local machine, the old school approach seems to be more reasonable. You could have your environment setup in a script, wipe it out and recreate it again without disturbing the ActiveDirectory users etc.

Because I have not been using the sa (default administrator) user for long I have forgotten it. I search the Internet and find a way to recover the password.

C:\> osql -E -S .\SQLEXPRESS
1> exec sp_password @new='nupasswd', @loginame='sa'

2> go

3> exit

C:\>

Now try to login using the username 'sa' and the 'nupasswd'.

Thursday, September 18, 2008

Failed to install varnish in Ubuntu

Today I tried to install SCons on my VirtualBox Ubuntu. It gave an error because my previous installation of varnish on this Ubuntu failed, so every time I invoke the apt-get install, it will try to install the varnish again and repeat the same failure. The failure is revolved around the inavailability to the crti.o library.
It seems that I'm not alone. Somebody else had failed installing varnish on Ubuntu and had the same problem.


I found out that the cause of the problem is the lacking of libc6-dev in my Ubuntu installation.

The fix to this problem turned out to be just installing the Ubuntu package libc6-dev.

The varnish installation needs the SHMEM library related to the existence of the crti.o object file in the C library (seems that it is a kernel specific library).

$ sudo apt-get install libc6-dev

or

$ sudo aptitude install libc6-dev

The package manager will choose the most suitable c library for your Ubuntu kernel.

Voila, it works!

When the failed pending varnish installation has been cleared, the uninstall feature (apt-get remove varnish) back into action again! I could install/reinstall varnish again.