NetBeans Tips

Posted on the 02 February 2012 by Skiabox @skiabox

NetBeans is a really great tool that can help on the rapid development of Java Web Applications or Java Desktop Applications, with a great community and many fans (mostly Java Developers).

This article discusses upon a specific flow that I have found, that seems to be a bug inherited from earlier versions of Netbeans IDE.

The NetBeans IDE version used for this article is NetBeans IDE 7.1 Java EE.

You can see a list of different NetBeans packages below (supporting Java SE, Java EE, C/C++, PHP or all of them)

NetBeans IDE 7.1 Download

I have created a Commercial Store as a Final BSc Project for my University (UK Open University) using JavaEE , NetBeans IDE for JavaEE and MySql.

I have followed a great tutorial that exists in the NetBeans Site, that teaches you how to use NetBeans to develop an e-commerce web site.

In one of the steps of this tutorial it says that to enable the glassfish server to communicate with the underlying mysql database you must tick this option : (follow the 3 steps)

step1

step2

step3

The problem is that although netbeans says that it is using the driver to communicate with the database, the driver may have not being copied to the glassfish directory,

which can cause errors when trying to deploy an application.

The solution is to manually download the driver from the official mysql site using the link below…

MySQL Connector/K

From there we can download the Tar Archive (mysql-connector-java-5.1.18.tar.gz) and then install it in our system following these steps :

  1. Open the archive using the command : tar -zxvf mysql-connector-java.5.1.18.tar.gz
  2. Inside the extracted directory there is a file called mysql-connector-java-5.1.18-bin.jar
  3. Copy this file in the lib or the lib/ext (what ever works for you) of your glassfish domain installation

In my case I chose to copy the file in both directories to be sure that it is working fine.

In my system (MacOS) the directories are :

/Applications/NetBeans/glassfish-3.1.1/glassfish/domains/domain1/lib & /Applications/NetBeans/glassfish-3.1.1/glassfish/domains/domain1/lib/ext