2015-07-21 82 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!

謝謝。

相關問題