Here’s the full stack trace from the sling error.log triggered by “adding” a 
bundle to the server from inside eclipse.
This shows the original felix NPE, the eclipse console did not.

14.11.2014 14:11:21.716 *INFO* [qtp124750626-43] 
org.apache.sling.tooling.support.install.impl.InstallServlet Unable to 
install/update bundle com.nim.ct.dam.bundle.ingest
org.osgi.framework.BundleException: Could not create bundle object.
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2960)
        at 
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
        at 
org.apache.sling.tooling.support.install.impl.InstallServlet.installOrUpdateBundle(InstallServlet.java:242)
        at 
org.apache.sling.tooling.support.install.impl.InstallServlet.installBasedOnUploadedJar(InstallServlet.java:149)
        at 
org.apache.sling.tooling.support.install.impl.InstallServlet.doPost(InstallServlet.java:101)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at 
org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:339)
        at 
org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:300)
        at 
org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:93)
        at 
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:50)
        at 
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:31)
        at 
org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)
        at 
org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:108)
        at 
org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:80)
        at 
org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:46)
        at 
org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:31)
        at 
org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:76)
        at 
org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:49)
        at 
org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at 
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at 
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at 
org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
        at 
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at 
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
        at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: null
        at 
org.apache.felix.framework.BundleProtectionDomain.<init>(BundleProtectionDomain.java:46)
        at 
org.apache.felix.framework.Felix.setBundleProtectionDomain(Felix.java:877)
        at 
org.apache.felix.framework.BundleImpl.addRevision(BundleImpl.java:1213)
        at org.apache.felix.framework.BundleImpl.<init>(BundleImpl.java:113)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:2907)
        ... 42 common frames omitted

From: Bruce Edge 
<[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Friday, November 14, 2014 at 7:47 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: State of sling eclipse plugins for IDE deploy/undeploy.

HI Robert,

Regarding the sling console log, I tried in debug mode and got no output on the 
console at all. Specifically, while viewing the sling console, right click on 
the sling server and choose Debug. No console output at all, although I can see 
the debugger attach in the debug view form the threads displayed.

BTW, as the sling server is on a VM, I changed the "Specify how to install 
bundles on the server”
from: Install bundles directly from the filesystem
to:  Install bundles via bundle upload
As my eclipse instance doesn’t have access to the target VM’s filesystem

If I disconnect the server and start again with “Start” rather than “Debug”, I 
get a lot of output on the console, ending with:


[November 14, 2014 7:33:26 AM PST] ListChildrenCommand -> / : JcrResult[ 
success:true] (27 ms

Then when I “add” my bundle to the server I get an error dialog with:


Failed installing bundle : Unable to install/update bundle 
com.nim.ct.dam.bundle.ingest : Could not create bundle object.

Unable to install/update bundle com.nim.ct.dam.bundle.ingest : Could not create 
bundle object.


and an exception in the log:


[November 14, 2014 7:36:30 AM PST] InstallJarredBundle -> 
/Users/bedge/git/server/content/dam/postIngest/target/classes : FAILED (45 ms)

org.apache.sling.ide.osgi.OsgiClientException: Unable to install/update bundle 
com.nim.ct.dam.bundle.ingest : Could not create bundle object.

at 
org.apache.sling.ide.osgi.impl.HttpOsgiClient$LocalBundleInstaller.installBundle(HttpOsgiClient.java:216)

at 
org.apache.sling.ide.osgi.impl.HttpOsgiClient.installLocalBundle(HttpOsgiClient.java:191)

at 
org.apache.sling.ide.osgi.impl.TracingOsgiClient.logInstallLocalBundle(TracingOsgiClient.java:73)

at 
org.apache.sling.ide.osgi.impl.TracingOsgiClient.installLocalBundle(TracingOsgiClient.java:101)

at 
org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishBundleModule(SlingLaunchpadBehaviour.java:347)

at 
org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:219)

at 
org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091)

at 
org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183)

at 
org.apache.sling.ide.eclipse.core.internal.ServerBehaviourDelegateWithModulePublishSupport.publish(ServerBehaviourDelegateWithModulePublishSupport.java:137)

at 
org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)

at 
org.apache.sling.ide.eclipse.core.internal.ServerBehaviourDelegateWithModulePublishSupport.publish(ServerBehaviourDelegateWithModulePublishSupport.java:54)

at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3157)

at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54

Note that this same bundle does deploy with maven.

-Bruce

From: Robert Munteanu 
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
Reply-To: 
"[email protected]<mailto:[email protected]><mailto:[email protected]>"
 
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
Date: Friday, November 14, 2014 at 5:07 AM
To: 
"[email protected]<mailto:[email protected]><mailto:[email protected]>"
 
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
Subject: Re: State of sling eclipse plugins for IDE deploy/undeploy.

Hi Bruce,

On Thu, Nov 13, 2014 at 8:57 AM, Bruce Edge
<[email protected]<mailto:[email protected]><mailto:[email protected]>>
 wrote:
Also, I found 2 plugins that seem to be similar,
http://docs.adobe.com/content/docs/en/dev-tools/aem-eclipse.html
http://sling.apache.org/documentation/development/ide-tooling.html
Which to people use?

I settled on the non-adobe one as I'm not using CQ.

Well, that's the right approach. For now, the Adobe plugins add a new
project wizard and some AEM branding. The new project wizard generates
a project based on AEM libraries so it would not deploy on Sling at
all. The rest of the features come from the Sling IDE Tooling anyway.


Does anyone actually use the eclipse sling plugin to add/remove bundles to/from 
a sling server?

I got a doPost SlingAllMethodsServlet working, but only through the maven 
plugin, i.e.:
mvn org.apache.sling:maven-sling-plugin:install-file 
-Dsling.file=ingest-2.2.2.jar

Connecting to a sling server from the plugin's server manager works, as does 
the debugging. So just the deploy/undeploy seems broken.
I'm running on nonstandard ports (not 8080) for conflict reasons, is there 
anything that needs to change other than in the server's config?


That should work, I'm using it for day-to-day work. A couple of questions:

1. Do you have anything in the sling log that indicates an error
deploying from Eclipse?
2. If you open the Sling console ( see [1] ) do you see anything
related to installing local bundles?

Thanks,

Robert

[1]: 
https://sling.apache.org/documentation/development/ide-tooling.html#gathering-debug-information


I do have the port setup in the pom:
             <plugin>
                 <groupId>org.apache.sling</groupId>
                 <artifactId>maven-sling-plugin</artifactId>
                 <version>2.1.0</version>
                 <configuration>
                     <slingUrl>http://localhost:8090/system/console</slingUrl>
                     <user>admin</user>
                     <password>admin</password>
                 </configuration>
             </plugin>

-Bruce


Reply via email to