Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Instanceable Liferay / Vaadin Portlet
Can Vaadin portlets be instanceable? If I put 2 of the same Vaaadin 7 portlets on the same page, 1 of them displays correctly and the other one throws an exception.
Caused by: java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:155)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1260)
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:460)
at com.vaadin.server.VaadinSession.unlock(VaadinSession.java:1004)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:43)
at com.vaadin.server.communication.PortletBootstrapHandler.handleRequest(PortletBootstrapHandler.java:48)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1409)
I am using Liferay 6.2 and Vaadin 7.6.
So Vaadin doesn't know anything about portlet namespacing (IIRC), the facility which allows two instantiable portlets to live on a page w/o stepping all over each other.
So likely answer is going to be no, simply because the JS is going to be looking for specific element IDs/classes which would collide for an instantiable Vaadin portlet.
So I have a fix / hack that solved the issue. I created a custom VaadinPortletService that overrides the getServiceName method to return the portletId if available. The only time portletId is not available is at startup.
Everything seems to be working OK. I will continue to test this fix.
Thanks Gordon. You save me.
I had to do it in vaadin 7.6.4
I am using Liferay 6.1.2 with Vaadin 7.4.6 more than one year.
Yesterday I upgrade to Vaadin 7.6.6 and I start getting the same exception:
2016/06/24 09:50:46.879 [http-nio-8080-exec-6] ERROR com.spribo.vaadin.portlet.SpriboErrorHandler - Unmanaged exception!
java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151) ~[?:1.8.0_77]
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261) ~[?:1.8.0_77]
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457) ~[?:1.8.0_77]
at com.vaadin.server.VaadinSession.unlock(VaadinSession.java:1005) ~[vaadin-server-7.6.6.1.jar:?]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:43) ~[vaadin-server-7.6.6.1.jar:?]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1409) [vaadin-server-7.6.6.1.jar:?]
at com.vaadin.server.VaadinPortlet.handleRequest(VaadinPortlet.java:544) [vaadin-server-7.6.6.1.jar:?]
at com.vaadin.server.VaadinPortlet.serveResource(VaadinPortlet.java:626) [vaadin-server-7.6.6.1.jar:?]
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:122) [portal-impl-6.1.2.5.jar:?]
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:82) [portal-impl-6.1.2.5.jar:?]
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:116) [portal-impl-6.1.2.5.jar:?]
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71) [portal-service.jar:?]
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111) [portal-service.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [servlet-api.jar:?]
Anyone knows why?
I am still using Liferay 6.1.2 with Vaadin 7.4.6.
Today I'd upgrate to Vaadin 7.7.0 and I have the same exception:
2016/09/05 10:44:39.540 [http-nio-8080-exec-3] ERROR com.spribo.vaadin.portlet.SpriboErrorHandler - Unmanaged exception!
java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:151) ~[?:1.8.0_77]
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1261) ~[?:1.8.0_77]
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:457) ~[?:1.8.0_77]
at com.vaadin.server.VaadinSession.unlock(VaadinSession.java:1005) ~[vaadin-server-7.7.0.jar:7.7.0]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:43) ~[vaadin-server-7.7.0.jar:7.7.0]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1414) [vaadin-server-7.7.0.jar:7.7.0]
at com.vaadin.server.VaadinPortlet.handleRequest(VaadinPortlet.java:544) [vaadin-server-7.7.0.jar:7.7.0]
at com.vaadin.server.VaadinPortlet.serveResource(VaadinPortlet.java:626) [vaadin-server-7.7.0.jar:7.7.0]
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:122) [portal-impl-6.1.2.7.jar:?]
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:82) [portal-impl-6.1.2.7.jar:?]
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:116) [portal-impl-6.1.2.7.jar:?]
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71) [portal-service.jar:?]
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111) [portal-service.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) [servlet-api.jar:?]
...
Its a blocker to upgrade Vaadin. Anyone in Vaadin team can help me?