Tomcat Liferay bundle unexpectedly closedTomcat Liferay bundle unexpectedly closedhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=923275512024-03-28T23:30:33Z2024-03-28T23:30:33ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926512222017-08-03T16:26:26Z2017-08-03T16:26:26ZThank you, you have been very kind.<br />I'll start making these changes you've suggested to me.<br />I'll let you know. <br />Thank you!Fabrizio Attanasio2017-08-03T16:26:26ZRE: Tomcat Liferay bundle unexpectedly closedAndrew Jardinehttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926511772017-08-03T16:21:53Z2017-08-03T16:21:53Z<html><head></head><body>Don't worry, we're all beginners with everything at some point.<br><br>This goes a little beyond the original question but let's see if we can get you back on track in a single post so that we can get back to the original issue. When the portal is shipped it comes with several properties files. The main one is called portal.properties and most of the time, it will have the properties that you want to override with your settings. You don't have to do it this way, but the convention is to create a file in your LIFERAY_HOME directory (the directory where you find /data, /deploy, /tomcat-xxxx) called portal-ext.properties -- and in this file provide the override settings. So if something in the portal.properties is ... enable.this.property.enabled=true and you want it to be false, then in the portal-ext.properties fie you would add a line --<br><br><pre><code>enable.this.property.enabled=false</code></pre><br><br>.. and when the server starts it will use your setting because the portal-ext properties are loaded AFTER the portal.properties during startup. The other files that you references, the -developer one and the -ide one, those are normally only used on a developers machine, or in a development environment. THe developer one for example disables a bunch of things to make debugging and diagnosing issues easier to trace, but the things that it disables also have a performance impact so you don't want that in prod (under normal circumstances)<br><br>So for now I would say you should remove the -Ide and the -developer properties and add a portal-ext to get back on track. Once you have done that try adding to the portal-ext the settings I referenced earlier, updating them to "domain" and adding your domain to the setting. See if that helps. If not, we can take it from there.</body></html>Andrew Jardine2017-08-03T16:21:53ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926510022017-08-03T16:02:12Z2017-08-03T16:02:12ZYes.... I'm a beginner <img alt="emoticon" src="@theme_images_path@/emoticons/sad.gif" ><br />Into production server I have to configure other settings ?Fabrizio Attanasio2017-08-03T16:02:12ZRE: Tomcat Liferay bundle unexpectedly closedAndrew Jardinehttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926509642017-08-03T15:55:38Z2017-08-03T15:55:38ZThis is how you have your production environment configured?Andrew Jardine2017-08-03T15:55:38ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926509312017-08-03T15:51:11Z2017-08-03T15:51:11Z<html><head></head><body>Hello Andrew,<br>I have this configuration :<br>Into root folder of liferay I have portal-ide.properties<br><pre><code>#Thu Apr 13 17:22:04 CEST 2017
json.service.auth.token.enabled=false
include-and-override=portal-developer.properties
auto.deploy.tomcat.conf.dir=/usr/local/liferay-portal-6.2-ce-ga5/tomcat-7.0.62/conf/Catalina/localhost
jsonws.web.service.public.methods=*
com.liferay.portal.servlet.filters.etag.ETagFilter=false
com.liferay.portal.servlet.filters.header.HeaderFilter=false
auto.deploy.interval=1000</code></pre><br><br>into portal-developer.properties:<br><br><pre><code>theme.css.fast.load=false
theme.images.fast.load=false
javascript.fast.load=true
javascript.log.enabled=false
layout.template.cache.enabled=false
velocity.engine.resource.manager.cache.enabled=false
com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=true
freemarker.engine.resource.modification.check.interval=0
minifier.enabled=false
browser.launcher.url=</code></pre><br><br>I have these custom files. I don't use portal-ext.properties</body></html>Fabrizio Attanasio2017-08-03T15:51:11ZRE: Tomcat Liferay bundle unexpectedly closedAndrew Jardinehttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926503302017-08-03T15:03:16Z2017-08-03T15:03:16Z<html><head></head><body>Hi Fabrizio,<br><br>You mentioned in the original post that you had no idea what portlet 49 was -- I was just saying that according to the source, it was a redirector portlet, hoping maybe that would give you a clue as to something (maybe a config?) that could be causing the issue. <br><br>Maybe you can provide for us you portal-ext.properties?<br><br>... in the mean time I started poking through the default portal.properties and found this <br><br><pre><code>##
## Redirect
##
#
# Set this property to "ip" or "domain" for the redirect security method. If
# set to "domain", the portal will only redirect users to domains listed in
# the property "redirect.url.domain.allowed". If set to "ip", the portal
# will only redirect to domains whose IP address resolve to an IP address
# listed in the property "redirect.url.ip.allowed".
#
#redirect.url.security.mode=domain
redirect.url.security.mode=ip
#
# Input a list of comma delimited domains which the portal is allowed to
# redirect to. Input a blank list to allow any domain.
#
redirect.url.domains.allowed=
#
# Input a list of comma delimited IPs which the portal is allowed to
# redirect to. Input a blank list to allow any IP. SERVER_IP will be
# replaced with the IP of the host server.
#
redirect.url.ips.allowed=127.0.0.1,SERVER_IP</code></pre><br><br>I am wondering if perhaps changing the redirect type to domain, and providing the value in the allowed property will help? The error itself looks like it might be coming from here --<br><br><pre><code>protected void check(HttpServletRequest request, Portlet portlet)
throws Exception {
if (portlet == null) {
return;
}
if (!isValidPortletId(portlet.getPortletId())) {
if (_log.isWarnEnabled()) {
_log.warn("Invalid portlet id " + portlet.getPortletId());
}
throw new PrincipalException();
}
if (portlet.isUndeployedPortlet()) {
return;
}
Layout layout = (Layout)request.getAttribute(WebKeys.LAYOUT);
if (layout.isTypeControlPanel()) {
isAccessAllowedToControlPanelPortlet(request, portlet);
return;
}
if (isAccessAllowedToLayoutPortlet(request, portlet)) {
PortalUtil.addPortletDefaultResource(request, portlet);
if (hasAccessPermission(request, portlet)) {
return;
}
}
throw new PrincipalException();
}
</code></pre><br><br>.. and I don't think it is the CSRF check because that error usually indicates the invalid token, so I think it might be the result of this check --<br><br><pre><code>protected void check(HttpServletRequest request, Portlet portlet)
throws Exception {
if (portlet == null) {
return;
}
if (!isValidPortletId(portlet.getPortletId())) {
if (_log.isWarnEnabled()) {
_log.warn("Invalid portlet id " + portlet.getPortletId());
}
throw new PrincipalException();
}
if (portlet.isUndeployedPortlet()) {
return;
}
Layout layout = (Layout)request.getAttribute(WebKeys.LAYOUT);
if (layout.isTypeControlPanel()) {
isAccessAllowedToControlPanelPortlet(request, portlet);
return;
}
if (isAccessAllowedToLayoutPortlet(request, portlet)) {
PortalUtil.addPortletDefaultResource(request, portlet);
if (hasAccessPermission(request, portlet)) {
return;
}
}
throw new PrincipalException();
}
</code></pre></body></html>Andrew Jardine2017-08-03T15:03:16ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926397112017-08-03T12:41:23Z2017-08-03T12:41:23ZHi Andrew,<br />sorry but i don't understand.....<br />Into tomcat liferay log file there is this :<br />08:35:34,166 WARN [http-bio-8081-exec-17][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/omniapp-manager on 49<br />08:57:15,439 WARN [http-bio-8081-exec-18][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/contattaci on 49<br />09:02:54,709 WARN [http-bio-8081-exec-6][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/chat-messaggistica on 49<br />09:10:53,558 WARN [http-bio-8081-exec-3][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/go2pa on 49<br />09:51:33,889 WARN [http-bio-8081-exec-17][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/costi on 49<br />10:21:08,397 WARN [http-bio-8081-exec-18][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/contattaci on 49<br />10:24:16,277 WARN [http-bio-8081-exec-14][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/creare-una-nuova-app on 49<br />11:07:08,130 ERROR [http-bio-8081-exec-14][ComboServlet:80] com.liferay.portal.ModulePathSetException: Modules paths set is empty<br />com.liferay.portal.ModulePathSetException: Modules paths set is empty<br /> at com.liferay.portal.servlet.ComboServlet.doService(ComboServlet.java:114)<br /> at com.liferay.portal.servlet.ComboServlet.service(ComboServlet.java:77)<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)<br /> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)<br />.....<br />......<br />....<br />11:07:08,253 ERROR [http-bio-8081-exec-14][status_jsp:753] Modules paths set is empty<br />11:19:25,916 WARN [http-bio-8081-exec-18][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/home on 49<br />12:22:55,525 WARN [http-bio-8081-exec-17][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/omniapp-shop on 49<br />13:31:09,561 WARN [http-bio-8081-exec-17][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/contattaci on 49<br />13:38:41,950 WARN [http-bio-8081-exec-14][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/privacy on 49<br />13:48:41,228 WARN [http-bio-8081-exec-19][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/contattaci on 49<br />14:07:19,385 WARN [http-bio-8081-exec-18][code_jsp:130] {code="404", msg="/go2pafavicon.ico", uri=/go2pafavicon.ico}<br />14:16:07,008 WARN [http-bio-8081-exec-11][SecurityPortletContainerWrapper:630] Reject process action for http://www.omniapp.it/costi on 49<br /><br />Do you think this can be?<br />Thank youFabrizio Attanasio2017-08-03T12:41:23ZRE: Tomcat Liferay bundle unexpectedly closedAndrew Jardinehttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926395612017-08-03T12:27:08Z2017-08-03T12:27:08Z<html><head></head><body>Portlet 49, according to the Liferay source (PortletKeys.java) is ...<br><br><pre><code> public static final String SITE_REDIRECTOR = "49";</code></pre><br><br>Maybe knowing that will trigger an "a-ha!" moment?</body></html>Andrew Jardine2017-08-03T12:27:08ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926344282017-08-03T10:16:44Z2017-08-03T10:16:44ZI run ps command and it should be just the two tomcat to require more memory. (see screenshot)<br />I will try with jconsole for more information.<br />Thank you,Fabrizio Attanasio2017-08-03T10:16:44ZRE: Tomcat Liferay bundle unexpectedly closedOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926268472017-08-03T08:36:04Z2017-08-03T08:36:04ZJust because the operating system allocates 7G of memory doesn't mean that it's Java or Tomcat that allocates it. The value you get from "free -m" doesn't help you at all to debug Java Memory problems.<br /><br />You might go through the many options of "ps" to get a report on how much Java actually uses, or read about jconsole and how to connect it to your running installation: This will give you a lot more insight. However, you should really first find out the root cause for your unexpected closing. It might be memory, or it might be something else. Read the log files, monitor the server closely. <br /><br />It might be one of those phantoms where the cleaning people come through every week during the night and unplug the server in order to plug in the vacuum cleaner. Seriously, nothing other than you bringing in memory points to memory being an issue: You'd see a clear "OutOfMemoryError" in the logs if it was.Olaf Kock2017-08-03T08:36:04ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926244362017-08-03T07:41:42Z2017-08-03T07:41:42ZHi Olaf,<br />thank you. My settings are:<br />ORACLE JAVA 8<br />UBUNTU 12.04 64 bit<br /><br />Setenv.sh settings of tomcat liferay :<br />CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=Europe/Rome -Xmx2048m"<br /><br />Do you think that -Xmx2048m is the problem ? What settings should I put?<br />Thank you, bye bye and sorry for my english <img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" > ;)Fabrizio Attanasio2017-08-03T07:41:42ZRE: Tomcat Liferay bundle unexpectedly closedOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926087552017-08-02T21:42:50Z2017-08-02T21:42:50ZWhen tomcat allocates 7.5G RAM, you either have other effective settings than "-Xmx2048m -XX:MaxPermSize=512m" or you're using some native component that allocates memory outside of the JVM pool. While the given limit is rarely exact, specifying a maximum of 2G will, in my experience, not lead to a 7.5G memory allocation. Do you specify -Xms3g, so that the initial allocation is larger than the maximum allocation? I've never tried it, but it would be a fun bug: The VM would never pass the maximum border as it's already above - but I doubt that this is an actual JVM bug.<br /><br />The garbage collector works when required - e.g. if you accidentally specified -Xmx2048g, it wouldn't need to execute until the memory limit is reached.<br /><br />It makes sense to also look at the exact Java version you're running. Check if there are known bugs with regards to memory handling (and/or make sure you're running the latest). Which version are you running anyways? Java8 wouldn't understand -XX:MaxPermSize any more.Olaf Kock2017-08-02T21:42:50ZRE: Tomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=926086652017-08-02T21:24:13Z2017-08-02T21:24:13ZHi, thank you.<br />No I doesn't do hot deploy.<br />After a few days I opted to transfer everything to a server with 10Gb RAM. Because I noticed that tomcat did not go to Permgen but it was the system that closed the liferay process.<br />Now having 10 Gb of RAM. When I start tomcat, it allocate 3 Gb RAM.......after two days it allocate 7.5 Gb. I do not understand what it is. Does the garbage collector not work?<br />Thank youFabrizio Attanasio2017-08-02T21:24:13ZRE: Tomcat Liferay bundle unexpectedly closedDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=923566562017-07-27T22:58:06Z2017-07-27T22:58:06ZYou might try GA6 instead of GA5...<br /><br />Are you doing any hot deployments during this 5 or 6 day period?<br /><br /><br /><br /><br /><br /><br /><br /><br />Come meet me at <a href="https://www.eventbrite.com/e/liferay-devcon-2017-registration-29348597445">Devcon 2017</a> or <a href="https://www.eventbrite.com/e/liferay-symposium-north-america-2017-registration-28398031276">2017 LSNA!</a>David H Nebinger2017-07-27T22:58:06ZTomcat Liferay bundle unexpectedly closedFabrizio Attanasiohttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=923275502017-07-27T10:21:25Z2017-07-27T10:21:25ZGoodmorning everyone,<br />I have a problem that is making me crazy. In practice I put in production a liferay-portal-6.2-ce-ga5 with included tomcat.<br />I have set the tomcat jvm variables as follows:<br />-Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Xmx2048m -XX:MaxPermSize=512m"<br /><br />When I start the portal, everything works perfectly. After about 5-6 days periodically the tomcat "dies". Reading the logs I find no reference to Permgen error etc ... so I can not understand what can happen to tomcat or liferay so much so that it will close it and not find it even in memory processes.<br /><br />The only warning I find in logs is this annoying message:<br />23:12:19,231 WARN http-bio-8081-exec-128SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/servizi on 49<br />23:54:25,796 WARN http-bio-8081-exec-125SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/privacy on 49<br />23:59:04,251 WARN http-bio-8081-exec-130SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/costi on 49<br />00:27:28,147 WARN http-bio-8081-exec-107SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/home on 49<br />01:10:12,528 WARN http-bio-8081-exec-125SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/privacy on 49<br />01:26:29,955 WARN http-bio-8081-exec-125SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/home on 49<br />01:47:37,026 WARN http-bio-8081-exec-140SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/contattaci on 49<br />02:25:59,527 WARN http-bio-8081-exec-125SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/contattaci on 49<br />03:41:49,275 WARN http-bio-8081-exec-130SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/richiedi-una-demo on 49<br />04:57:34,017 WARN http-bio-8081-exec-130SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/richiedi-una-demo on 49<br />05:22:03,960 WARN http-bio-8081-exec-125SecurityPortletContainerWrapper:630 Reject process action for http://www.omniapp.it/go2pa on 49<br />05