Hi Justin, I finally got the problem. The issue was actually in the jar file itself. I am using proguard-maven-plugin to include classes from another bundle, and it looks like the procedure modifies the final out jar so that the MANIFEST.MF file is no more the first entry, hence the getManifest() method returns null. Though I still wonder why this should cause an exception. I'm not sure about the version of Jetty, it should be 7.0.1.v20091125. By inspecting the code it looks like the passed throwable is null... and the 2.0.4 version of org.apache.felix.framework.Logger actually confirms that.
Anyway, thank you very much for the quick reply! Davide On Mon, Apr 12, 2010 at 5:20 PM, Justin Edelson <[email protected]>wrote: > I don't see how adding a file to the WAR would create this particular > exception. What version of Jetty are you using? > > To build a Sling/Launchpad war, you can use the maven-launchpad-plugin. > I posted a (relatively) simple POM which creates a WAR will Sling plus > one extra bundle: http://gist.github.com/363643 > > This should go on the Sling site or wiki, but Confluence is down now AFAIK. > > Justin > > On 4/12/10 6:54 AM, Davide Maestroni wrote: > > Hi everybody, > > > > I would like to create a Sling war containing an additional bundle which > > should be installed after Sling start up. > > Unfortunately the info I found at > > http://sling.apache.org/site/launch-sling.html look to be outdated, so I > > have no hint on how to do that. I tried to simply add a "20" folder under > > "WEB-INF\resources\bundles" and re-deploy the war, but I always get the > > following exception: > > > > 2010-04-12 12:50:04.906:WARN:/sling:ERROR: Unable to start system bundle. > > (java. > > lang.NullPointerException) > > java.lang.NullPointerException > > at > org.eclipse.jetty.util.log.StdErrLog.format(StdErrLog.java:290) > > at org.eclipse.jetty.util.log.StdErrLog.warn(StdErrLog.java:207) > > at > > org.eclipse.jetty.server.handler.ContextHandler$Context.log(ContextHa > > ndler.java:1696) > > at > > org.apache.sling.launchpad.base.webapp.SlingServletDelegate$ServletCo > > ntextLogger.doLog(SlingServletDelegate.java:437) > > at org.apache.felix.framework.Logger._log(Logger.java:156) > > at org.apache.felix.framework.Logger.log(Logger.java:89) > > at > > org.apache.sling.launchpad.base.impl.BootstrapInstaller.installBundle > > (BootstrapInstaller.java:575) > > at > > org.apache.sling.launchpad.base.impl.BootstrapInstaller.installBundle > > s(BootstrapInstaller.java:541) > > at > > org.apache.sling.launchpad.base.impl.BootstrapInstaller.start(Bootstr > > apInstaller.java:279) > > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAct > > ion.java:661) > > at > > org.apache.felix.framework.Felix$SystemBundleActivator.start(Felix.ja > > va:4066) > > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAct > > ion.java:661) > > at org.apache.felix.framework.Felix.init(Felix.java:684) > > at > org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:229) > > at > > org.apache.sling.launchpad.base.webapp.SlingBridge.<init>(SlingBridge > > .java:41) > > at > > org.apache.sling.launchpad.base.webapp.SlingServletDelegate.init(Slin > > gServletDelegate.java:201) > > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > > at > > org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServle > > t.java:334) > > at > > org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServle > > t.java:278) > > at > > org.apache.sling.launchpad.webapp.SlingServlet.init(SlingServlet.java > > :93) > > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > > at > > org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.jav > > a:421) > > at > > org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:24 > > 5) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja > > va:699) > > at > > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC > > ontextHandler.java:193) > > at > > org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav > > a:978) > > at > > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle > > r.java:586) > > at > > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349 > > ) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCol > > lection.java:165) > > at > > org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(Con > > textHandlerCollection.java:162) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCol > > lection.java:165) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrappe > > r.java:92) > > at org.eclipse.jetty.server.Server.doStart(Server.java:228) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:99 > > 0) > > at java.security.AccessController.doPrivileged(Native Method) > > at > > org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:955 > > ) > > 2010-04-12 12:50:05.171:WARN:/sling:sling: Failed to start Sling in > > sling/_sling > > > > java.lang.RuntimeException: Unable to start system bundle. > > at org.apache.felix.framework.Felix.init(Felix.java:691) > > at > org.apache.sling.launchpad.base.impl.Sling.<init>(Sling.java:229) > > at > > org.apache.sling.launchpad.base.webapp.SlingBridge.<init>(SlingBridge > > .java:41) > > at > > org.apache.sling.launchpad.base.webapp.SlingServletDelegate.init(Slin > > gServletDelegate.java:201) > > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > > at > > org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServle > > t.java:334) > > at > > org.apache.sling.launchpad.webapp.SlingServlet.startSling(SlingServle > > t.java:278) > > at > > org.apache.sling.launchpad.webapp.SlingServlet.init(SlingServlet.java > > :93) > > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > > at > > org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.jav > > a:421) > > at > > org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:24 > > 5) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja > > va:699) > > at > > org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC > > ontextHandler.java:193) > > at > > org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav > > a:978) > > at > > org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle > > r.java:586) > > at > > org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349 > > ) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCol > > lection.java:165) > > at > > org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(Con > > textHandlerCollection.java:162) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCol > > lection.java:165) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrappe > > r.java:92) > > at org.eclipse.jetty.server.Server.doStart(Server.java:228) > > at > > org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife > > Cycle.java:55) > > at > > org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:99 > > 0) > > at java.security.AccessController.doPrivileged(Native Method) > > at > > org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:955 > > > > To be clear, what I would like to achieve is a war which, when deployed, > > start up Sling and the repository (as per normal installation) and then, > > when everything is correctly running, install also the additional bundle. > > Can anyone tell me how to to that or point me to a page describing the > > correct procedure? > > > > Thank you very much, > > > > Davide > > > >
