Spring MVC portlet cannot be deployed to the Liferay 7.2 Portal

majdi Achouri, modified 5 Years ago. Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
Hello everyone
I'm migrating a  spring mvc 6.2 portlet to a spring mvc 7.2 portlet, I detected that the architecture is a little bit different between both, for that I created a new spring mvc-7.2 portlet with blade  using this   < blade create -t spring-mvc-portlet -v 7.2 -p packageTest -c classTestName first-Lr7-portlet -b maven > and do the upgrade manually by copying the js, css, liferay's xml config file.
The problem is when I deploy this portlet in deploy folder of distant liferay server it showed me the following log: 



Also, I specified in the liferay-plugin-package.properties that   " liferay-versions=7.0.0+,7.1.0+,7.2.0+ " .
this is the portlet architecture: 


Any advice or recommendation please, thank you...
thumbnail
Alberto Chaparro, modified 5 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Hi Madji,
Spring pruned Spring MVC in its newer versions so Liferay adopted the project. For this reason, be sure you have followed these guidelines during the upgrade of your portlet to 7.2:
https://github.com/liferay/portletmvc4spring/blob/master/README.md

I hope it helps.

Cheers! 
majdi Achouri, modified 5 Years ago. Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
Hi Alberto

Thank you for the reply,
I followed your recommendation and I just use the portletmvc4spring( this one : https://github.com/liferay/portletmvc4spring/tree/master/demo/applicant-jsp-portlet ) as a base portlet and build the war and deploy it into the server, I got the same error ( can't deploy it anymore ) in the Lr7.2 Ce ga1 instance 



This is the trace when deploying the war file in the deploy folder:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1746"
Exception in thread "ajp-nio-8009-exec-1749" Exception in thread "ajp-nio-8009-exec-1765" Exception in thread "ajp-nio-8009-exec-1756" Exception in thread "ajp-nio-8009-exec-1757" Exception in thread "ajp-nio-8009-exec-1750" Exception in thread "liferay/scheduler_dispatch-375" Exception in thread "ajp-nio-8009-exec-1753" Exception in thread "ajp-nio-8009-exec-1767" Exception in thread "ajp-nio-8009-exec-1769" Exception in thread "ajp-nio-8009-exec-1738" Exception in thread "ajp-nio-8009-exec-1797"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1749"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1765"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1750"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "liferay/scheduler_dispatch-375"
Exception in thread "ajp-nio-8009-exec-1747"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1753"
Exception in thread "ajp-nio-8009-exec-1795"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1767"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1769"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1738"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1756"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1757"
Exception in thread "ajp-nio-8009-exec-1780" Exception in thread "ajp-nio-8009-exec-1768" Exception in thread "ajp-nio-8009-exec-1752" Exception in thread "ajp-nio-8009-exec-1761"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1797"
Exception in thread "ajp-nio-8009-exec-1751"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1752"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1747"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1761"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1795"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1780"
Exception in thread "ajp-nio-8009-exec-1754" Exception in thread "ajp-nio-8009-exec-1741"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1768"
Exception in thread "ajp-nio-8009-exec-1766" Exception in thread "ajp-nio-8009-exec-1770" Exception in thread "ajp-nio-8009-exec-1743"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1751"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1754"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1743"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1770"
2020-01-06 11:48:55.354 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:261] Processing com.liferay.portletmvc4spring.demo.applicant.jsp.portlet-5.2.1-SNAPSHOT.warException: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1741"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1766"
2020-01-06 11:50:01.622 WARN  [HikariPool-1 housekeeper][HikariPool:686] HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=14m11s23ms494µs69ns).

Cheers
thumbnail
Olaf Kock, modified 5 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
majdi Achouri:

This is the trace when deploying the war file in the deploy folder:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1746"

No matter what you do to the code: You're running out of memory. What are your appserver settings - have you tried raising the available memory for the process?
majdi Achouri, modified 5 Years ago. Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
Olaf Kock:

majdi Achouri:

This is the trace when deploying the war file in the deploy folder:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ajp-nio-8009-exec-1746"

No matter what you do to the code: You're running out of memory. What are your appserver settings - have you tried raising the available memory for the process?


Thanks to all for the recommendations,
Olaf you are right the problem was in the setenv.sh file after checking the size of the MetaSpaceSize It was 512m I changed it to 4G and It is working for now. 
​​​​​​​+1 . 
thumbnail
Olaf Kock, modified 5 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
majdi Achouri:

Olaf you are right the problem was in the setenv.sh file after checking the size of the MetaSpaceSize It was 512m I changed it to 4G and It is working for now. ​​​​​
times 8? Wow. I typically double such settings, and especially the Metaspace I'd not expect to grow that dramatically. If you have that memory available: Fine. At least it shouldn't be the bottleneck any time soon any more ;)