Forums

Home » Liferay Portal » English » 3. Development »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
camille vienot
OldServiceComponentException when deploying built service
October 31, 2008 2:42 PM
Answer

camille vienot

Rank: New Member

Posts: 15

Join Date: October 10, 2008

Recent Posts

Hello,
i have browsed the several thread about building and deploying services, but did not find anything about OldServiceComponentException. Here is how i proceeded to build/deploy my service:
- i use the service.xml from the sample-build-service-portlet, in which i rename <namespace> to "partner", because I want my table to be named this way
-i successfully build the service through ant
-i deploy it
-i add a portlet in a page

Whenever I call my service in a JSP, I get NullPointerException. So i guess the deployment does not work properly. When looking into log file, i get a HotDeploymentException
Caused by: com.liferay.portal.OldServiceComponentException: Build namespace SSB has build number 5 which is newer than 1

I do not understand the message for the error. Does anyone know how to handle this, or could advise me on how to debug this?
Thanks,
Camille
Juanjo Hernández Cánovas
RE: OldServiceComponentException when deploying built service
January 13, 2009 10:13 AM
Answer

Juanjo Hernández Cánovas

Rank: Regular Member

Posts: 171

Join Date: August 11, 2008

Recent Posts

Hello Camille,

I have the same problem, Had you resolved it? Could you explain me how?

Thank you very much in advance,

Greetings,

Juanjo
camille vienot
RE: OldServiceComponentException when deploying built service
January 14, 2009 11:10 AM
Answer

camille vienot

Rank: New Member

Posts: 15

Join Date: October 10, 2008

Recent Posts

hello juanjo,
no i did not resolve the problem. Instead, i use the service builder provided by the ext environment. I added my service.xml file in the ext-impl directory, execute the ant build service task. It created all the source needed to run my services. I added some java code on top of this service layer, using the *LocalServiceImpl.java files.
Then to call my services, i use journal templates (velocity) and add the content through the Journal Content portlet (the wiki is well documented). I could not find the JSP code to call built services from custom portlet. But you should be able to do everything through velocity.
Good luck,
Camille
Scott Lee
RE: OldServiceComponentException when deploying built service
April 11, 2009 12:20 AM
Answer

Scott Lee

LIFERAY STAFF

Rank: Junior Member

Posts: 53

Join Date: September 26, 2006

Recent Posts

Juanjo Hernández Cánovas:
Hello Camille,

I have the same problem, Had you resolved it? Could you explain me how?

Thank you very much in advance,

Greetings,

Juanjo


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.

Im not sure if we are running into the same problem for the same reasons, but if we are.. this does the trick for me..

Scott
Nicolas Grolleau
RE: OldServiceComponentException when deploying built service
November 25, 2009 2:49 AM
Answer

Nicolas Grolleau

Rank: Junior Member

Posts: 90

Join Date: November 12, 2009

Recent Posts

Thanks for the info!

but is there not a way to remove the service as you remove the portlet?
Nagendra Kumar Busam
RE: OldServiceComponentException when deploying built service
July 21, 2010 11:28 PM
Answer

Nagendra Kumar Busam

Rank: Liferay Master

Posts: 514

Join Date: July 7, 2009

Recent Posts

Scott Lee:
Juanjo Hernández Cánovas:
Hello Camille,

I have the same problem, Had you resolved it? Could you explain me how?

Thank you very much in advance,

Greetings,

Juanjo


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.

Im not sure if we are running into the same problem for the same reasons, but if we are.. this does the trick for me..

Scott


Hi Scott,

Is there any other way to do it in LR 5.2.3, like specifying some thing in service.xml

Any inputs are much welcome

Thanks & Regards,
- Nagendra Kumar
Jonny Olliff-Lee
RE: OldServiceComponentException when deploying built service
January 25, 2011 7:28 AM
Answer

Jonny Olliff-Lee

Rank: Junior Member

Posts: 41

Join Date: January 25, 2011

Recent Posts

Hi Nagendra,

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.
Nicola De Venuto
RE: OldServiceComponentException when deploying built service
May 20, 2011 12:44 AM
Answer

Nicola De Venuto

Rank: Junior Member

Posts: 64

Join Date: December 12, 2007

Recent Posts

Scott Lee:

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.

Im not sure if we are running into the same problem for the same reasons, but if we are.. this does the trick for me..

Scott



Thanks it's OK emoticon
Nicola De Venuto
RE: OldServiceComponentException when deploying built service
May 20, 2011 12:44 AM
Answer

Nicola De Venuto

Rank: Junior Member

Posts: 64

Join Date: December 12, 2007

Recent Posts

Scott Lee:

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.

Im not sure if we are running into the same problem for the same reasons, but if we are.. this does the trick for me..

Scott



Thanks it's OK emoticon