wood burning stoves 2.0*
The moose likes Servlets and the fly likes deploying java web application having huge class files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "deploying java web application having huge class files" Watch "deploying java web application having huge class files" New topic
Author

deploying java web application having huge class files

Pradyut Bhattacharya
Ranch Hand

Joined: Aug 12, 2004
Posts: 63
I have a JSP/Servlet web application deployed in Glassfish which is having a number of Servlets and huge class files.
When I make even minor changes in the Servlet or class file, then the whole web application gets re-deployed which takes considerable amount of time.
Not only that, all the JSPs and Servlets are unloaded from memory and upon being called it takes around 1 second for getting initialized.

This problem does not occur when I change code of JSP, JS or CSS files as only that particular file is re-deployed.

Can I do anything so that the Servlets or those huge class files are deployed separately
and thus I do not have to deploy the whole web application?


Pradyut
http://pradyut.tk/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

No.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Can I do anything so that the Servlets or those huge class files are deployed separately
and thus I do not have to deploy the whole web application?


Try to put your modified servlet class files only into your classes directory of the server and let us know .

Thanks .


Save India From Corruption - Anna Hazare.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Ravi Kiran Va wrote:Try to put your modified servlet class files only into your classes directory of the server and let us know .

No matter what is tried, the application must be restarted when a class file is updated.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

No matter what is tried, the application must be restarted when a class file is updated.


Agreed that it needs a server restart , but deployment Time can be saved and only need to sepnd time on server restart , which the actual question was all about .
(Why to deploy all the jsps and all java files involved when only a single servlet is modified ??)\


(In the context of running a build.xml file for deployment ).

Thanks .

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41109
    
  45
If this is of paramount concern, then you can use OSGI to restructure your web app in a way that only few classes might need to be reloaded. Or optimize the web app startup so that whatever takes up all that time happens in the background.


Ping & DNS - my free Android networking tools app
Pradyut Bhattacharya
Ranch Hand

Joined: Aug 12, 2004
Posts: 63
should i go for opening a glassfish issue/enhancement as jsp/servlets are here for less than a decade now... still a simple feature missing...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41109
    
  45
It is not simple. Early servlet containers tried to reload individual classes when they got updated, but as web apps got more complicated it quickly became obvious that the approach was unworkable - objects are being kept in caches, collections etc. and don't go out of scope, so they can't be replaced with a new class definition.

As I said, you should restructure your web startup process.
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

No matter what is tried, the application must be restarted when a class file is updated.


How does eclipse' hot deploy work ? I have changed code on my way through a wizard and even the user session stays, just the current peice of code reexecutes.


Anrd
"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
Pradyut Bhattacharya
Ranch Hand

Joined: Aug 12, 2004
Posts: 63
I have post a bug on netbeans bugzilla...
hope you guys contribute so that may be jsp/servlets containers can be done better in future

http://netbeans.org/bugzilla/show_bug.cgi?id=194121
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41109
    
  45
What on earth does this have to do with NetBeans? This is a general characteristic of Java web apps - what do you expect the NB folks to be able to do about it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Ulf Dittmer wrote:It is not simple.


Agreed. Just because a requirement is simple to state, it doesn't follow that the requirement will be simple to implement.
Aniruddh Joshi
Ranch Hand

Joined: Jul 29, 2008
Posts: 275

agree, engineers are different from others since they can simplify things
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deploying java web application having huge class files
 
Similar Threads
How to download a huge file from server
Chapter 2 (HFSJ) notes , may be useful for anyone
weblogic compiles already compiled JSP's
whether this architecture is feasible..to the Authors!!!!!
Servlet changes