Testing some FrameWorks and applications on Glassfish build 40+ part V , And some tips about Application deployment
It is a short entry that shows i used DWR Ajax Toolkit On GlassFish But to make the entry a bit more usefull , i would like to tell you how you can deploy an application to GlassFish .
so far I know two methods that allows us to deploy application into GlassFish ,
- Using its web based Admin console which usally run on port 4848
- Using the Autodeply library of your desierd Domain
- Using Asadmin administration console
Lets see how we can deply sample war file of DWR Ajax Toolkit using each of the above methods. A war file like this one has simplest form of deployment because we have no resource definition , for example there is no datasource , connection pool , jms destination ,…. which needs to be defined. To start your server goto GlassFish_Home/bin and execute
asadmin start-domain it will start the application server default domain , in case that you did not change the administration port then you can access the web based admin console using http://127.0.0.1:4848/asadmin/admingui/TopFrameset
after you loged in just in your left panel click on the web applications node , you will see that content frame shows you all deployed application and also provide some buttons to deploy new web application something like :
click on deploy and you will see the web application deployment page , here you can browse to WAR file ad select it to be deployed into current Domain.lets do it by selecting DWR.war which we download from DWR website. next image show how the war file deployment will looks like
Now press next , and you will see that DWR is deployed very easily. Now you can naviate to Web applications node and see your DWR entry in web application list , lets check and see how does it works on glassfish.
To check that it works on GlassFish it will be enough to run one of its samples. so do it yourself to see what happens. I for my sel JDate Sample as the first one and i saw that it works fine.
Now lets see how we can deploy the application using autodeploy folder , this folder is located in your domain folder somewhere like :
you can use this folder to deploy all kind of applications , so you can put a war file inside that folder and GlassFish will deploy it for you , you can put an EAR file there and GlassFish will deploy it for you even You can deploy Resource Adapters (RAR files) using this folder.
to test this folder , goto web administration console and inside web applications management page undeploy DWR project then come back here and put DWR.war inside autodeploy folder now go to web based management console and you will see DWR in deployed web application list.
Now that you find out how this magic folder works , lets see how that administration Script ( asadmin.bat/sh) works for us. it is even easier than the previus one , you just need to call : Glassfish_Home/bin/asadmin deploy c:/DWR.war
In next parts i will talk more about deploying application into GlassFish , we will see how an ear file or rar file can be deployed and be configured to works inside GlassFish .