如何解决在Adobe Experience Manager中包含组件期间的错误



我在Eclipse中使用Adobe Experience Manager,我已经按照本教程中给出的说明进行了操作https://docs.adobe.com/content/help/en/experience-manager-learn/getting-started-wknd-tutorial-develop/component-basics.html.

一切都很顺利。然而,如果我添加了一个hello-world组件,它会给我一个错误:

包含组件"/apps/wknd/components/content/helloworld"时出错

错误消息:

org.apache.sling.api.SlingException:无法获取DefaultSlingScript:中的编译错误org/apache/sling/scripting/sightly/apps/wknd/content/helloworld/helloworld_html.java:第52行第2348列:com.adobe.aem.guides.wknd.core.models.HelloWorldModel不能解析为类型

处理信息:

Page=/content/wknd/us/en/content-basics资源路径=/content/wknd/us/en/content-basics/jcr:content/root/aresponsivegrid/helloworld_1476106194
Cell=helloworld Cell Search路径=page|basicpage/root|responsivegrid/aresponsivegrid/helloworld
组件路径=/apps/wknd/components/content/helloworld

完全异常

org.apache.sling.api.SlingException:无法获取DefaultSlingScript:中的编译错误org/apache/sling/scripting/sightly/apps/wknd/content/helloworld/helloworld_html.java:第52行第2348列:com.adobe.aem.guides.wknd.core.models.HelloWorldModel不能已解析为位于的类型org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:510)在org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:552)在org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilter Chain.java:44)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:82)在com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:192)在com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:159)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:278)在com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:373)在com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:190)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.core.impl.page.PageLockFilter.doFilter(PageLockFilter.java:91)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:94)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)在org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilter Chain.java:49)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:76)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)在com.day.cq.wcm.core.impl.twarp.TimeWarpFilter.doFilter(TimeWarpFilter.java:109)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.cq.social.ugcbase.security.impl.SaferLingPostServlet.doFilter(SaferSlingPostServlet.java:114)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)在com.day.cq.dam.core.impl.assetlinkshare.AdhocAssetShareAuthHandler.doFilter(AdhocAssetShareAuthHandler.java:437)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)在com.day.cq.dam.core.impl.servlet.ActivityRecordHandler.doFilter(ActivityRecordHandler.java:141)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.agranate.rest.impl.servlet.ApiResourceFilter.doFilter(ApiResourceFilter.java:70)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.agranate.requests.logging.impl.RequestLoggerImpl.doFilter(RequestLoggerImpl.java:134)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.agranate.rest.assets.impl.AssetContentDispositionFilter.doFilter(AssetContentDispositionFilter.java:96)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.agranate.csrf.impl.CSRFFilter.doFilter(CSRFFilter.java:217)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.core.impl.AuthingUIModeServiceImpl.doFilter(AuthoringUIModeServiceImpl.java:372)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.mobile.core.impl.redirect.RirectFilter.doFilter(RedirectFilter.java:248)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.aem.professional.core.filters.LoggingFilter.doFilter(LoggingFilter.java:58)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerCLogFilter.java:107)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.cq.social.commons.cors.CORSAuthenticationFilter.doFilter(CORSAuthentication Filter.java:91)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.foundation.forms.FormsHandlingServlet Helper.handleFilter(FormsHandingServlet Helper.java:226)在com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandingServlet.java:138)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.agranate.optiut.impl.OptiOutFilter.doFilter(OptOutFilter.java:76)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.foundation.forms.FormsHandlingServlet Helper.handleFilter(FormsHandingServlet Helper.java:226)在com.adobe.cq.wcm.core.components.internal.servlets.CoreFormHandlingServlet.doFilter(CoreFormHandlingServlets.java:126)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.cq.history.impl.HistoryRequestFilter.doFilter(HistoryRequestFilter.java:122)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.cq.mcmcampaign.servlets.CampaignCopyTracker.doFilter(CampaignCopyTracker.java:100)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.rewriteer.impl.RewriterFilter.doFilter(RewriterFilter.java:87)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在com.adobe.agranate.httpcache.impl.InerCacheFilter.doFilter(InnerCacheFilter.java:81)在com.adobe.agranate.httpcache.impl.InerCacheFilter.doFilter(InnerCacheFilter.java:60)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.security.impl.ContentDispositionFilter.doFilter(ContentDispositionFilter.java:152)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)在com.adobe.agranate.resourceresolverhelper.impl.ResourceResolverHelperImpl.doFilter(ResourceResolverHelperImpl.java:83)在org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:72)在org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)在org.apache.sring.engine.impl.SringMainServlet.service(SlingMainServlet.java:244)在org.apache.filex.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:123)在org.apache.filex.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:86)在com.adobe.garagrant.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)在org.apache.filex.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)在org.apache.filex.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)在org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:131)在org.apache.filex.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)在org.apache.filex.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)在org.apache.sling.featureflags.impl.FeatureManager.doFilter(FeatureManager.java:116)在org.apache.filex.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)在org.apache.filex.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)在org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:72)在org.apache.filex.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)在org.apache.filex.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)在org.apache.sling.engine.impl.parameters.RequestParameterSupportConfigurer.doFilter(RequestParameterSupportConfigr.java:63)在org.apache.filex.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:142)在org.apache.filex.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:81)在org.apache.filex.http.base.internal.Dispatcher.Dispatcher$1.doFilter(Dispatcher.java:146)在org.apache.filex.http.base.internal.webracket.WhiteboardManager$2.doFilter(WhiteboardManager.java:1002)在org.apache.sling.security.impl.FerrerrerFilter.doFilter(ReferrerFilter.java:326)在org.apache.filex.http.base.internal.handler.PreprocessorHandler.handle(预处理器处理程序.java:136)在org.apache.filex.http.base.internal.webrack.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)在org.apache.filex.http.sslfilter.internal.sslfilter.doFilter(sslfilter.java:97)在org.apache.filex.http.base.internal.handler.PreprocessorHandler.handle(预处理器处理程序.java:136)在org.apache.filex.http.base.internal.webrack.WhiteboardManager$2.doFilter(WhiteboardManager.java:1008)在org.apache.filex.http.base.internal.weboard.WhiteboardManager.invokePreprocessors(WhiteboardManager.java:1012)在org.apache.filex.http.base.internal.Dispatcher.Dispatcher.Dispatcher(Dispatcher.java:91)在org.apache.filex.http.base.internal.dispatcher.DispatcherServlet.service(DispatcherServlet.java:49)位于org.eclipse.japty.servlet.ServletHolder.handle(ServletHolder.java:873)在org.eclipse.japty.servlet.ServletHandler.doHandle(ServletHandler.java:542)在org.eclipse.jjetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)在org.eclipse.jjetty.server.session.SessionHandler.doHandle(SessionHandler.java:1701)在org.eclipse.jjetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)在org.eclipse.jjetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)在org.eclipse.jjetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)在org.eclipse.japty.servlet.ServletHandler.doScope(ServletHandler.java:480)在org.eclipse.jjetty.server.session.SessionHandler.doScope(SessionHandler.java:1668)在org.eclipse.jjetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)在org.eclipse.jjetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)在org.eclipse.jjetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)在org.eclipse.jjetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)在org.eclipse.jjetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)网址:org.eclipse.jjetty.server.handle(server.java:502)org.eclipse.jjetty.server.HttpChannel.handle(HttpChannel.java:370)org.eclipse.jjetty.server.HttpConnection.onFillable(HttpConnection.java:267)在org.eclipse.japty.io.AbstractConnection$ReadCallback.成功(AbstractConnection.java:305)网址:org.eclipse.jjetty.io.FillInterest.fillable(FillInterest.java:103)在org.eclipse.jjetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)在org.eclipse.jjetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYou Kill.java:333)在org.eclipse.jjetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYou Kill.java:310)在org.eclipse.jjetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYou Kill.java:168)在org.eclipse.jjetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYou Kill.java:126)在org.eclipse.jjetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThread Executor.java:366)在org.eclipse.jjetty.util.thread.QueuedThreadPool.runJob(QueuedTthreadPool.java:765)在org.eclipse.jjetty.util.thread.QueuedThreadPool$2.run(QueuedTthreadPool.java:683)在java.base/java.lang.Thread.run(Thread.java:830)引起:org.apache.sling.scripting.sightly.SightlyException:编译中的错误org/apache/sling/scripting/sightly/apps/wknd/content/helloworld/helloworld_html.java:第52行第2348列:com.adobe.aem.guides.wknd.core.models.HelloWorldModel不能已解析为位于的类型org.apache.sling.scripting.sightly.impl.engine.compile.SringHTLMasterCompileSource(SlingHTLMaster Compiler.java:429)在org.apache.sling.scripting.sightly.impl.engine.compile.SlingHTLMasterCompileHTLScript(SlingHTLMaster Compiler.java:245)在org.apache.sling.scripting.sightly.impl.engine.Sight脚本引擎.编译(SightlyScriptEngine.java:58)在org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:379)在org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)在org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)

关于如何解决此类问题或有关AEM错误的任何其他参考资料,有什么想法吗?非常感谢。

尝试在OSGi中删除捆绑包并重新安装。转到您的核心目录并运行以下命令:

mvn -PautoInstallBundle clean install

发生这种情况有两个原因。1) 您没有构建核心模块,或者您的核心捆绑包没有正确构建。使用命令mvn clean install -PautoInstallBundle仅构建捆绑包。

2) 第二个原因可能是您的捆绑包正在服务器上构建和部署,但依赖关系没有得到解决。如果捆绑包处于活动状态,请在系统控制台中进行检查。如果它不活动,则展开捆绑包并检查缺少哪个依赖项。找到丢失的依赖项后,请在osgi中安装该依赖项。

尝试在core/pom.xml的构建标签下添加此包:

<configuration>
<bnd><![CDATA[ Import-Package: 
javax.annotation;version=0.0.0, 
com.day.cq.wcm.api;version=0.0.0, 
org.apache.sling.api.resource;version=0.0.0,
org.apache.sling.api.servlets;version=0.0.0,
*]]>
</bnd>
</configuration>

它对我有用!

相关内容

  • 没有找到相关文章

最新更新