Mukesh Garg's Weblog

Mukesh Garg's Weblog

All | General | Java | Music

20060921 Thursday September 21, 2006

Running Phobos apps on Sun Java System Web Server 7.0

What is Phobos ?

Project Phobos (Part of project Glassfish ) is a lightweight web application framework which runs on Java Platoform but allows you to develop your application using scripting language such as JavaScript. Writing phobos based application let the developer take advantage of rapid development using scripting languages while still leveraging power of the prooven Java Platform. To get up to speed on phobos, read Phobos overview.

Can we run phobos based application on Sun Java System Web Server 7.0 ? Why not ? it comes with a robust Web Container which is based on J2EE 1.4 specification.

Deploying a sample phobos application(calculator) on Sun Java System Web Server 7.0

1. Install Sun Java System Web Server 7.0 latest technology preview from Sun Java System Web Server 7.0 (Technology Preview), if you have already not done so.

2. Go to http://phobos.dev.java.net, and click "Documents and Files" on left hand side.

3. Select the samples directory.

4. Select the 2006-07-24 (3) directory.

5. Download the calculator.war file.

Now wait, the size of the WAR file is about 15MB ! why ? because this war file contains whole runtime infrastructure of phobos. If you extract it, you will see that under WEB-INF/lib directory there are whole lot of jar files which are needed by the phobos runtime.

Now if we bundle all these jars with all phobos applications, it will not only un-necessarily bloat the WAR file but your web server will also have multiple copies of the same jar. Not a ideal thing. So what I did, I took this lib directory and copied its content into the common Web Server libs area under <WEB_SERVER_DIR>/lib/phobos, and added all these jars in server-class-path of the web server.

I then removed these jars from THE WEB-INF of WAR file and repackaged it. Now, size is reduced to just 1.6 MB from 15 MB ! Now onwards, none of your phobos based application need to bundle these jar libraries in the WAR file.

Now deploy this calculator.war file on Sun Java System Web Server 7.0. Refer How to deploy web-applications on Sun Java System Web Server 7.0 using Admin GUI
-Start your web server instance, if it is not already running
-Launch your web browser and enter this URL:
http://<web-server-host>:<web-server-port>/calculator/
-Enter a number in the Current Total field and another number in the Second Operand field, select an arithmetic operation, and click Compute to get the result.
You can also try running other examples from phobos.java.net. (2006-09-21 08:27:07.0) Permalink

Running Phobos apps on Sun Java System Web Server 7.0

What is Phobos ?

Project Phobos (Part of project Glassfish ) is a lightweight web application framework which runs on Java Platoform but allows you to develop your application using scripting language such as JavaScript. Writing phobos based application let the developer take advantage of rapid development using scripting languages while still leveraging power of the prooven Java Platform. To get up to speed on phobos, read Phobos overview.

Can we run phobos based application on Sun Java System Web Server 7.0 ? Why not ? it comes with a robust Web Container which is based on J2EE 1.4 specification.

Deploying a sample phobos application(calculator) on Sun Java System Web Server 7.0

1. Install Sun Java System Web Server 7.0 latest technology preview from Sun Java System Web Server 7.0 (Technology Preview), if you have already not done so.

2. Go to http://phobos.dev.java.net, and click "Documents and Files" on left hand side.

3. Select the samples directory.

4. Select the 2006-07-24 (3) directory.

5. Download the calculator.war file.

Now wait, the size of the WAR file is about 15MB ! why ? because this war file contains whole runtime infrastructure of phobos. If you extract it, you will see that under WEB-INF/lib directory there are whole lot of jar files which are needed by the phobos runtime.

Now if we bundle all these jars with all phobos applications, it will not only un-necessarily bloat the WAR file but your web server will also have multiple copies of the same jar. Not a ideal thing. So what I did, I took this lib directory and copied its content into the common Web Server libs area under <WEB_SERVER_DIR>/lib/phobos, and added all these jars in server-class-path of the web server.

I then removed these jars from THE WEB-INF of WAR file and repackaged it. Now, size is reduced to just 1.6 MB from 15 MB ! Now onwards, none of your phobos based application need to bundle these jar libraries in the WAR file.

Now deploy this calculator.war file on Sun Java System Web Server 7.0. Refer How to deploy web-applications on Sun Java System Web Server 7.0 using Admin GUI -Start your web server instance, if it is not already running -Launch your web browser and Run -Launch a browser and enter this URL: http://<web-server-host>:<web-server-port>/calculator/ -Enter a number in the Current Total field and another number in the Second Operand field, select an arithmetic operation, and click Compute to get the result. You can also try running other examples from phobos.java.net. (2006-09-21 08:26:20.0) Permalink

Calendar

« September 2006 »
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22
23
24
25
26
27
28
29
30
       
Today

RSS Feeds

XML
All
/General
/Java
/Music

Search

Links


Navigation



Referers

Today's Page Hits: 25