Rafik H Hace 10 años Great article Peter !!Can you confirm answers for the questions:1 -- d : because jsp hook are runnig in portal classloader.2 -- a, b : because service hook is running in hook's classloader.3 -- a, c, d Por favor identifíquese para votar. Contestar como... Cancelar Peter Mesotten Rafik H Hace 10 años - Editado @Rafik: That is correct. You passed the exam! :-) Por favor identifíquese para votar. Contestar como... Cancelar Rafik H Peter Mesotten Hace 10 años Good Por favor identifíquese para votar. Contestar como... Cancelar Kailash Yadav Rafik H Hace 10 años Why not option 'c' in Questions 1 and 2? Portal and portlets also have access of lib/ext (global classpath). Please currect me if I am wrong? Por favor identifíquese para votar. Contestar como... Cancelar Kailash Yadav Kailash Yadav Hace 10 años I got the answer I was wrong Por favor identifíquese para votar. Contestar como... Cancelar Luboš Vrba Kailash Yadav Hace 8 años Because the JAR is already in ROOT's lib directory Por favor identifíquese para votar. Contestar como... Cancelar Michal Sima Rafik H Hace 9 años Does silence of Peter implies his consent? ;-) Are those answers correct? Por favor identifíquese para votar. Contestar como... Cancelar Michal Sima Rafik H Hace 9 años Does silence of Peter implies his consent? ;-) Are those answers correct? Por favor identifíquese para votar. Contestar como... Cancelar Peter Mesotten Michal Sima Hace 9 años @Michal, as I've confirmed before in this thread the answers of Rafik are correct indeed :-) Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten Rafik H Hace 10 años - Editado @Rafik: That is correct. You passed the exam! :-) Por favor identifíquese para votar. Contestar como... Cancelar Rafik H Peter Mesotten Hace 10 años Good Por favor identifíquese para votar. Contestar como... Cancelar
Rafik H Peter Mesotten Hace 10 años Good Por favor identifíquese para votar. Contestar como... Cancelar
Kailash Yadav Rafik H Hace 10 años Why not option 'c' in Questions 1 and 2? Portal and portlets also have access of lib/ext (global classpath). Please currect me if I am wrong? Por favor identifíquese para votar. Contestar como... Cancelar Kailash Yadav Kailash Yadav Hace 10 años I got the answer I was wrong Por favor identifíquese para votar. Contestar como... Cancelar Luboš Vrba Kailash Yadav Hace 8 años Because the JAR is already in ROOT's lib directory Por favor identifíquese para votar. Contestar como... Cancelar
Kailash Yadav Kailash Yadav Hace 10 años I got the answer I was wrong Por favor identifíquese para votar. Contestar como... Cancelar
Luboš Vrba Kailash Yadav Hace 8 años Because the JAR is already in ROOT's lib directory Por favor identifíquese para votar. Contestar como... Cancelar
Michal Sima Rafik H Hace 9 años Does silence of Peter implies his consent? ;-) Are those answers correct? Por favor identifíquese para votar. Contestar como... Cancelar
Michal Sima Rafik H Hace 9 años Does silence of Peter implies his consent? ;-) Are those answers correct? Por favor identifíquese para votar. Contestar como... Cancelar Peter Mesotten Michal Sima Hace 9 años @Michal, as I've confirmed before in this thread the answers of Rafik are correct indeed :-) Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten Michal Sima Hace 9 años @Michal, as I've confirmed before in this thread the answers of Rafik are correct indeed :-) Por favor identifíquese para votar. Contestar como... Cancelar
Harish Kumar Hace 10 años Nice Explanation! Por favor identifíquese para votar. Contestar como... Cancelar
Tejas Kanani Hace 10 años Great Article with nice coverage of Liferay Classloading principles !!! Por favor identifíquese para votar. Contestar como... Cancelar
Balaji Murugesan Hace 10 años Nice write up.. Got a clear understanding of Liferay's classpath Por favor identifíquese para votar. Contestar como... Cancelar
Tom Wilbourn Hace 10 años What versions of Liferay is this true? Are the jars loaded from the temp directory if running in tomcat? We've also had issues where one portlet had an older version of a dependency and this was loaded in the classpath for a different portlet which had a newer version of the dependency instead of the newer version. This really caused a problem. Our dependencies are managed by maven and the jars include the version in the names. Por favor identifíquese para votar. Contestar como... Cancelar Peter Mesotten Tom Wilbourn Hace 10 años @Tom- The principles are not bound to a certain Liferay version. However, between different application servers there might be small variations. E.g. Jboss packages a lot more JAR files in the "global" classpath than Tomcat.- The JAR files are never loaded from temp. Maven imposes a problem indeed if you upgraded a dependency but didn't do a clean deploy. A clean deploy means, deleting the portlet/hook from the webapps folder of Tomcat before redeploying the WAR file. In our Liferay team, this is the standard procedure for deploying portlets and hooks. Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten Tom Wilbourn Hace 10 años @Tom- The principles are not bound to a certain Liferay version. However, between different application servers there might be small variations. E.g. Jboss packages a lot more JAR files in the "global" classpath than Tomcat.- The JAR files are never loaded from temp. Maven imposes a problem indeed if you upgraded a dependency but didn't do a clean deploy. A clean deploy means, deleting the portlet/hook from the webapps folder of Tomcat before redeploying the WAR file. In our Liferay team, this is the standard procedure for deploying portlets and hooks. Por favor identifíquese para votar. Contestar como... Cancelar
Niccolò Pasquetto Hace 9 años Wonderful article Peter, a really "basic" article. If I can afford a hint, in question number 2 I would repeat that poi.jar is included in ROOT/WEB-INF/lib. Por favor identifíquese para votar. Contestar como... Cancelar
AYED Chekib Hace 9 años Thank you for this article. Por favor identifíquese para votar. Contestar como... Cancelar
cao wei Hace 9 años HI Peter, Thanks for your nice article, but i'm confused when i share services among multiple portlets, in this case portlets seems can access other portlet's implementation class. This conflicts with your article that war can't see each other in liferay.Example:I have a Plugin common-service.war, in this plugin, i use liferay service builder to generate the service layer, and separate it into common-service.jar and common-service-impl.jar (those *impl.class)and i have another plugin myPortlet.war, i defines required-deployment-contexts=common-service and include common-service.jar in the myPortlet.war's library. This way, myPortlet can invoke the services provided by common-service.war. Please note that common-service-impl.jar is NOT included in the myPortlet.war.As two war files can't see each other during runtime, why myPortlet.war can invoke the service from common-service.war, the implementation class common-service-impl.jar is not available to myPortlet.war?I guess liferay uses some special class loading for this scenarios?Peter, any advice on this? Por favor identifíquese para votar. Contestar como... Cancelar Peter Mesotten cao wei Hace 9 años Hi,Excellent question! Indeed, the servlet specification doesn't allow WAR files to see each other's classes. Therefore the classloader of portlet X would normally not be accessible for portlet Y.However, Liferay circumvents this by introducing classloader proxies (CLPs). So I guess you're right that Liferay performs some magic to make this work. For your reference, this link describes the principle more in depth: http://agile-reflections.opnworks.com/2012/04/sharing-classes-between-liferay-plugins.html Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten cao wei Hace 9 años Hi,Excellent question! Indeed, the servlet specification doesn't allow WAR files to see each other's classes. Therefore the classloader of portlet X would normally not be accessible for portlet Y.However, Liferay circumvents this by introducing classloader proxies (CLPs). So I guess you're right that Liferay performs some magic to make this work. For your reference, this link describes the principle more in depth: http://agile-reflections.opnworks.com/2012/04/sharing-classes-between-liferay-plugins.html Por favor identifíquese para votar. Contestar como... Cancelar
Arunjyoti Banik Hace 9 años @Peter ........... I need a bit of info. I created a DefaultLandingPageAction.java through a hook plugin inside a package com.hook.test.path. I just took the sourcecode of this file and introduced two variables there so that they can be used in setting landing page path in portal-ext.properties. I also added these two properties::override.default.landing.page.path=true;login.events.post=com.liferay.portal.events.ChannelLoginPostAction,com.hook.test.path.DefaultLandingPageAction,com.liferay.portal.events.LoginPostAction.As usual I had the classloading problem, since my java file isnt in portal-impl.jar. I just want to know what else I have to do? And what is the use of overiding the path variable mentioned here:: https://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Customizing%20the%20default%20page%20after%20login. Por favor identifíquese para votar. Contestar como... Cancelar Peter Mesotten Arunjyoti Banik Hace 9 años @Arunjyoti,I'm not sure what you're trying to accomplish in your custom landing page action, but in 99% of the cases you can work around a dependency on classes from portal-impl.jar. Could you post (or PM) the code for your DefaultLandingPageAction, so I can take a look and see where internal references could be replaced by service-level references. Por favor identifíquese para votar. Contestar como... Cancelar Arunjyoti Banik Peter Mesotten Hace 9 años @Peter ........... I solved it. I had wrongly made my class under Struts Action. And with the code I modified, I can land into the group page, a user is assigned. Now I am working on which group page a user wants to land if he is assigned to multiple groups, based upon his choice. Por favor identifíquese para votar. Contestar como... Cancelar
Peter Mesotten Arunjyoti Banik Hace 9 años @Arunjyoti,I'm not sure what you're trying to accomplish in your custom landing page action, but in 99% of the cases you can work around a dependency on classes from portal-impl.jar. Could you post (or PM) the code for your DefaultLandingPageAction, so I can take a look and see where internal references could be replaced by service-level references. Por favor identifíquese para votar. Contestar como... Cancelar Arunjyoti Banik Peter Mesotten Hace 9 años @Peter ........... I solved it. I had wrongly made my class under Struts Action. And with the code I modified, I can land into the group page, a user is assigned. Now I am working on which group page a user wants to land if he is assigned to multiple groups, based upon his choice. Por favor identifíquese para votar. Contestar como... Cancelar
Arunjyoti Banik Peter Mesotten Hace 9 años @Peter ........... I solved it. I had wrongly made my class under Struts Action. And with the code I modified, I can land into the group page, a user is assigned. Now I am working on which group page a user wants to land if he is assigned to multiple groups, based upon his choice. Por favor identifíquese para votar. Contestar como... Cancelar
arti gupta Hace 9 años Great explanation !!!!!! Por favor identifíquese para votar. Contestar como... Cancelar
Vignesh Kumar Hace 8 años For the first question answer->d Por favor identifíquese para votar. Contestar como... Cancelar Vignesh Kumar Vignesh Kumar Hace 8 años Can anyone explain what will happen if put the jar file in both location tomcat/lib/ext and root/web-inf/lib.I am new to liferay.It will be much helpful for me if i understand this...Please Response quick Por favor identifíquese para votar. Contestar como... Cancelar
Vignesh Kumar Vignesh Kumar Hace 8 años Can anyone explain what will happen if put the jar file in both location tomcat/lib/ext and root/web-inf/lib.I am new to liferay.It will be much helpful for me if i understand this...Please Response quick Por favor identifíquese para votar. Contestar como... Cancelar
John Voltaire Maximo Hace 8 años great! Por favor identifíquese para votar. Contestar como... Cancelar
(Usted) Hace 8 años [...] Olá pessoal, tudo bem? eu estou com vários portlets que utilizam o hibernate, e ate então as lib's do hibernate estão dentro de cada portlet. Todos os portlets funcionam muito bem. O problema é o... [...] Read More Por favor identifíquese para votar. Contestar como... Cancelar
(Usted) Hace 6 años [...] There is no shortcut. Don’t rely on any sample questions online(including this post) completely. Best way to prepare is to practice tutorial here . Even the experienced developers should try to go... [...] Read More Por favor identifíquese para votar. Contestar como... Cancelar