Foros de discusión

Using EXT plugin extend or provide the same fully qualified name of class?

thumbnail
Paul ., modificado hace 11 años.

Using EXT plugin extend or provide the same fully qualified name of class?

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
Trying to understand EXT plugin , how it works. Is it a better idea to Extend the class that I want to change or I have to provide the same fully qualified class name. In the second case, does it not rely on classloader loading in some order which is high risk, in case it it doesn't load the class the in the correct order?
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Using EXT plugin extend or provide the same fully qualified name of cla

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Ext plugin actually overwrite files when it is deployed. Information of ext plugin is available from the following page:

http://www.liferay.com/community/wiki/-/wiki/Main/Ext+Plugin
thumbnail
Paul ., modificado hace 11 años.

RE: Using EXT plugin extend or provide the same fully qualified name of cla

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
Hitoshi,

Thanks for the quick reply. I have gone through the documentation, but looking for some more underlying details. How in a class would overwrite another ? Can it be relied through classloader? the order of loading the same named class, just being in different jar? So there may be cases where the order of loading doesn't actually achieve what is expected? especially in linux environment. for instance, in here : http://www.liferay.com/community/forums/-/message_boards/message/341892
If it doesn't work, try to remove all JAR files from WEB-INF/lib, then first of all copy ext-impl.jar, then copy all rest JAR files. It works for me on CentOS, SUSE, and RedHat; using Tomcat. ext-impl.jar must be physically located before portal-impl.jar.


Is that the only / right way of ensuring it?
thumbnail
Paul ., modificado hace 11 años.

RE: Using EXT plugin extend or provide the same fully qualified name of cla

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
Any more details?
thumbnail
Paul ., modificado hace 11 años.

RE: Using EXT plugin extend or provide the same fully qualified name of cla

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
If anyone is interested in how it works, I checked and it classloader loads the jar files in alphabetical order. So that "ext-" jar file in portal's lib is always before "portal-" files and those are loaded, the classloader then ignores the same classes (in portal-) as they are already loaded from ext-