graphql - 无法在 AEM 中使用 GraphQL
问题描述
我将 GraphQL 添加到 AEM 中的包中,导致包启动失败。
- 我有一个捆绑项目,它在 AEM 中运行良好。捆绑启动命令: mvn clean install -PautoInstallBundle
<profile> <id>autoInstallBundle</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <executions> <execution> <id>install-bundle</id> <goals> <goal>install</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> </build> </profile>
- 我将以下配置添加到 pom.xml 然后重新安装捆绑包,捆绑包仍然可以正常工作。
<dependency> <groupId>com.graphql-java</groupId> <artifactId>graphql-java</artifactId> <version>3.0.0</version> </dependency>
我在我的项目中添加了两个演示类并重新安装了包。捆绑启动失败。GraphQL_SImple.java 和 User.java 可以在https://github.com/zhaiqianfeng/GraphQL-Demo/blob/master/java/src/main/java/com/zqf/get_start/GraphQL_Simple.java找到
错误信息是:
12.07.2018 14:55:17.223错误[qtp1398311933-54244] org.apache.felix.http.jetty %bundles.pluginTitle:无法启动(org.osgi.framework.BundleException:无法解析 com.mb.graphql.mb-graphql.core [528](R 528.27 ): 缺少需求 [com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql) 未解决的需求: [[com.mb.graphql. mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql)]) org.osgi.framework.BundleException: 无法解析 com.mb.graphql.mb-graphql .core [528](R 528.27):缺少要求 [com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package;(osgi.wiring.package=graphql) 未解决的要求:[[com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql)] 在 org.apache.felix.framework.Felix。
有人面临同样的问题并知道如何解决吗?
谢谢
解决方案
我找到了解决它的方法。将以下配置添加到 maven-bundle-plugin。
<Export-Package>graphql.*</Export-Package>
推荐阅读
- json - 使用xml2js在角度6中未定义的parseString
- angular - Http 状态不正常:修改标头
- excel - 如何将宏应用于整个列?
- mysql - M 连接表
- .net - .Net 核心,发布到 Plesk。500内部服务器错误
- docker - docker build - 无法打开 TUN/TAP dev /dev/net/tun
- ios - 如何将一天中的步数保存到 firebase 数据库?
- r - 如何检查 100 个等维矩阵中有多少是相等的?
- php - 在codeigniter中外部连接两个表
- hyperledger-fabric - 为什么 Chaincode 实例化尝试连接到本地对等方时出错?