[
https://issues.apache.org/jira/browse/CAMEL-12548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499688#comment-16499688
]
ASF GitHub Bot commented on CAMEL-12548:
----------------------------------------
GitHub user tadayosi opened a pull request:
https://github.com/apache/camel/pull/2357
CAMEL-12548: NullPointerException in camel-cmis when using wrong cred…
…entials
It makes sure the sessionFacade is assgined to the field only after the
session is successfully initialised, so that the sessionFacade never dangles in
an incomplete state.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tadayosi/camel CAMEL-12548
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/2357.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2357
----
commit 08aa6124bc710179b608ed1538d966ea91b1f39b
Author: Tadayoshi Sato <sato.tadayoshi@...>
Date: 2018-06-04T02:46:53Z
CAMEL-12548: NullPointerException in camel-cmis when using wrong credentials
----
> NullPointerException in camel-cmis when using wrong credentials
> ---------------------------------------------------------------
>
> Key: CAMEL-12548
> URL: https://issues.apache.org/jira/browse/CAMEL-12548
> Project: Camel
> Issue Type: Bug
> Components: camel-cmis
> Affects Versions: 2.21.1
> Reporter: Tadayoshi Sato
> Assignee: Tadayoshi Sato
> Priority: Major
>
> If you try to send something via cmis (uri in blueprint: {{"cmis:// ... "}})
> and you use a wrong password then on the second (and all subsequent) tries
> you will get a {{NullPointerExceptionException}}.
> Stacktrace:
> {code}
> java.lang.NullPointerException
> at
> org.apache.camel.component.cmis.CMISSessionFacade.getCMISTypeFor(CMISSessionFacade.java:221)
> at
> org.apache.camel.component.cmis.CMISProducer.isFolder(CMISProducer.java:146)
> at
> org.apache.camel.component.cmis.CMISProducer.parentFolderPathFor(CMISProducer.java:132)
> at
> org.apache.camel.component.cmis.CMISProducer.createNode(CMISProducer.java:101)
> at org.apache.camel.component.cmis.CMISProducer.process(CMISProducer.java:62)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:113)
> at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:84)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:121)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)
> at
> org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.asyncInvoke(CxfConsumer.java:165)
> at
> org.apache.camel.component.cxf.CxfConsumer$CxfConsumerInvoker.invoke(CxfConsumer.java:144)
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)
> at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
> at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:218)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
> at
> org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)
> 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.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)
> 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:258)
> 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(Thread.java:748)
> {code}
> The {{CMISProducer}} creates a {{CMISSessionFacade}}
> ({{CMISProducer.getSessionFacade()}}), delegates the initialization of a
> session to the facade ({{CMISSessionFacade.initSession()}}) and stores the
> facade inside a member variable. The {{CMISSessionFacade}} creates a Session,
> tries to connect to the remote system and stores the created Session object
> inside a member variable. If the provided password for the remote system is
> wrong then at this point a {{CmisUnauthorizedException}} (basically a
> {{RuntimeException}}) is thrown.
> ({{org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException:
> Unauthorized}})
> This behavior is ok but the consequence is that a member variable inside the
> {{CMISSessionFacade}} (called "session") is still null.
> Camel caches the {{CMISProducer}} with its reference to {{CMISSessionFacade}}
> whose "session" is set to null. If you try to send something else via cmis
> then you get the {{NullPointerException}} as described above.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)