gpt4 book ai didi

compiler-errors - 使用OSGi服务时无法将获取服务解析为类型错误

转载 作者:行者123 更新时间:2023-12-02 10:42:39 26 4
gpt4 key购买 nike

我创建了一个组件,该组件在Cq5中使用了OSGI bundle 包中的吊索服务。
但是在使用时会抛出错误,指出 com.aem.HelloService无法解析为类型,
当在http://localhost:4502/system/console/services下看时。

服务运行正常。

最佳答案

在您的Web控制台中查找OSGI bundle 包,例如:

http://localhost:4502/system/console/bundles

然后在包的属性下查找名为 Symbolic Name 的属性。参见以下示例: enter image description here

这是在JSP导入中必须使用的路径,例如,在JSP页面的顶部:
<%@page import="org.apache.sling.tooling.support.install%> //you might have to add .* at the end to import everything

然后还要确保按照Adobe和其他文档正确注释和构造了OSGI服务Java文件。

关于compiler-errors - 使用OSGi服务时无法将获取服务解析为类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39264133/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com