Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Abhishek Dhingra
NoSuchMethodFound Error while using ServiceBuilder and Ext in separate Proj
16 novembre 2011 9.38
Risposta

Abhishek Dhingra

Punteggio: Junior Member

Messaggi: 52

Data di Iscrizione: 7 aprile 2011

Messaggi recenti

Hi All,

I was trying to add 2 new fields Occupation/CompanyName on the CreateAccount page.I followed the below steps:
1) I created a new LiferayProject -> Liferay Portlet (ExtraUser-Portlet).
Under the portlet i added Service.xml with
<?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 5.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_5_2_0.dtd">
<service-builder package-path="com.liferay.portlet.login">
<namespace>UserExtra</namespace>
<entity name="UserExtra" local-service="true" remote-service="false">
<!-- PK fields -->
<column name="userId" type="long" primary="true" />
<!-- Extra fields -->
<column name="companyName" type="String" />
<column name="occupation" type="String" />
<!-- order by -->
<!-- finder methods -->
<!-- reference -->
<reference package-path="com.liferay.portal" entity="User" />
</entity>
</service-builder>
Later using Ant ServiceBuilder i created the JAR file and updated the impl class with the new method 'addUser', and re-build the Service
2) Created a new LiferayProject-Liferay EXT (ExtraUser-EXT), under EXT extended the CreateAccountAction class.Under CreateAccountAction2.java class, i have overridden the addUser method and using 'ExtraUserLocalServiceUtil.addUser(.... ), i tried to add the new fields to userExtra table.

When i deployed both the projects in Liferay server, and tried to run the . i got the error with NoSuchMethodFound (addUser) in class ExtraUserLocalServiceClp.class.
I added the patch files given in the JIRA issue --- http://issues.liferay.com/browse/LPS-13073...But still i am getting the error.

Anybody can help me please, would be highly thankful to you all...
Thanks much
Abhishek Dhingra
RE: NoSuchMethodFound Error while using ServiceBuilder and Ext in separate
20 novembre 2011 5.23
Risposta

Abhishek Dhingra

Punteggio: Junior Member

Messaggi: 52

Data di Iscrizione: 7 aprile 2011

Messaggi recenti

Hello Everybody,
Anyone can please help me on the same.
Thanks in advance.
Nagendra Kumar Busam
RE: NoSuchMethodFound Error while using ServiceBuilder and Ext in separate
20 novembre 2011 11.59
Risposta

Nagendra Kumar Busam

Punteggio: Liferay Master

Messaggi: 653

Data di Iscrizione: 7 luglio 2009

Messaggi recenti

Hi Abhishhek,

If you can please add your whole portlet we can have a look into it

Thanks,
- Nagendra Kumar
Hitoshi Ozawa
RE: NoSuchMethodFound Error while using ServiceBuilder and Ext in separate
20 novembre 2011 16.33
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7949

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

If you just want to add 2 fields, it would be easier to just use custom fields (Control Panel -> Custom Fields).

Also, it's not very wise to modify core Liferay service.xml file. Liferay's core interfaces are kept in tomcat-xxx\lib\ext\portal-service.jar
You may need to replace that too. That said, this is not very wise thing to do because you won't be able to easily upgrade Liferay in the future.

If you just have to use service builder, create a new portlet with table with your additions and just call the Liferay core interfaces from the impl methods.
You'll have to copy and add your fields to the jsp's and replace the control panel menus to point to your portlet too.