0
votes

I am a newbie for Liferay and trying to customize the calendar-portlet for 2 way synchronization. I am using Ant for build.

Below are the steps I have followed till now.

  1. Downloaded liferay-plugins-sdk-6.2-ce-ga4-20150416163831865.zip and liferay-portal-tomcat-6.2-ce-ga4-20150416163831865.zip from liferay site.
  2. Set up my eclipse and created new plugin project.
  3. Added the contents of ..\tomcat-7.0.42\webapps\calendar-portlet to the docroot folder ..\liferay-plugins-sdk-6.2\portlets\Appointment-portlet\docroot.

Issue: Now I am getting compile time error. Below are the details.

  1. Duplicate local variable editCalendarURL - in view_calendar.jsp. Here the variable editCalendarURL is assigned first and then in being used . So, I couldn't find any duplicate issue.

  2. Duplicate local variable user - in view_calendar_resources.jsp . Couldn't find the variable 'user' in this jsp file.

I tried with doing Ant merge but still received the error:

Buildfile:\liferay-plugins-sdk-6.2\portlets\Appointment-portlet\build.xml Unable to obtain resource from \liferay-plugins-sdk-6.2.ivy\ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar: java.util.zip.ZipException: error in opening zip file [taskdef] Unable to obtain resource from \liferay-plugins-sdk-6.2.ivy\ivy-2.4.0.LIFERAY-PATCHED-1-SNAPSHOT.jar: [taskdef] java.util.zip.ZipException: error in opening zip file
[taskdef] at java.util.zip.ZipFile.open(Native Method) [taskdef] at java.util.zip.ZipFile.(Unknown Source) [taskdef] at java.util.zip.ZipFile.(Unknown Source) [taskdef] at java.util.jar.JarFile.(Unknown Source) [taskdef] at java.util.jar.JarFile.(Unknown Source) [taskdef] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1006) [taskdef] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:149) [taskdef] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.(AntClassLoader.java:110) [taskdef] at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:953) [taskdef] at org.apache.tools.ant.AntClassLoader.getNamedResources(AntClassLoader.java:922) [taskdef] at org.apache.tools.ant.loader.AntClassLoader5.getResources(AntClassLoader5.java:58) [taskdef] at org.apache.tools.ant.taskdefs.Definer.resourceToURLs(Definer.java:360) [taskdef] at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:246)
[taskdef] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[taskdef] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) [taskdef] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[taskdef] at java.lang.reflect.Method.invoke(Unknown Source)
[taskdef] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [taskdef] at org.apache.tools.ant.Task.perform(Task.java:348)
[taskdef] at org.apache.tools.ant.Target.execute(Target.java:435)
[taskdef] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:168) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:230) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:162) [taskdef] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[taskdef] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) [taskdef] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[taskdef] at java.lang.reflect.Method.invoke(Unknown Source)
[taskdef] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [taskdef] at org.apache.tools.ant.Task.perform(Task.java:348)
[taskdef] at org.apache.tools.ant.Target.execute(Target.java:435)
[taskdef] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:168) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:230) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:162) [taskdef] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[taskdef] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [taskdef] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[taskdef] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [taskdef] at java.lang.reflect.Method.invoke(Unknown Source) [taskdef] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [taskdef] at org.apache.tools.ant.Task.perform(Task.java:348)
[taskdef] at org.apache.tools.ant.Target.execute(Target.java:435)
[taskdef] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:168) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:230) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:162) [taskdef] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[taskdef] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [taskdef] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[taskdef] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [taskdef] at java.lang.reflect.Method.invoke(Unknown Source) [taskdef] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [taskdef] at org.apache.tools.ant.Task.perform(Task.java:348)
[taskdef] at org.apache.tools.ant.Target.execute(Target.java:435)
[taskdef] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:168) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:230) [taskdef] at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:162) [taskdef] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[taskdef] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [taskdef] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[taskdef] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [taskdef] at java.lang.reflect.Method.invoke(Unknown Source) [taskdef] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [taskdef] at org.apache.tools.ant.Task.perform(Task.java:348)
[taskdef] at org.apache.tools.ant.Target.execute(Target.java:435)
[taskdef] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:179) [taskdef] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.parseBuildFile(InternalAntRunner.java:215) [taskdef] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:429) [taskdef] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:139) [taskdef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.

BUILD FAILED \liferay-plugins-sdk-6.2\portlets\Appointment-portlet\build.xml:5: The following error occurred while executing this line: \liferay-plugins-sdk-6.2\portlets\build-common-portlet.xml:5: The following error occurred while executing this line: \liferay-plugins-sdk-6.2\build-common-plugin.xml:5: The following error occurred while executing this line: \liferay-plugins-sdk-6.2\build-common.xml:60: The following error occurred while executing this line: \liferay-plugins-sdk-6.2\build-common-ivy.xml:607: The following error occurred while executing this line: \liferay-plugins-sdk-6.2\build-common-ivy.xml:518: The following error occurred while executing this line: \liferay-plugins-sdk-6.2\build-common-ivy.xml:545: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any / declarations have taken place. No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration. Action: Check that the implementing library exists in one of: -E:\eclipse\plugins\org.apache.ant_1.9.2.v201404171502\lib -C:\Users\Abhishek.ant\lib -a directory added on the command line with the -lib argument

Total time: 4 seconds

I have tried with installing liferay/portal/plugin-sdk many times but couldn't achieve anything.

1
replied... Is it worked?Himanshu Bhandari

1 Answers

0
votes

Added the contents of ..\tomcat-7.0.42\webapps\calendar-portlet to the docroot folder ..\liferay-plugins-sdk-6.2\portlets\Appointment-portlet\docroot.

I haven't used this way and not sure even but may be this is not the way to import and customize any portlet. Instead you will most probably require to use Hook to perform what you want to achieve. If you are a newbie and want to achieve this then I would recommend you to go through development guide for Hook. After going through this you can find various threads on Liferay Forum like this and this to get more help.

HTH!

Thanks.