Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deploying java web application having huge class files

 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 275
Eclipse IDE jQuery Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20188
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 275
Eclipse IDE jQuery Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
agree, engineers are different from others since they can simplify things
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic