Sunday Mar 22, 2009
Sun has launched a new Java FX contest where students as well as developers are invited to submit an innovative rich media application using JavaFX 1.1 and NetBeans 6.5.

The contest has top three prizes of $25,000, $10,000 and $5,000. Students can compete for these top prizes. Additionally, there are special prizes (just for students) -- 3 top student applications will receive $1,500 each. There are 100 honorable mention prizes in the contest.
The contest runs from March 23rd to May 29th.
Visit: http://www.javafx.com/challenge
Tuesday Feb 24, 2009

Sun Microsystems Inc, India is running a Code JavaFX Contest.
This is targeted primarily for students and developers in India. There are lots of exciting prizes to be won.
There is also a group in OSUM for the contest.
Important Dates:
16 Feb 2009: Contest Starts. Register yourself.
01 Mar 2009: Last day for registration
05 Mar 2009: Last day for submission of proposal
31 Mar 2009: Last date to submit your project. Contest Ends
15 Apr 2009: Winners Announced
Saturday Jan 24, 2009
I am blogging after a long time now. Have been occupied with lots of things during the last two months.
One thing I have realized is that one of the best ways of promoting technologies and conveying a mass impact is by having a stall/exhibition/demo of some project/information desk in a public event. We did two of them in the last couple of months and met with a enormous response.
First of which was exhibiting a robotic project using Sun SPOT at the 78th Annual Session of the National Academy of Sciences, India (NASI) which took place in Panjab University from November 21-23, 2008. This session had brought together over 400 scientists from all over India. Furthermore apart from the various dignitaries even students visited the entire exhibition. We decided to put forward a project done by Jyotirmoy Banerjee, Ankush Manuja and Sumant Vashisht - all final year electrical and electronics students of my institute. They made a prototype of a robotic arm that would work according to the movements of the human hand using the Sun SPOT technology. All the students, faculties, participants and even the media reporters were really attracted to this working prototype. Here are some of the images:




The latest interaction of such kind was done in the Techno-Cultural Fest of UIET: Goonj 2009 (16th-18th Jan 2009). We set up an Installation cum Information desk at the most happening area of the Fest. We distributed Datasheets, Opensolaris & Netbeans disks, goodies and provided knowledge of Various Sun Technologies including OpenSolaris, Netbeans, Glassfish, MySQL, VirtualBox, Lusture etc. Furthermore information regarding OSUM and SAI was also provided. We also had setup files of all these technologies and more for installation onto laptops. We even demonstrated Sun SPOTs and told about the advantages and applications of the same. Also, since the dates of the Code For Freedom contest was extended to 18th Jan 2009, we managed to promote it in the final three days as well. I would like to specially mention the name of Vikas Ruhela of IT 3rd Year in UIET for his contribution in information desk during the Institute Technical Fest. Here are some pictures of the same:








Both these activities got an enormous response and so I hope to do more of these in the future.
Thursday Oct 02, 2008
As the title of my blog post suggests, I am going to explain how to turn your computer into a complete web development workstation.
If you are someone like me who is already into web development and is using the AMP stack, you will have MySql already installed and running on your computer. Also, you may have php installed on your system. Thus to try out a new application server like GlassFish you would need to install it separately and then configure it to connect with your existing MySql database and also be able to run php on it. Incidentally I also had GlassFish installed on my computer alongwith Netbeans 6.1. The entire process is pretty straight-forward and simple but it took me quite a lot of googling to find a proper documentation that could help me integrate php and MySQL with GlassFish. Unfortunately until now, I could not find a single consolidated help anywhere. I managed to do it by taking information from various parts of the cloud and now I have created an unified documentation for this issue.
Before I start off I would like to clarify the state of my computer, cause the procedure might differ slightly depending on which Operating System and various configurations you have. Although I believe that the steps to be followed will be largely similar.
I am using Mac OS 10.5.5. I have MySql 5.0.51b installed on my computer using the Mac OS package setup. I have Apache 2.2.8 and php 5.2.6 pre-packaged with Mac OS. Also I have Netbeans 6.1 installed and my GlassFish v2 Update Release 2 came packaged with the Netbeans installer.
Now first to get started with GlassFish application server. My GlassFish installation path is: /Applications/Netbeans/glassfish-v2ur2. To generalize the path for all systems, I shall use $GLASSFISHHOME throughout this blog entry to denote the GlassFish installation folder. To be able to easily use the GlassFish command, it is best to add $GLASSFISHHOME/bin/ to the path of your Terminal/Command Prompt. GlassFish installation has a preconfigured domain domain1. You can read more in the GlassFish Quick Start Guide
To start the server issue the command: asadmin start-domain domain1
You can now access the default GlassFish Welcome Page by opening http://localhost:8080/.
Note that my Apache webserver is also running on port 80 and both of them do not interfere with each other. For you added information, this default welcome page is located here: $GLASSFISHHOME/domains/domain1/docroot/index.html
For administration you can open Admin Console by pointing your browser to http://localhost:4848/ and then login with your admin credentials. By default the username is admin and the password is adminadmin. Using this web-based GUI you can
Deploy and undeploy applications
Enable, disable, and manage applications
Configure resources and other server settings
Configure clusters and node agents
Manage server instances and clusters
Select and view log files
Configure load balancers
To try out a basic application download
hello.war from
http://glassfish.dev.java.net/downloads/quickstart/hello.war and place it
$GLASSFISHHOME/domains/domain1/autodeploy. This is a special folder and any Web Application Archive (.war) placed in the folder is automatically deployed by GlassFish. You can run this application by pointing your browser to
http://localhost:8080/hello.
Now that your GlassFish server is running fine we can move towards php applications. In case of GlassFish php can be deployed using
Quercus which is Caucho Technology's fast, open-source, 100% Java implementation of the PHP language. Download
quercus-3.1.6.war. You can place this file in autodeploy and try to open it by pointing your browser to
http://localhost:8080/quercus-3.1.6/. If you can view contents properly then php is working fine.
quercus-3.1.6.war contains a php page (index.php) which is executed by default. You can unjar
quercus-3.1.6.war to view the source.
unjar -xf quercus-3.1.6.war
You can edit
index.php and add your own php source files and jar it into a new .war file. Make sure you include the
WEB-INF and
META-INF into your war package.
jar -cf output.war file1 file2 file3 .... fileN
Unfortunately no one would prefer to deploy php application as a war package. If you want to keep you source in a folder like you do in Apache, the same can be done here as well. Copy the three files
quercus.jar,
resin-util.jar and
script-10.jar from
WEB-INF/lib to
$GLASSFISHHOME/lib/. Also add the following lines to
$GLASSFISHHOME/domains/domain1/config/default-web.xml
<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
<init-param>
<param-name>ini-file</param-name>
<param-value>WEB-INF/php.ini</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>
Restart GlassFish so that the settings may take effect.
asadmin stop-domain domain1
asadmin start-domain domain1
Now you can place your php sources in
$GLASSFISHHOME/domains/domain1/docroot and can open them in web-browser by pointing to
http://localhost:8080/filename.php.
If you want that
index.php should open as the default page in a folder you need to add an entry to the
welcome-file-list in
$GLASSFISHHOME/domains/domain1/config/default-web.xml.
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.php</welcome-file>
</welcome-file-list>
Finally to write applications that would interact with MySQL database, you need to download the jdbc-driver for MySQL from
http://dev.mysql.com/downloads/connector/j/5.1.html and place
mysql-connector-java-5.1.6-bin.jar in
$GLASSFISHHOME/lib/. Now restart GlassFish and then login into the Admin Console. Go to
Resources > JDBC > Connection Pools and create a new
connection pool.
Enter the following details:
Name: (give an appropriate name)
Resource Type:
javax.sql.DataSource
Database Vendor:
mysql
Select Next. Now enter the Data Source Class Name as
com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource and add the following additional properties:
serverName:
127.0.0.1 (just the localhost)
port:
3306 (default port)
user: (an existing user allowed to connect to your mysql db)
password: (the users password)
databaseName: (the name of the database you want to connect to)
Leave everything else as the default values and click Finish.
To test the connectivity with MySQL you can select your newly created connection pool and PING the database.
A "Ping Succeeded" would confirm connectivity.
Now you can write php scripts that would connect with MySQL using
mysql_connect("localhost", "username", "password").
I get the following warning whenever MySQL connection is being established by php for the first time after server restart since I am using an older MySQL database:
/Applications/NetBeans/glassfish-v2ur2/domains/domain1/docroot/drug/connect.php:3: Warning: Your MySQL Connector/J JDBC 5.1.6 driver may have issues with column/table aliases and DESCRIBE statements. The recommended JDBC version is 3.1.14. [mysql_connect]
It can be solved by using an
older JDBC driver.
Now that your php applications can run on GlassFish, you can exploit the features that Glass Fish has to offer. You may also download the Mysql-GlassFish packaged installer from
here. Maybe it is easier to set things up with this installer.
Also the
Sun Student Reviews Contest is going on at present in which GlassFish and MySQL is needed to be used. Hopefully setting up GlassFish and MySQL would not be a hindrance in participating in this contest.
Sunday Sep 28, 2008
Loads of contests are currently going on at Sun for Students. I suggest everyone to participate in atleast one of them. Each of them carries fabulous prizes:
Code For Freedom
This year the format of the CFF contest is entirely new and is designed to generate enthusiasm for open source software technology and to encourage academic developers to contribute software applications that demonstrate use and adoption of various Sun open source technologies. The contest is open to any college student in India and provides many exciting prizes. Students are required to submit complete project implementations that use at least two Sun open source technologies and are developed using either Netbeans or Sun Studio. Contest has started on 20 September 2008.
Project proposal is to be submitted by 31 December 2008. Contest Ends on 30 April 2009 and by 14 June 2009 the winners will be announced.Visit Contest Home
Student Reviews Contest
Download MySQL 5.1 Community Edition and GlassFish v2 Update Release 2 (UR2) application server, develop a cool web application using these products, create a project of your application at java.net, write a review, submit the URLs by October 22, 2008, and you can win $500 in Visa debit cards. Visit Contest Home
Project Darkstar Developer Challenge
Sun is sponsoring a contest for independent developers and students working with Project Darkstar, an open source, Java software server infrastructure that simplifies the development of game servers that take full advantage of today's multi-core processors. The Project Darkstar Developer Challenge is looking for the useful applications and utilities for the Project Darkstar community and offers some great prizes. Grand prize winners get a 2009 Game Developer Conference (GDC) pass and an opportunity to show off their stuff at GDC, plus cash for travel and a feature on the Project Darkstar site. Entrants must be members of the Project Darkstar community and submit their entries between November 17, 2008 and January 19, 2009.
Visit Contest Home