Jack Bakker:
liferay-plugin-package.properties approach does a copy of the jar that is referenced ?
Well, I think it's actually the IDE that does the copying, but yes the service jar ends up in the service consumer portlet's WEB-INF/lib directory. It's a nice feature of the build process (IMHO), but I do wish they would integrate the same thing into the ant build and/or hot deploy.
I haven't fully evaluated performance to compare 1) move service jar to global or 2) do the liferay-plugin-package.properties approach
Well, to put to global you must shut down the server. In fact, every update deployed requires a shutdown cuz you then have to manually move the service jar update to the global directory. Quite a pain in the butt to have to do this manual stuff, even if you're in a cluster.
The liferay-plugin-package.properties file approach does not require the restart, but it does have other peculiarities:
- The IDE will copy the updated service jar to all open projects in the IDE when the service.xml is built. I normally use the IDE's "Build Service" button on the gui service.xml editor, and I think it is either that gui editor or the Liferay IDE's handling of the liferay-plugin-package.properties file that does the copying, and not the ant scripts, bug Greg would probably be the one to ask. Since this is not a deployment action, it's restricted to other plugin projects in the IDE, and you have to have the service providing plugin project open (even if you're not the primary developer on that project).
- You must re-deploy the plugins that are consumers when a service jar update occurs in some cases. I say in some cases, because it primarily depends upon whether the signatures for the methods/entities the consumer uses change. If I have a plugin that uses an Employee entity and methods from the service jar, and I deploy this guy, but then I add a Manager entity and methods to the service jar but do not change anything w/ Employee, the plugin does not have to be redeployed (it will look up and use the Employee stuff from the older version of the service jar even though a newer implementation may have been deployed).
- You can end up w/ multiple versions of the service jar floating around. This can happen as a result of the bullet above, in fact I've got a bunch of different versions floating around on the deployed system. So far I haven't seen any issues from this, but it is something that should be noted. It's easy to clean up, though, by refreshing/redeploying the dependent portlets after the service portlet was updated and deployed, but that's a lot of extra deployments that may not be necessary.
- On the upside, Liferay will suspend the startup of a plugin that has a listed required deployment context on another plugin until that plugin is successfully loaded. Can save on some of the "BeanLocator is null" errors, but also means if the service provider fails to start up, all of the dependent plugins will not load (I guess this is a good thing, why have a portlet available that cannot use the service portlet it is dependent upon?).
So on one hand it solves the issues surrounding the global lib (shutting down the server, trying to access the XxxLocalServiceUtil objects before the service providing portlet has loaded), but it does come with some baggage of it's own.
For our part we've been using this method for months now without any issues. Personally I would prefer the copying of the service jar to occur as a hot deployment task, just as the other jars are copied in that are listed in liferay-plugin-package.properties, but I'd hate to have them hold GA2 for this
Please sign in to flag this as inappropriate.