掲示板

Better Documentation and Support for Upgraders

9年前 に Damien Lam によって更新されました。

Better Documentation and Support for Upgraders

New Member 投稿: 5 参加年月日: 14/10/03 最新の投稿
It has been a challenge and major frustration upgrading from 5.2.3 to 6.0.We have followed the documented processes, checked in forums, but we seem to be getting nowhere.

In 5.2.3, we modified portal core class com.liferay.portlet.login.action.CreateAccountAction for an additional field that users enter during the registration process. We deployed this ext plugin in 6.0 and this jar is created : {catalina.home} /lib/ext/ext-services.jar (customised class)

After that we get java.lang.NoSuchMethodError exception.

In this CreateAccountAction class, I added new method A that call another method B. B is in another portlet service jar file name xxx-portlet-service.jar which sit inside the {catalina.home} /lib/ext

The java.lang.NoSuchMethodError exception happened when it try to find B.

Here's the error:
18:48:34,086 ERROR [ClassLoaderProxy:73] java.lang.NoSuchMethodException: com.leadingside.portal.barterfli.portlet.action.service.Mem_userextLocalService.addMem_userext(com.leadingside.portal.barterfli.portlet.action.model.Mem_userext)
java.lang.NoSuchMethodException: com.leadingside.portal.barterfli.portlet.action.service.Mem_userextLocalService.addMem_userext(com.leadingside.portal.barterfli.portlet.action.model.Mem_userext)
at java.lang.Class.getMethod(Unknown Source)
at com.liferay.portal.kernel.util.MethodCache._get(MethodCache.java:107)
at com.liferay.portal.kernel.util.MethodCache.get(MethodCache.java:62)
at com.liferay.portal.kernel.util.MethodHandler.invoke(MethodHandler.java:79)
at com.liferay.portal.kernel.util.ClassLoaderProxy.invoke(ClassLoaderProxy.java:67)
at com.leadingside.portal.barterfli.portlet.action.service.Mem_userextLocalServiceClp.addMem_userext(Mem_userextLocalServiceClp.java:114)
at com.leadingside.portal.barterfli.portlet.action.service.Mem_userextLocalServiceUtil.addMem_userext(Mem_userextLocalServiceUtil.java:48)
at com.leadingside.portal.mem.ext.service.MembershipService.addBarterfliUser(MembershipService.java:327)
at com.leadingside.portal.mem.ext.service.MembershipService.addBarterfliUser(MembershipService.java:131)method-B
at com.liferay.portlet.login.action.CreateAccountAction.SubmitUserStep01(CreateAccountAction.java:358)method-A

I've tried suggestion from these links:
https://www.liferay.com/community/forums/-/message_boards/message/1411412
http://www.liferay.com/community/forums/-/message_boards/message/16295178
https://issues.liferay.com/browse/LPS-29029https://issues.liferay.com/browse/LPS-29847
http://mathieuhicauber-java.blogspot.fr/2012/11/classloader-issue-when-overriding.html

but to no avail. The issue still persist.

Really need some help as running out of options.

Is there any one who can help or point us to some documentation that we can identify what we are doing wrong, or what might be the solution? Any guidance would be most appreciated.

Many thanks!

Environment:
-java 6
-ant 1.7
-liferay 6.0.6
-Tomcat 6 Bundle
-MySQL
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: Better Documentation and Support for Upgraders

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Hi, Damien, so these kinds of things can often actually be class loader related and not method not found exceptions (class loader issues present themselves in odd ways sometimes).

Can you check to see if you have any other copies of the service jar(s) in any other web application? If you promote them to lib/ext, then you get classes in the global class loader and other local copies of the jars can actually cause loader conflicts.
9年前 に Damien Lam によって更新されました。

RE: Better Documentation and Support for Upgraders

New Member 投稿: 5 参加年月日: 14/10/03 最新の投稿
Hi David. Thanks for your reply. I've checked other web applications and its all clear. I mean, the service jar only inside the tomcat/lib/ext. There are no other copies of it. Do you have any further suggestion how to solve this?

What confuse me is, there are these (see below) method inside the class:

mem_serv.getRelatedCompanyInfoByCompanyName(xx); //can find
Mem_userextLocalServiceUtil.addMem_userext(oUserext); //cannot find

mem_serv is inside the service jar too (com.xxx.portal.util.service.mem_serv)
Mem_userextLocalServiceUtil (com.xxx.portal.yyy.portlet.action.service.Mem_userextLocalServiceUtil)


Why is this happening?
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: Better Documentation and Support for Upgraders

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Oh, wait, are you extending UserLocalServiceImpl to add your own method? If so, just adding a method there will not promote it into the complete service tier since you're not building Liferay's services.

Otherwise, is this your own service tier? Did you rebuild the services and replace the service jar in lib/ext? Whenever you add, change, or remove methods from an implementation class (i.e. Mem_userextLocalServiceImpl) the changes would not get get into Mem_userextLocalServiceUtil unless you build the services again.
9年前 に Damien Lam によって更新されました。

RE: Better Documentation and Support for Upgraders

New Member 投稿: 5 参加年月日: 14/10/03 最新の投稿
Hi David,

No, im extending portal-impl's CreateAccountAction class. And inside I call my own class which is in another portlet service jar.

Here's the situation, since this happen (below)
mem_serv.getRelatedCompanyInfoByCompanyName(xx); //can find
Mem_userextLocalServiceUtil.addMem_userext(oUserext); //cannot find

I decided to put "caller" of Mem_userextLocalServiceUtil.addMem_userext inside the mem_serv. Means, I will call mem_serv.addCallerMem_userext and this will call the Mem_userextLocalServiceUtil.addMem_userext.

It works. But after a tomcat restart the issue happened again.

I revert back to original, restart, it works. Restart again, not working.

This is so frustrating. I don't know what to do with this anymore.

Please help.

Thanks.
9年前 に Damien Lam によって更新されました。

RE: Better Documentation and Support for Upgraders

New Member 投稿: 5 参加年月日: 14/10/03 最新の投稿
Hi David

I have tried reverting and rebuilding but i am now unable to even get it working as it did on Friday.

Would really appreciate if you could give some pointers. Could I have missed some steps or is there another approach to get around this issue?

Thanks

Damien
9年前 に Damien Lam によって更新されました。

RE: Better Documentation and Support for Upgraders

New Member 投稿: 5 参加年月日: 14/10/03 最新の投稿
Hi David

Just to reply to one of your comments if we are extending UserLocalServiceImpl to add your own method. Yes we are. We are using the Impl file and building the service with the impl to insert the extend method in the service class.

Will the above promote into the complete service tier?

Thanks

Damien