Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deploying java web application having huge class files

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No.
 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Foreman
Posts: 275
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 28271
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Foreman
Posts: 275
jQuery Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
agree, engineers are different from others since they can simplify things
 
Run away! Run away! Here, take this tiny ad with you:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic