Foros de discusión

Add new methods in existing Blogs portlet

Sunil Kulkarni, modificado hace 12 años.

Add new methods in existing Blogs portlet

Junior Member Mensajes: 94 Fecha de incorporación: 24/06/11 Mensajes recientes
Currently, there is getBlogEntry(long entryId) emthod is present.
I want to add one more methods in blogs portlet, getBlogEntry(long groupId)

I have done following following steps (Refer : Customizing the Liferay Core section from http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Development%20in%20the%20ext%20environment)
1) add and implement the new method in BlogsEntryLocalServiceImpl.java file
2) Run ant build-service-portlet-blogs command in ${liferay_portal_home}/portal-impl/ directory.

I am getting following error :

build-service-portlet-blogs:

build-service:
[java] Exception in thread "main" java.lang.NoClassDefFoundError: com/liferay/portal/tools/servicebuilder/ServiceBuilder
[java] Caused by: java.lang.ClassNotFoundException: com.liferay.portal.tools.servicebuilder.ServiceBuilder
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[java] Could not find the main class: com.liferay.portal.tools.servicebuilder.ServiceBuilder. Program will exit.
[java] Java Result: 1

Kindly help on this.
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Add new methods in existing Blogs portlet

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
First, do not cross-post the same question to different groups. Pick one and run with it, but don't spread it around unnecessarily.

Second, the wiki page you've referenced is for Liferay 4. Unless you are actually using Liferay 4, it does not apply in the current environment.

Third, you should never be modifying the Liferay code directly. Makes it impossible to upgrade later on. Pursue it as an EXT plugin or a simple extension class that you manage, but never modify the core code.

Fourth, you've probably got a messed up dev environment, probably due to just downloading stuff and trying to start things up and see what happens. Go to the documentation tab and follow the dev guide step by step to get your environment working...
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Add new methods in existing Blogs portlet

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
After you modify the xxxImpl class, you need to run service builder once again to generate necessary classes.