2015-07-21 86 views
0

我是Liferay的新手,并尝试自定义用于2路同步的日历-portlet。我正在使用Ant进行构建。Liferay Portal 6.2自定义Calendar-Portlet - view_calendar.jsp和view_calendar_resources.jsp中的错误

以下是我一直沿用至今的步骤。

  1. 从Liferay的 网站下载liferay-plugins-sdk-6.2-ce-ga4-20150416163831865.zipliferay-portal-tomcat-6.2-ce-ga4-20150416163831865.zip
  2. 设置我的eclipse并创建了新的插件项目。
  3. ..\tomcat-7.0.42\webapps\calendar-portlet的内容添加到 文档文件夹 ..\liferay-plugins-sdk-6.2\portlets\Appointment-portlet\docroot

Issue:现在我得到编译时错误。以下是详细信息。

  1. 重复的局部变量editCalendarURL - 在view_calendar.jsp。这里 首先分配变量editCalendarURL然后在 中使用。所以,我找不到任何重复的问题。

  2. 重复本地变量用户 - 在view_calendar_resources.jsp。在这个jsp文件中找不到变量'user'。

我试图做蚂蚁合并,但仍收到错误:

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

我试图与安装的Liferay /门/插件-SDK很多次,但未能取得任何成就。

+0

尚未回复:( –

+0

已回复...是否有效? –

回答

0

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

我没有使用这种方式,甚至不确定,但可能是这不是导入和定制任何portlet的方式。相反,您很可能需要使用Hook来执行您想要实现的功能。 如果你是一个新手,并希望实现这一点,那么我会建议你通过development guide for Hook。 通过此过程后,您可以在Liferay Forum上找到各种线索,例如thisthis以获得更多帮助。

HTH!

谢谢。