Highlighted

Can't use GraphQL in the AEM

lif66417554

11-07-2018

Hi everyone,

I added GraphQL  to the bundle in the AEM and it caused bundle start failed.

1. I have a bundle project and it works fine in the AEM.  Bundle start command : 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>

1526412_pastedImage_5.png

2. I add below config to the pom.xml then reinstall bundle and bundle still work fine.

<dependency>

<groupId>com.graphql-java</groupId>

<artifactId>graphql-java</artifactId>

<version>3.0.0</version>

</dependency>

3. I added two demo classes to my project and reinstall bundle. Bundle start failed. GraphQL_SImple.java and User.java can be found in the GraphQL-Demo/GraphQL_Simple.java at master · zhaiqianfeng/GraphQL-Demo · GitHub

1526413_pastedImage_9.png

1526417_pastedImage_10.png

4. Error message is :

12.07.2018 14:55:17.223 *ERROR* [qtp1398311933-54244] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unable to resolve com.mb.graphql.mb-graphql.core [528](R 528.27): missing requirement [com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql) Unresolved requirements: [[com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql)])

org.osgi.framework.BundleException: Unable to resolve com.mb.graphql.mb-graphql.core [528](R 528.27): missing requirement [com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql) Unresolved requirements: [[com.mb.graphql.mb-graphql.core [528](R 528.27)] osgi.wiring.package; (osgi.wiring.package=graphql)]

at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4112)

at org.apache.felix.framework.Felix.startBundle(Felix.java:2118)

at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)

at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)

at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:364)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:563)

at org.apache.felix.webconsole.internal.servlet.OsgiManager$3.run(OsgiManager.java:465)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:461)

at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)

at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)

at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:138)

at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:295)

at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)

at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:96)

at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:128)

at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

at org.eclipse.jetty.server.Server.handle(Server.java:499)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

at java.lang.Thread.run(Unknown Source)

Is anyone face same issue and know how to fix it?

Thanks

Replies