liferay Build namespace .... has build number ... which is newer than ...


我遇到的问题:尝试下面两种方法无效后
1.关闭tomcat;
2.删除tomcat\webapp\{portletname} 和tomcat\work\Catalina\localhost\{portletname}
3. Increment the number on the line that reads: build.number={a number}
4.build and deploy
5.ok
-------------------------------
For anyone getting the "Build namespace .... has build number ... which is newer than ..." exceptions.. read below.

Whenever you do a "build-service", there is a "service.properties" file which has a "build.number" that is incremented.

mail-portlet/docroot/WEB-INF/src/service.properties


##
## Build
##

    build.namespace=Mail
    build.number=1
    build.date=1239433666359


If you deploy your portlet to a portal that already has the portlet (with a higher build number than your freshly deployed portlet), you will get the "Build namespace .... has build number ... which is newer than ..." exception. The reason is that the portal only wants to do "upgrades" to newer versions of the portlet.. and if it sees an older build number.. it will ignore it thinking that you are "downgrading".. and as a result, your db tables wont get built/updated.

To get the portal to realize that your portlet is actually a newer version / upgrade, all you have to do is.. increment your build.number in the service.properties file to be a number that is greater than existing portlets build.number.

---------------------
I found there are two ways of doing this (both work with 5.2.3), I suspect the second way is the right way.

First way:

1. Go to {plugins-sdk}/portlets/{portletname}/docroot/WEB-INF/src/service.properties
2. Increment the number on the line that reads: build.number={a number}
3. Save the file

Second (and better way):

1. Go to {plugins-sdk}/portlets/{portletname}
2. Run: ant build-service

Then you can redeploy the portlet to your server and all should be good!

{plugins-sdk} is where the path to where you have Plugins-SDK in your folder structure
{portletname} is the name of the portlet e.g. NewWebFormPortlet.
-----------------------------


你可能感兴趣的:(namespace)