Friday, November 18, 2011

Liferay Portlet Build Numbers

Here's another error to pick apart:  

com.liferay.portal.OldServiceComponentException: Build namespace X has build number 18 which is newer than 13

Yeah... Google that and you get lots of helpful advice about going into your WEB-INF/src/ file and changing the build.number to something higher.  Simple, huh?

But what if that doesn't fix it?

Here's another clue:  You've set that build number higher and yet... it still reports the same numbers it did before.  What's the deal? 

Do you have separate portlet projects installed using the same namespace in your service.xml?

If you do, there's your problem.

You see, when you're building your service.xml file, the namespace you use needs to be unique to the portlet.  Otherwise, if you deploy another portlet later that's trying to use that same namespace, Liferay will look at the namespace, compare it to the one you've already installed, and think they're the same service project.  If your new one is lower than the old one, Liferay assumes you're trying to replace the same namespace with an older version and won't allow it.

So when you're using the service layer, always make sure your namespace is unique.