简体   繁体   English

包含组件期间出错:xxx无法解析为一种类型

[英]Error during include of component : xxx cannot be resolved to a type

I developed a class DateFormatter in core bundle following blog . 我在博客之后的核心捆绑包中开发了DateFormatter类。 and get my date value in header page : 并在标题页中获取我的日期值:

<sly data-sly-use.date="${'com.xxx.DateFormatter' @ date=pageProperties.jcr:created,
     format='dd/MM/yyyy'}"></sly>
<meta name="my_date" content="${date.value}">

This works fine on my local server. 这在我的本地服务器上工作正常。 However, after I run package install onto remote server. 但是,运行软件包后,将其安装到远程服务器上。 On the author page,it got errors: 在作者页面上,出现错误:

Error Message: org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/xxx/components/structure/page/header_html.java: Line 28, column 1285 : Only a type can be imported. 错误消息:org.apache.sling.scripting.sightly.SightlyException:org / apache / sling / scripting / sightly / apps / xxx / components / structure / page / header_html.java中的编译错误:第28行,第1285列:仅类型可以导入。 com.xxx.DateFormatter resolves to a package Line 106, column 4988 : DateFormatter cannot be resolved to a type com.xxx.DateFormatter解析为软件包第106行第4988列:DateFormatter无法解析为一种类型

I tried mvn clean and installed bundles onto the remote server but no luck. 我尝试了mvn clean并将捆绑包安装到远程服务器上,但是没有运气。

Verified the bundle is active and this issue is resolved now. 验证捆绑包是活动的,并且此问题现在已解决。 Maybe it was not active during that time. 也许在那段时间没有激活。 BTW, I run bundle installation (not installPackage) specially also resolved the issue. 顺便说一句,我专门运行捆绑安装(不是installPackage)也解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM