Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marcello Marangio
service builder: void custom method throws UnsupportedOperationException.
July 3, 2013 8:35 AM
Answer

Marcello Marangio

Rank: Junior Member

Posts: 30

Join Date: September 22, 2009

Recent Posts

Hi all
I built a custom void method in my XYZLocalServiceImpl class; i.e
public void myMethod(myparams)

I found that if the method returns void an UnsupportedOperationException is thrown from XYZLocalServiceClpInvoker.invokeMethod(), as the very last instruction of this method is

throw new UnsupportedOperationException().

This instruction should never be executed, unless an unexisting method is called.

Instead, if I declare
public boolean myMethod(myparams)
always returning true, the exception is not thrown.

is it a bug or is there some rule why I cannot write custom void method in my XYZLocalServiceImpl class?

thanks
Marcello
Wilson Man
RE: service builder: void custom method throws UnsupportedOperationExceptio
July 3, 2013 10:24 AM
Answer

Wilson Man

LIFERAY STAFF

Rank: Liferay Master

Posts: 580

Join Date: June 21, 2006

Recent Posts

looks like it is a known bug in Service Builder.

http://issues.liferay.com/browse/LPS-29668
Marcello Marangio
RE: service builder: void custom method throws UnsupportedOperationExceptio
July 3, 2013 10:32 PM
Answer

Marcello Marangio

Rank: Junior Member

Posts: 30

Join Date: September 22, 2009

Recent Posts

Wilson Man:
looks like it is a known bug in Service Builder.

http://issues.liferay.com/browse/LPS-29668

Thanks for your answer.
No fix for 6.1.1 GA2 though...
M
Juan Gonzalez
RE: service builder: void custom method throws UnsupportedOperationExceptio
July 4, 2013 1:54 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2797

Join Date: October 28, 2008

Recent Posts

It's solved in LCEPatcher version:

https://www.lcepatchers.org/downloads