nateyolles / publick-sling-blog

Blog engine using Apache Sling and Sightly
Apache License 2.0
42 stars 27 forks source link

Core bundle won't start #5

Open gdoublev opened 8 years ago

gdoublev commented 8 years ago

First I had some issue (deadlock, I believe) installing dependencies. After installing dependencies, attempting to start the core bundle resulted in the following error:

From Sling Error Log:

25.06.2016 14:30:19.524 ERROR [qtp1160038540-43] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unable to resolve com.nateyolles.sling.publick.core [128](R 128.0): missing requirement [com.nateyolles.sling.publick.core [128](R 128.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.http.client)(version>=4.5.0)) Unresolved requirements: [[com.nateyolles.sling.publick.core [128](R 128.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.http.client)(version>=4.5.0))]) org.osgi.framework.BundleException: Unable to resolve com.nateyolles.sling.publick.core [128](R 128.0): missing requirement [com.nateyolles.sling.publick.core [128](R 128.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.http.client)(version>=4.5.0)) Unresolved requirements: [[com.nateyolles.sling.publick.core [128](R 128.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.http.client)(version>=4.5.0))] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4114) at org.apache.felix.framework.Felix.startBundle(Felix.java:2111) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:964) at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:365) 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:567) 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:129) 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:89) 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.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75) 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:124) at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) 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:310) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) 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(Thread.java:745)

So I had to manually stop the org.apache.http.client bundle, then attempt to install dependencies again. Sling 8's launchpad comes with http client 4.4, whereas Publick requires 4.5. After resolving that issue, when I try to start the core bundle, I get the following:

From Sling Error Log:

25.06.2016 13:15:54.992 ERROR [qtp1782846247-40] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Activator start error in bundle com.nateyolles.sling.publick.core [128].) org.osgi.framework.BundleException: Activator start error in bundle com.nateyolles.sling.publick.core [128]. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2270) at org.apache.felix.framework.Felix.startBundle(Felix.java:2138) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:964) at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:365) 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:567) 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:129) 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:89) 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.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75) 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:124) at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808) 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:310) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) 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(Thread.java:745) Caused by: java.lang.NullPointerException: null at com.nateyolles.sling.publick.Activator.setWritable(Activator.java:138) at com.nateyolles.sling.publick.Activator.setPermissions(Activator.java:75) at com.nateyolles.sling.publick.Activator.start(Activator.java:61) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2220) ... 41 common frames omitted

If it helps at all, I'm on a new EC2 instance with Amazon Linux:

$ mvn -v Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00) Maven home: /usr/local/maven/current Java version: 1.8.0_91, vendor: Oracle Corporation Java home: /usr/java/jdk1.8.0_91/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.4.11-23.53.amzn1.x86_64", arch: "amd64", family: "unix"

If there's any other information I can provide to help resolve this, please let me know! Thanks!

daehwann commented 8 years ago

It is because an absence of a group "authors" which is required. Active the bundle after generate the group using:

curl -u admin:admin -F:name=authors http://localhost:8080/system/userManager/group.create.html
apurvc commented 8 years ago

Running org.apache.sling.launchpad-8.jar I had to install httpcomponents-client-4.5.2.jar to resolve the dependency and then running above curl command allowed me to run the app.

Posting it so that it could be useful for someone else.