• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF, Hibernate on Tomcat 7- UI is freezing

 
Shweta Jamsandekar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello JSF-Hibernate expertees,

Currently we are facing a problem in application developed in JSF, Hibernate on Tomcat server 7.
The UI is getting freezed after uncertain time. Sometimes it worked for 2 to 5 hours and sometimes it hangs out within 10 mins, too.
Session time out in web.xml is -1

Before, we were getting memory leak logs in catalina, so we implemented ClassLoaderLeakPreventor in the application
When problem occurs, below log is printing in catalina.out.

INFO: Reloading context [/SHRWeb241213]
Jan 31, 2014 12:42:36 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/SHRWeb241213] has started
ClassLoaderLeakPreventor: com.cosmos.leakPrevention.ClassLoaderLeakPreventor shutting down context by removing known leaks (CL: 0x19a37a)
ClassLoaderLeakPreventor: Removing 47 classes from Mojarra descriptors cache
ClassLoaderLeakPreventor: Looping 0 RMI Targets to find leaks
ClassLoaderLeakPreventor: Looping 0 RMI Targets to find leaks
ClassLoaderLeakPreventor: Custom ThreadLocal of type org.primefaces.context.RequestContext$1: org.primefaces.context.RequestContext$1@16be8a0 with value org.primefaces.context.DefaultRequestContext@1758c30 of type org.primefaces.context.DefaultRequestContext that is loaded by web app will be made stale for later expunging
ClassLoaderLeakPreventor: Custom ThreadLocal of type org.primefaces.context.RequestContext$1: org.primefaces.context.RequestContext$1@16be8a0 with value org.primefaces.context.DefaultRequestContext@46b372 of type org.primefaces.context.DefaultRequestContext that is loaded by web app will be made stale for later expunging
ClassLoaderLeakPreventor: Since Java 1.6+ is used, we can call public static final void java.util.ResourceBundle.clearCache(java.lang.ClassLoader)
ClassLoaderLeakPreventor: Releasing web app classloader from Apache Commons Logging
Jan 31, 2014 12:42:36 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/apache-tomcat-7.0.47/webapps/SHRWeb241213/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jan 31, 2014 12:42:39 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.icesoft.com/icefaces/component is already defined
ClassLoaderLeakPreventor: Settings for com.cosmos.leakPrevention.ClassLoaderLeakPreventor (CL: 0x16509fe):
ClassLoaderLeakPreventor: stopThreads = true
ClassLoaderLeakPreventor: stopTimerThreads = true
ClassLoaderLeakPreventor: executeShutdownHooks = true
ClassLoaderLeakPreventor: threadWaitMs = 5000 ms
ClassLoaderLeakPreventor: shutdownHookWaitMs = 10000 ms
ClassLoaderLeakPreventor: Initializing context by loading some known offenders with system classloader
Jan 31, 2014 12:42:39 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.9 (SNAPSHOT 20120531-1326) for context '/SHRWeb241213'
Jan 31, 2014 12:42:39 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jan 31, 2014 12:42:40 PM org.icepush.servlet.MainServlet <init>
INFO:
ICEsoft Technologies Inc.
ICEpush 2.0.0
Build number: 1
Revision: 23556

Jan 31, 2014 12:42:41 PM org.icefaces.util.EnvConfig init
INFO: ICEfaces Configuration:
org.icefaces.render.auto: true [default]
org.icefaces.autoid: true [default]
org.icefaces.aria.enabled: true [default]
org.icefaces.blockUIOnSubmit: false [default]
org.icefaces.compressDOM: false [default]
org.icefaces.compressResources: true [default]
org.icefaces.connectionLostRedirectURI: null [default]
org.icefaces.deltaSubmit: false [default]
org.icefaces.lazyPush: true [default]
org.icefaces.sessionExpiredRedirectURI: null [default]
org.icefaces.standardFormSerialization: false [default]
org.icefaces.strictSessionTimeout: false [default]
org.icefaces.windowScopeExpiration = 1000 [default]
org.icefaces.mandatoryResourceConfiguration: null [default]
org.icefaces.uniqueResourceURLs: false

Jan 31, 2014 12:42:41 PM org.icefaces.impl.renderkit.DOMRenderKit <clinit>
INFO:
ICEsoft Technologies Inc.
ICEfaces 2.0.0
Build number: 4
Revision: 23692

Jan 31, 2014 12:42:42 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.0.M3-SNAPSHOT
Jan 31, 2014 12:42:42 PM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor <init>
INFO: Monitoring jndi:/localhost/SHRWeb241213/WEB-INF/faces-config.xml for modifications
Jan 31, 2014 12:42:42 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/SHRWeb241213] is completed


Not sure what exactly needs to be done to come out of this issue.
Appreciate your help ASAP

Thanks
 
Tim Holloway
Bartender
Posts: 18413
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Shweta!

Most likely Tomcat is running out of resources. You have leaky code and you've attempting to get around the problem rather than actually fix the leaks and all that did was maybe delay the moment of breakdown.

Tomcat, Hibernate and JSF do not normally leak resources, except in cases where you are attempting to repeatedly replace the WAR in a running instance of Tomcat (which often results in a PermGenSpace memory exception). So you need to examine the application code, determine where the leaks are occurring and fix them.
 
Shweta Jamsandekar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Tim,

Thank you for your response..

As per your suggession, we have already analysed the memory dump and found org.apache.catalina.loader.WebappClassLoader is consuming more memory. So we implemented the said class and now we are not getting outofmemory or memory leak error.

But still not getting why tomcat is reloading the context.

If we put below in server.xml
<Context path="/SHRWeb241213" reloadable="false" />

Then we get only below log ...excluding initial part of the log i posted before ..

Jan 23, 2014 4:18:11 PM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor hasBeenModified
INFO: jndi:/localhost/SHRWeb241213/WEB-INF/faces-config.xml changed!
Jan 23, 2014 4:18:11 PM com.sun.faces.config.ConfigureListener reload
INFO: Reloading JSF configuration for context /SHRWeb241213
Jan 23, 2014 4:18:11 PM com.sun.faces.config.ConfigureListener reload
INFO: Invalidating Session 0572487894557559780465C56B7E6BC1
Jan 23, 2014 4:18:11 PM com.sun.faces.config.ConfigureListener reload
INFO: Removing application scoped managed bean: fileEntryLoader
Jan 23, 2014 4:18:11 PM com.sun.faces.config.ConfigureListener reload
INFO: Removing application scoped managed bean: ctxtUtil
Jan 23, 2014 4:18:11 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jan 23, 2014 4:18:11 PM org.icepush.servlet.MainServlet <init>
INFO:
ICEsoft Technologies Inc.
ICEpush 2.0.0
Build number: 1
Revision: 23556

Jan 23, 2014 4:18:13 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.0.M3-SNAPSHOT
Jan 23, 2014 4:18:13 PM com.sun.faces.config.ConfigureListener reload
INFO: Reload complete.

Any idea, reason behind it. Thanks in advance..:)

 
Tim Holloway
Bartender
Posts: 18413
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You still seem to be trying to solve your problems by modifying the server instead of modifying the app and to me that means that not only are you probably nor repairing the real problem, you're cooking up an expensive, fragile work-around to the problem.

There ARE occasionally bugs in server products, but the odds are against it, and I usually hear about them. Which for this particular case, I haven't.

And, by the way. DON'T put your webapp definitions in server.xml. That has been discouraged since Tomcat4. Either define your Context in the WAR (for Tomcat, that would be as META-INF/context.xml, I think), or define the Context in an XML file in TOMCAT_HOME/conf/Catalina/localhost.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!