Skip to content

Instantly share code, notes, and snippets.

View tmoreira2020's full-sized avatar

Thiago Leão Moreira tmoreira2020

View GitHub Profile
@Component(immediate = true, property = {
"type=" + TemplateContextContributor.TYPE_GLOBAL }, service = TemplateContextContributor.class)
public class SabespTemplateContextContributor implements TemplateContextContributor {
protected WheatherService wheatherService;
@Override
public void prepare(Map<String, Object> contextObjects, HttpServletRequest request) {
contextObjects.put("wheaterService", wheatherService);
contextObjects.put("stringService", "teste");
x20-Feb-2019 00:12:48.590 SEVERE [http-nio2-8080-exec-4] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet [Main Servlet] threw exception
java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-1.8.0-amazon-corretto/jre/lib/amd64/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:61)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerNativeLibrary.<clinit>(FontManagerNativeLibrary.java:32)
@tmoreira2020
tmoreira2020 / MainConverter.java
Created February 11, 2020 11:37
Utility class to check and convert a database with lowercase table names to camelcase
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.Statement;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
public class MainConverter {
@tmoreira2020
tmoreira2020 / setup-regions-for-brazil.groovy
Created February 21, 2020 19:49
Populate Regions for Brazil
// ### Groovy Sample ###
countryId=48;
com.liferay.portal.kernel.service.RegionServiceUtil.addRegion(countryId, "AL", "Alagoas", true);
com.liferay.portal.kernel.service.RegionServiceUtil.addRegion(countryId, "AM", "Amazonas", true);
com.liferay.portal.kernel.service.RegionServiceUtil.addRegion(countryId, "AP", "Amapá", true);
com.liferay.portal.kernel.service.RegionServiceUtil.addRegion(countryId, "BA", "Bahia", true);
com.liferay.portal.kernel.service.RegionServiceUtil.addRegion(countryId, "CE", "Ceará", true);
com.liferay.portal.kernel.service.RegionServiceUtil.addRegion(countryId, "DF",
"Distrito Federal", true);
@tmoreira2020
tmoreira2020 / gist:9bc5dd872136a627717c222a44025f28
Created October 6, 2021 15:08
UnsupportedOperationException: Requires 3.0 opt-in
liferay_1 | 2021-10-06 15:05:09.650 ERROR [http-nio-8080-exec-10][BaseJSPPanelCategory:101] Unable to include /content/content.jsp
liferay_1 | org.apache.jasper.JasperException: java.lang.UnsupportedOperationException: Requires 3.0 opt-in
liferay_1 | at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:440)
liferay_1 | at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
liferay_1 | at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
liferay_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
liferay_1 | at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:368)
liferay_1 | at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:380)
liferay_1 | at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
liferay_1 | at org.eclipse.equinox.http.servlet.int