Hello,

I have downloaded sling 8 from https://github.com/apache/sling and using the 
launchpad jar file I have installed the distribution bundles api, core, sample 
and dependencies in the author instance running at 8080 and also at the publish 
instance running at port 8090.

I want to test the forward distribution use case, described at 
contrib/extensions/distribution/README.md. I am running into 
UnsupportedOperationException and I need help on how to fix this issue please?

Based on the information available in the README.md, I am trying to configure 
an agent on the author instance using POSTMAN from Chrome browser and I have 
specified admin/admin as authorization details. I can verify GET on 
http://localhost:8080/libs/sling/distribution/services/agents.json returns

{"sling:resourceType":"sling/distribution/service/agent/list","items":[]}

I interpret this to mean there no agents to start with.

When I do POST at http://localhost:8080/libs/sling/distribution/services/agents

Body is:

{
    "jcr:primaryType": "sling:OsgiConfig",

    "name": "publish",

    "serviceName" : "distributionService",

    "requestAuthorizationStrategy.target" : "(name=privilegeRead)",

    "packageBuilder.target": "(name=vlt)",

    "transportSecretProvider.target" : "(name=publishAdmin)",

    "packageImporter.endpoints": [
        
"http://localhost:4503/libs/sling/distribution/services/importers/default";
    ]
}

The response is:
Content modified /libs/sling/distribution/services/agents
Status
200

Message
OK

Location        /libs/sling/distribution/services/agents
Parent Location /libs/sling/distribution/services
Path
/libs/sling/distribution/services/agents

Referer

ChangeLog
<pre></pre>


Modified Resource

Parent of Modified Resource


I am assuming 
http://localhost:8090/libs/sling/distribution/services/importers/default must 
work and in the body importer endpoint must be changed. I still need to 
configure the importer on publish instance correctly.

However, GET http://localhost:8080/libs/sling/distribution/services/agents.json 
still returns

{"sling:resourceType":"sling/distribution/service/agent/list","items":[]}

I was expecting to see the publish agent that was added successfully by the 
previous Post. Why the agent is not listed by the Get operation?

>From access.log


0:0:0:0:0:0:0:1 - admin 30/Sep/2015:08:58:34 -0700 "POST 
/libs/sling/distribution/services/agents HTTP/1.1" 200 1490 "-" "Mozilla/5.0 
(Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/45.0.2454.99 Safari/537.36"

0:0:0:0:0:0:0:1 - admin 30/Sep/2015:09:03:47 -0700 "GET 
/libs/sling/distribution/services/agents.json HTTP/1.1" 200 73 "-" "Mozilla/5.0 
(Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/45.0.2454.99 Safari/537.36"

There are no errors in error.log

When I do POST 
http://localhost:8080/libs/sling/distribution/services/agents/publish?action=ADD&path=/content
 the response is:

Error while processing /libs/sling/distribution/services/agents/publish
Status
500

Message
org.apache.sling.api.SlingException: Exception during response processing.

Location        /libs/sling/distribution/services/agents/publish
Parent Location /libs/sling/distribution/services/agents
Path
/libs/sling/distribution/services/agents/publish

Referer

ChangeLog
<pre></pre>




In access.log

0:0:0:0:0:0:0:1 - admin 30/Sep/2015:09:14:31 -0700 "POST 
/libs/sling/distribution/services/agents/publish?action=ADD&path=/content 
HTTP/1.1" 500 1643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36"

In error.log

30.09.2015 09:14:31.901 *ERROR* [0:0:0:0:0:0:0:1 [1443629671899] POST 
/libs/sling/distribution/services/agents/publish HTTP/1.1] 
org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during 
response processing.
java.lang.UnsupportedOperationException: create 'publish' at 
/libs/sling/distribution/services/agents
at 
org.apache.sling.resourceresolver.impl.tree.ResourceProviderEntry.create(ResourceProviderEntry.java:514)
at 
org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:1132)
at 
org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.deepGetOrCreateNode(AbstractCreateOperation.java:581)
at 
org.apache.sling.servlets.post.impl.operations.AbstractCreateOperation.processCreate(AbstractCreateOperation.java:108)
at 
org.apache.sling.servlets.post.impl.operations.ModifyOperation.doRun(ModifyOperation.java:91)
at 
org.apache.sling.servlets.post.AbstractPostOperation.run(AbstractPostOperation.java:92)
at 
org.apache.sling.servlets.post.impl.SlingPostServlet.doPost(SlingPostServlet.java:202)
at 
org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:149)
at 
org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:345)
at 
org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:376)
at 
org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:546)
at 
org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
at 
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
at 
org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
at 
org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
at 
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:129)
at 
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at 
org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:95)
at 
org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
at 
org.apache.sling.engine.impl.SlingRequestProcessorImpl.doProcessRequest(SlingRequestProcessorImpl.java:151)
at 
org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:216)
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)


What do I need to do to fix the error above and successfully test the forward 
distribution use case?

Thanks and regards,


Information contained in this e-mail message is confidential. This e-mail 
message is intended only for the personal use of the recipient(s) named above. 
If you are not an intended recipient, do not read, distribute or reproduce this 
transmission (including any attachments). If you have received this email in 
error, please immediately notify the sender by email reply and delete the 
original message.

Reply via email to