我正在使用 liferay 6.1.1 ce ga2,当我下载基于 liferay 6.1.x 创建的知识库 portlet 并运行 ant build-service 时,会出现一些“无法解析为类型”的错误。您可以从附件中找到完整的错误信息。即使我使用通过liferay门户在线安装并运行良好的portlet,然后我将安装的文件从捆绑的tomcat目录复制到驻留在plugins sdk的portlet中的portlet目录并再次运行ant build-service,仍然出现错误。
有趣的是,它昨天一次又一次地成功,但今天却失败了。我今天做的唯一一件事就是基于 maven 设置 portlet 开发环境,但我认为这与错误无关,maven 不会更改插件 sdk 的任何内容。错误信息如下:
Buildfile: M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\build.xml
build-service:
[copy] Copying 1 file to M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\classes
[jar] Building MANIFEST-only jar: M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\build-service-classpath.jar
[delete] Deleting: M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\build-service-classpath.jar.manifest
[delete] Deleting: M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\build-service-classpath.jar
[echo] Loading jar:file:/M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
[echo] 二月 16, 2013 3:26:55 上午 com.liferay.portal.kernel.log.Jdk14LogImpl info
[echo] INFO: Global shared lib directory /M:/My-Documents/programming/java/lib/Liferay/plugins/lib/
[echo] 二月 16, 2013 3:26:55 上午 com.liferay.portal.kernel.log.Jdk14LogImpl info
[echo] INFO: Global lib directory /M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/lib/ext/
[echo] 二月 16, 2013 3:26:55 上午 com.liferay.portal.kernel.log.Jdk14LogImpl info
[echo] INFO: Portal lib directory /M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/
[echo] 二月 16, 2013 3:26:56 上午 com.liferay.portal.kernel.log.Jdk14LogImpl info
[echo] INFO: Properties for portal loaded from [file:/M:/MyLoading jar:file:/M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-ext-INF/lib/portal-impl.jar!/portal.properties
[echo] Loading jar:file:/M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-porta.properties, jar:file:/M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOl-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties, jar:file:/M:/My-Documents/programmties
[echo] Loading file:/M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/Wing/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.propertieEB-INF/classes/portal-ext.properties
[echo] s]
[echo] SLF4J: Class path contains multiple SLF4J bindings.
[echo] SLF4J: Found binding in [jar:file:/M:/My-Documents/programming/java/lib/Liferay/bundle/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[echo] SLF4J: Found binding in [jar:file:/M:/My-Documents/programming/java/lib/Liferay/plugins/portlets/knowledge-base-portlet/docroot/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[echo] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[echo] Building KBArticle
[echo] Building KBComment
[echo] Building KBTemplate
compile-java:
[javac] Compiling 8 source files to M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service-classes
[javac] ----------
[javac] 1. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleService.java (at line 142)
[javac] public com.liferay.knowledgebase.model.KBArticleSearchDisplay getKBArticleSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBArticleSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] ----------
[javac] 2. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleServiceClp.java (at line 716)
[javac] public com.liferay.knowledgebase.model.KBArticleSearchDisplay getKBArticleSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBArticleSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] 3. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleServiceClp.java (at line 772)
[javac] return (com.liferay.knowledgebase.model.KBArticleSearchDisplay)ClpSerializer.translateOutput(returnObj);
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBArticleSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] ----------
[javac] 4. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleServiceUtil.java (at line 173)
[javac] public static com.liferay.knowledgebase.model.KBArticleSearchDisplay getKBArticleSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBArticleSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] 5. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleServiceUtil.java (at line 181)
[javac] .getKBArticleSearchDisplay(groupId, title, content, status,
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The method getKBArticleSearchDisplay(long, String, String, int, Date, Date, boolean, int[], int, int, OrderByComparator) from the type KBArticleService refers to the missing type KBArticleSearchDisplay
[javac] ----------
[javac] ----------
[javac] 6. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleServiceWrapper.java (at line 157)
[javac] public com.liferay.knowledgebase.model.KBArticleSearchDisplay getKBArticleSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBArticleSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] 7. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBArticleServiceWrapper.java (at line 164)
[javac] return _kbArticleService.getKBArticleSearchDisplay(groupId, title,
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The method getKBArticleSearchDisplay(long, String, String, int, Date, Date, boolean, int[], int, int, OrderByComparator) from the type KBArticleService refers to the missing type KBArticleSearchDisplay
[javac] ----------
[javac] ----------
[javac] 8. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateService.java (at line 100)
[javac] public com.liferay.knowledgebase.model.KBTemplateSearchDisplay getKBTemplateSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBTemplateSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] ----------
[javac] 9. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateServiceClp.java (at line 335)
[javac] public com.liferay.knowledgebase.model.KBTemplateSearchDisplay getKBTemplateSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBTemplateSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] 10. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateServiceClp.java (at line 389)
[javac] return (com.liferay.knowledgebase.model.KBTemplateSearchDisplay)ClpSerializer.translateOutput(returnObj);
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBTemplateSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] ----------
[javac] 11. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateServiceUtil.java (at line 108)
[javac] public static com.liferay.knowledgebase.model.KBTemplateSearchDisplay getKBTemplateSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBTemplateSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] 12. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateServiceUtil.java (at line 116)
[javac] .getKBTemplateSearchDisplay(groupId, title, content,
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The method getKBTemplateSearchDisplay(long, String, String, Date, Date, boolean, int[], int, int, OrderByComparator) from the type KBTemplateService refers to the missing type KBTemplateSearchDisplay
[javac] ----------
[javac] ----------
[javac] 13. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateServiceWrapper.java (at line 101)
[javac] public com.liferay.knowledgebase.model.KBTemplateSearchDisplay getKBTemplateSearchDisplay(
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] com.liferay.knowledgebase.model.KBTemplateSearchDisplay cannot be resolved to a type
[javac] ----------
[javac] 14. ERROR in M:\My-Documents\programming\java\lib\Liferay\plugins\portlets\knowledge-base-portlet\docroot\WEB-INF\service\com\liferay\knowledgebase\service\KBTemplateServiceWrapper.java (at line 108)
[javac] return _kbTemplateService.getKBTemplateSearchDisplay(groupId, title,
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The method getKBTemplateSearchDisplay(long, String, String, Date, Date, boolean, int[], int, int, OrderByComparator) from the type KBTemplateService refers to the missing type KBTemplateSearchDisplay
[javac] ----------
[javac] 14 problems (14 errors)
build.fxbird.properties 如下,fxbird 是操作系统登录用户。
app.server.dir = M:\\My-Documents\\programming\\java\\lib\\Liferay\\bundle\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27
java.compiler = modern
app.server.lib.global.dir = M:\\My-Documents\\programming\\java\\lib\\Liferay\\bundle\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27\\lib\\ext
app.server.type = tomcat
app.server.deploy.dir = M:\\My-Documents\\programming\\java\\lib\\Liferay\\bundle\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27\\webapps
app.server.portal.dir = M:\\My-Documents\\programming\\java\\lib\\Liferay\\bundle\\liferay-portal-6.1.1-ce-ga2\\tomcat-7.0.27\\webapps\\ROOT