Rafik H 10 Years Ago 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 Please sign in to reply. Reply as... Cancel Peter Mesotten Rafik H 10 Years Ago - Edited @Rafik: That is correct. You passed the exam! :-) Please sign in to reply. Reply as... Cancel Rafik H Peter Mesotten 10 Years Ago Good Please sign in to reply. Reply as... Cancel Kailash Yadav Rafik H 10 Years Ago 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? Please sign in to reply. Reply as... Cancel Kailash Yadav Kailash Yadav 10 Years Ago I got the answer I was wrong Please sign in to reply. Reply as... Cancel Luboš Vrba Kailash Yadav 8 Years Ago Because the JAR is already in ROOT's lib directory Please sign in to reply. Reply as... Cancel Michal Sima Rafik H 9 Years Ago Does silence of Peter implies his consent? ;-) Are those answers correct? Please sign in to reply. Reply as... Cancel Michal Sima Rafik H 9 Years Ago Does silence of Peter implies his consent? ;-) Are those answers correct? Please sign in to reply. Reply as... Cancel Peter Mesotten Michal Sima 9 Years Ago @Michal, as I've confirmed before in this thread the answers of Rafik are correct indeed :-) Please sign in to reply. Reply as... Cancel
Peter Mesotten Rafik H 10 Years Ago - Edited @Rafik: That is correct. You passed the exam! :-) Please sign in to reply. Reply as... Cancel Rafik H Peter Mesotten 10 Years Ago Good Please sign in to reply. Reply as... Cancel
Kailash Yadav Rafik H 10 Years Ago 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? Please sign in to reply. Reply as... Cancel Kailash Yadav Kailash Yadav 10 Years Ago I got the answer I was wrong Please sign in to reply. Reply as... Cancel Luboš Vrba Kailash Yadav 8 Years Ago Because the JAR is already in ROOT's lib directory Please sign in to reply. Reply as... Cancel
Kailash Yadav Kailash Yadav 10 Years Ago I got the answer I was wrong Please sign in to reply. Reply as... Cancel
Luboš Vrba Kailash Yadav 8 Years Ago Because the JAR is already in ROOT's lib directory Please sign in to reply. Reply as... Cancel
Michal Sima Rafik H 9 Years Ago Does silence of Peter implies his consent? ;-) Are those answers correct? Please sign in to reply. Reply as... Cancel
Michal Sima Rafik H 9 Years Ago Does silence of Peter implies his consent? ;-) Are those answers correct? Please sign in to reply. Reply as... Cancel Peter Mesotten Michal Sima 9 Years Ago @Michal, as I've confirmed before in this thread the answers of Rafik are correct indeed :-) Please sign in to reply. Reply as... Cancel
Peter Mesotten Michal Sima 9 Years Ago @Michal, as I've confirmed before in this thread the answers of Rafik are correct indeed :-) Please sign in to reply. Reply as... Cancel
Tejas Kanani 10 Years Ago Great Article with nice coverage of Liferay Classloading principles !!! Please sign in to reply. Reply as... Cancel
Balaji Murugesan 9 Years Ago Nice write up.. Got a clear understanding of Liferay's classpath Please sign in to reply. Reply as... Cancel
Tom Wilbourn 9 Years Ago 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. Please sign in to reply. Reply as... Cancel Peter Mesotten Tom Wilbourn 9 Years Ago @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. Please sign in to reply. Reply as... Cancel
Peter Mesotten Tom Wilbourn 9 Years Ago @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. Please sign in to reply. Reply as... Cancel
Niccolò Pasquetto 9 Years Ago 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. Please sign in to reply. Reply as... Cancel
cao wei 9 Years Ago 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? Please sign in to reply. Reply as... Cancel Peter Mesotten cao wei 9 Years Ago 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 Please sign in to reply. Reply as... Cancel
Peter Mesotten cao wei 9 Years Ago 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 Please sign in to reply. Reply as... Cancel
Arunjyoti Banik 9 Years Ago @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. Please sign in to reply. Reply as... Cancel Peter Mesotten Arunjyoti Banik 9 Years Ago @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. Please sign in to reply. Reply as... Cancel Arunjyoti Banik Peter Mesotten 9 Years Ago @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. Please sign in to reply. Reply as... Cancel
Peter Mesotten Arunjyoti Banik 9 Years Ago @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. Please sign in to reply. Reply as... Cancel Arunjyoti Banik Peter Mesotten 9 Years Ago @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. Please sign in to reply. Reply as... Cancel
Arunjyoti Banik Peter Mesotten 9 Years Ago @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. Please sign in to reply. Reply as... Cancel
Vignesh Kumar 8 Years Ago For the first question answer->d Please sign in to reply. Reply as... Cancel Vignesh Kumar Vignesh Kumar 8 Years Ago 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 Please sign in to reply. Reply as... Cancel
Vignesh Kumar Vignesh Kumar 8 Years Ago 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 Please sign in to reply. Reply as... Cancel
(You) 8 Years Ago [...] 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 Please sign in to reply. Reply as... Cancel
(You) 6 Years Ago [...] 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 Please sign in to reply. Reply as... Cancel