tracker issue : CF-4204110

select a category, or use search below
(searches all categories and all time range)
Title:

java.lang.NullPointerException in ElasticSearch: Exception occurred while calling indexDocument

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): A. B. / ()

Created: 03/20/2019

Components: Web Services, REST Service

Versions: 2018

Failure Type: Others

Found In Build/Fixed In Build: 2018.0.03.314033 / CF2018U5

Priority/Frequency: Normal /

Locale/System: / Win 2016

Vote Count: 0

Problem Description: When a request is made to our REST services, in particular, we get a NullPointerException for every request. Nevertheless, each REST request runs as expected, producing the designed result.

Steps to Reproduce:
Our ColdFusion instance uses the following code in the onApplicationStart() eventhandler:

try {
         restInitApplication(this.appRoot & "nl/deviant/stdrdr/rest", "srv2", {isDefault=false});
} catch (any e) {
    //Do Nothing. RestApp already initialized.
} 

Note that, in the issue at hand, the REST app-name is "srv2", which may be relevant.

 The ColdFusion documentation says that repeated calls to restInitApplication() will simply refresh an existing REST application. However, we have been getting an error instead. It occurs only at the very first REST request following a restart of the ColdFusion instance, hence we have so far ignored the autoregister exception. The exception is:

 "Error","ajp-nio-8016-exec-3","03/19/19","04:59:07","","Error when trying to autoregister the application. Directory file:/E:/wwwroot/www_stdrdr_nl/htdocs/nl/deviant/stdrdr/rest/ is already registered with REST."

coldfusion.rest.JaxRsServiceImpl$NestedRestAppException: Nested REST service can not be registered.
         at coldfusion.rest.JaxRsServiceImpl.updateApplication(JaxRsServiceImpl.java:501)
         at coldfusion.rest.JaxRsAppEventListener.onApplicationStart(JaxRsAppEventListener.java:168)
         at coldfusion.filter.ApplicationFilter.fireAppStartEvent(ApplicationFilter.java:825)
         at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:428)
         at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43)
         at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
         at coldfusion.filter.PathFilter.invoke(PathFilter.java:162)
         at coldfusion.filter.IpFilter.invoke(IpFilter.java:45)
         at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:96)
         at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
         at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
         at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60)
         at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
         at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
         at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
         at coldfusion.CfmServlet.service(CfmServlet.java:226)
         at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
         at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46)
         at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:764)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:344)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:207)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:801)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)

         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54)
         at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:41)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
         at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:422)
         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
         at java.base/java.lang.Thread.run(Thread.java:844)



Actual Result:
The exception that corresponds to the present error (from ColdFusion's exception.log) is:

"Error","ajp-nio-8016-exec-9","03/19/19","08:37:36","","Exception occurred while calling indexDocument : for url /misc_data/applications/srv2_10.233.92.204:sr1studiereader4:8504/_update?retry_on_conflict=5 with document {""doc_as_upsert"":true,""doc"":{""rest"":true,""app_name"":""srv2"",""cluster_id"":null,""instance_id"":""10.233.92.204:sr1studiereader4:8504"",""group_id"":null}}"

java.lang.NullPointerException
         at coldfusion.monitor.es.ElasticSearchClient.indexDocument(ElasticSearchClient.java:710)
         at coldfusion.monitor.es.Configuration.updateAppList(Configuration.java:204)
         at coldfusion.monitor.event.RequestMonitorEventProcessor.onRestStart(RequestMonitorEventProcessor.java:1059)
         at coldfusion.rest.servlet.CFRestServletContainer.service(CFRestServletContainer.java:132)
         at coldfusion.rest.servlet.CFRestServletContainer.service(CFRestServletContainer.java:83)
         at coldfusion.rest.servlet.CFRestServlet.serviceUsingAlreadyInitializedContainers(CFRestServlet.java:1395)
         at coldfusion.rest.servlet.CFRestServlet.invoke(CFRestServlet.java:938)
         at coldfusion.rest.servlet.RestFilter.invoke(RestFilter.java:60)
         at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:96)
         at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
         at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
         at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
         at coldfusion.rest.servlet.CFRestServlet.invoke(CFRestServlet.java:526)
         at coldfusion.rest.servlet.CFRestServlet.service(CFRestServlet.java:517)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
         at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
         at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46)
         at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
         at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
         at jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:764)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:344)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:207)
         at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:801)
        at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
         at jdk.internal.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71)
         at jdk.internal.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
         at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54)
         at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:41)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
         at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:422)
         at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
         at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388)
         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
         at java.base/java.lang.Thread.run(Thread.java:844)

Expected Result:
No java.lang.NullPointerException  at coldfusion.monitor.es.ElasticSearchClient.indexDocument(ElasticSearchClient.java:710)

Any Workarounds:
Not relevant

Attachments:

Comments:

After we installed the newest ColdFusion 2018 builds (update 2 and update 3), ColdFusion wrote just one single line to the log file monitor.log whenever an instance was restarted. The line was: "Information","Thread-58","03/14/19","04:19:25","","Monitoring Service stopped." However, since this issue started, ColdFusion has been writing the line "Error","ajp-nio-8014-exec-5","03/15/19","08:31:00","","Error updating application list with application name srv2 status code 500" whenever there is a REST request. See the attached monitor.log file.
Comment by A. B.
30549 | March 21, 2019 05:02:37 PM GMT
I should like to share some information I found in my research into this issue. 1) The issue involves ElasticSearchClient.class which is located in the package coldfusion.monitor.es in ColdFusion's cfusion.jar. An exception is apparently triggered in the try part in the function indexDocument. 2) The issue started immediately after we installed FusionReactor 8.0.1 (used for monitoring our instances). Working together with the FusionReactor Support Team, we have ruled out FusionReactor as the cause of the problem. However, we wonder whether FusionReactor triggered a monitoring setting in ColdFusion that causes the problem.
Comment by A. B.
30550 | March 21, 2019 05:17:04 PM GMT
You may rule out the "NESTED REST" error as the cause of the java.lang.NullPointerException at coldfusion.monitor.es.ElasticSearchClient.indexDocument(ElasticSearchClient.java:710) We did solve the NESTED REST problem. The solution was to add the key:value pair autoregister:false to this.restSettings in Application.cfc. After that, there were no longer any NESTED REST error messages. Nevertheless, the NullPointerException continues.
Comment by A. B.
30566 | March 26, 2019 11:04:56 AM GMT
 Thanks for reporting this. This bug is fixed and will be integrated in the next bug fix HF release.  A patch is shared with CF Support (cfsupport@adobe.com). Please reach out to them if you need the fix urgently. The patch should be applied on the top of HF3. 
Comment by Nitin K.
30585 | March 29, 2019 07:07:07 AM GMT
Hi Nitin, Thank you for the tip. Regards, Alfred Bakia
Comment by A. B.
30586 | March 29, 2019 08:23:44 AM GMT