Re: Null Pointer Exception
The API should really catch this situation. Basically, you are calling a function that requires an input but you are not providing one. In that case the API sets the input to "null", and the detailed operation is called. The detailed operation is not expecting a null input. This is API piece that is not flagging the error properly: // Parse the input Configuration input; if (protocol.equals("json")) { if (argument.length() != 0) { input = new Configuration(); input.fromJSON(argument); } else input = null; } else { response.sendError(response.SC_BAD_REQUEST,"Unknown API protocol: "+protocol); return; } Since this is POST, it should assume that the input cannot be null, and if it is, it's a bad request. Karl On Mon, Oct 25, 2021 at 2:44 AM ritika jain wrote: > Hi, > > I am getting Null pointer exceptions while creating a job programmatic > approach via PHP. > Can anybody suggest the reason for this?. > >Error 500 Server Error > HTTP ERROR 500 Problem accessing > /mcf-api-service/json/jobs. Reason: Server ErrorCaused > by:java.lang.NullPointerException at > org.apache.manifoldcf.agents.system.ManifoldCF.findConfigurationNode(ManifoldCF.java:208) > at > org.apache.manifoldcf.crawler.system.ManifoldCF.apiPostJob(ManifoldCF.java:3539) > at > org.apache.manifoldcf.crawler.system.ManifoldCF.executePostCommand(ManifoldCF.java:3585) > at > org.apache.manifoldcf.apiservlet.APIServlet.executePost(APIServlet.java:576) > at org.apache.manifoldcf.apiservlet.APIServlet.doPost(APIServlet.java:175) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769) at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) > 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:1125) > 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:1059) > 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.HandlerList.handle(HandlerList.java:52) > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) > at org.eclipse.jetty.server.Server.handle(Server.java:497) at > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) > at > org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) > at java.lang.Thread.run(Thread.java:748) Powered by > Jetty:// > >
Null Pointer Exception
Hi, I am getting Null pointer exceptions while creating a job programmatic approach via PHP. Can anybody suggest the reason for this?. Error 500 Server Error HTTP ERROR 500 Problem accessing /mcf-api-service/json/jobs. Reason: Server ErrorCaused by:java.lang.NullPointerException at org.apache.manifoldcf.agents.system.ManifoldCF.findConfigurationNode(ManifoldCF.java:208) at org.apache.manifoldcf.crawler.system.ManifoldCF.apiPostJob(ManifoldCF.java:3539) at org.apache.manifoldcf.crawler.system.ManifoldCF.executePostCommand(ManifoldCF.java:3585) at org.apache.manifoldcf.apiservlet.APIServlet.executePost(APIServlet.java:576) at org.apache.manifoldcf.apiservlet.APIServlet.doPost(APIServlet.java:175) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) 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:1125) 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:1059) 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.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:497) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) at java.lang.Thread.run(Thread.java:748) Powered by Jetty://
Re: Null pointer exception when accessed the job info thru mcf api service
Hi Smitha, This is highly unusual because it basically indicates potential database corruption. ManifoldCF is unable to load one or more jobs out of the database. Can you tell me: (1) What version of ManifoldCF are you using? (2) Have you modified the ManifoldCF code in any way? Thanks, Karl On Mon, Aug 24, 2015 at 2:34 AM, Smitha S smitha_...@infosys.com wrote: Hi Karl, We are facing some issues with manifoldCF. In ManifoldUI, everything shows up except, list of jobs. There are no logs displayed in log file. Also when we try to get job information of a particular job through mcf api service, we are getting null pointer exception. We tried lock clean, restarted server. But its of no use. Could you please help us in identifying the root cause. Please find the response below. h1HTTP Status 500 - /h1HR size=1 noshade=noshadepbtype/b Exception report/ppbmessage/b u/u/ppbdescription/b uThe server encountered an internal error that prevented it from fulfilling this request./u/ppbexception/b *prejava.lang.NullPointerException* org.apache.manifoldcf.crawler.jobs.PipelineManager.getRows( *PipelineManager.java:232*) org.apache.manifoldcf.crawler.jobs.Jobs.getJobsChunk( *Jobs.java:3521*) org.apache.manifoldcf.crawler.jobs.Jobs.getJobsMultiple( *Jobs.java:3451*) org.apache.manifoldcf.crawler.jobs.Jobs$JobObjectExecutor.create( *Jobs.java:3644*) org.apache.manifoldcf.core.cachemanager.CacheManager.findObjectsAndExecute( *CacheManager.java:146*) org.apache.manifoldcf.crawler.jobs.Jobs.loadMultipleInternal( *Jobs.java:857*) org.apache.manifoldcf.crawler.jobs.Jobs.loadMultiple( *Jobs.java:838*) org.apache.manifoldcf.crawler.jobs.Jobs.load(*Jobs.java:816*) org.apache.manifoldcf.crawler.jobs.JobManager.load( *JobManager.java:794*) org.apache.manifoldcf.crawler.system.ManifoldCF.apiReadJob( *ManifoldCF.java:1296*) org.apache.manifoldcf.crawler.system.ManifoldCF.executeReadCommand( *ManifoldCF.java:2898*) org.apache.manifoldcf.apiservlet.APIServlet.executeRead( *APIServlet.java:232*) org.apache.manifoldcf.apiservlet.APIServlet.doGet( *APIServlet.java:78*) javax.servlet.http.HttpServlet.service(*HttpServlet.java:621*) javax.servlet.http.HttpServlet.service(*HttpServlet.java:728*) org.apache.tomcat.websocket.server.WsFilter.doFilter( *WsFilter.java:51*)/pre/ppbnote/b Thanks Regards, Smitha S CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Null pointer exception when accessed the job info thru mcf api service
Hi Karl, We are facing some issues with manifoldCF. In ManifoldUI, everything shows up except, list of jobs. There are no logs displayed in log file. Also when we try to get job information of a particular job through mcf api service, we are getting null pointer exception. We tried lock clean, restarted server. But its of no use. Could you please help us in identifying the root cause. Please find the response below. h1HTTP Status 500 - /h1HR size=1 noshade=noshadepbtype/b Exception report/ppbmessage/b u/u/ppbdescription/b uThe server encountered an internal error that prevented it from fulfilling this request./u/ppbexception/b prejava.lang.NullPointerException org.apache.manifoldcf.crawler.jobs.PipelineManager.getRows(PipelineManager.java:232) org.apache.manifoldcf.crawler.jobs.Jobs.getJobsChunk(Jobs.java:3521) org.apache.manifoldcf.crawler.jobs.Jobs.getJobsMultiple(Jobs.java:3451) org.apache.manifoldcf.crawler.jobs.Jobs$JobObjectExecutor.create(Jobs.java:3644) org.apache.manifoldcf.core.cachemanager.CacheManager.findObjectsAndExecute(CacheManager.java:146) org.apache.manifoldcf.crawler.jobs.Jobs.loadMultipleInternal(Jobs.java:857) org.apache.manifoldcf.crawler.jobs.Jobs.loadMultiple(Jobs.java:838) org.apache.manifoldcf.crawler.jobs.Jobs.load(Jobs.java:816) org.apache.manifoldcf.crawler.jobs.JobManager.load(JobManager.java:794) org.apache.manifoldcf.crawler.system.ManifoldCF.apiReadJob(ManifoldCF.java:1296) org.apache.manifoldcf.crawler.system.ManifoldCF.executeReadCommand(ManifoldCF.java:2898) org.apache.manifoldcf.apiservlet.APIServlet.executeRead(APIServlet.java:232) org.apache.manifoldcf.apiservlet.APIServlet.doGet(APIServlet.java:78) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)/pre/ppbnote/b Thanks Regards, Smitha S CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: Null pointer exception when accessed the job info thru mcf api service
From what I can see from the trace, your jobs table is missing a row which your pipeline table references. I don't know how you got into that situation, so I don't know how to fix it. Can you tell me what database this is? Karl On Mon, Aug 24, 2015 at 6:59 AM, Smitha S smitha_...@infosys.com wrote: Hi Karl, We are MCF2.0.2 and we haven’t done any modification of the code. Is there any way I can recover from this situation. Do we need to reinitialize the DB? Thanks Regards, Smitha S *From:* Karl Wright [mailto:daddy...@gmail.com] *Sent:* Monday, August 24, 2015 4:25 PM *To:* Smitha S *Cc:* user@manifoldcf.apache.org; user-h...@manifoldcf.apache.org *Subject:* Re: Null pointer exception when accessed the job info thru mcf api service Hi Smitha, This is highly unusual because it basically indicates potential database corruption. ManifoldCF is unable to load one or more jobs out of the database. Can you tell me: (1) What version of ManifoldCF are you using? (2) Have you modified the ManifoldCF code in any way? Thanks, Karl On Mon, Aug 24, 2015 at 2:34 AM, Smitha S smitha_...@infosys.com wrote: Hi Karl, We are facing some issues with manifoldCF. In ManifoldUI, everything shows up except, list of jobs. There are no logs displayed in log file. Also when we try to get job information of a particular job through mcf api service, we are getting null pointer exception. We tried lock clean, restarted server. But its of no use. Could you please help us in identifying the root cause. Please find the response below. h1HTTP Status 500 - /h1HR size=1 noshade=noshadepbtype/b Exception report/ppbmessage/b u/u/ppbdescription/b uThe server encountered an internal error that prevented it from fulfilling this request./u/ppbexception/b *prejava.lang.NullPointerException* org.apache.manifoldcf.crawler.jobs.PipelineManager.getRows( *PipelineManager.java:232*) org.apache.manifoldcf.crawler.jobs.Jobs.getJobsChunk( *Jobs.java:3521*) org.apache.manifoldcf.crawler.jobs.Jobs.getJobsMultiple( *Jobs.java:3451*) org.apache.manifoldcf.crawler.jobs.Jobs$JobObjectExecutor.create( *Jobs.java:3644*) org.apache.manifoldcf.core.cachemanager.CacheManager.findObjectsAndExecute( *CacheManager.java:146*) org.apache.manifoldcf.crawler.jobs.Jobs.loadMultipleInternal( *Jobs.java:857*) org.apache.manifoldcf.crawler.jobs.Jobs.loadMultiple( *Jobs.java:838*) org.apache.manifoldcf.crawler.jobs.Jobs.load(*Jobs.java:816*) org.apache.manifoldcf.crawler.jobs.JobManager.load( *JobManager.java:794*) org.apache.manifoldcf.crawler.system.ManifoldCF.apiReadJob( *ManifoldCF.java:1296*) org.apache.manifoldcf.crawler.system.ManifoldCF.executeReadCommand( *ManifoldCF.java:2898*) org.apache.manifoldcf.apiservlet.APIServlet.executeRead( *APIServlet.java:232*) org.apache.manifoldcf.apiservlet.APIServlet.doGet( *APIServlet.java:78*) javax.servlet.http.HttpServlet.service(*HttpServlet.java:621*) javax.servlet.http.HttpServlet.service(*HttpServlet.java:728*) org.apache.tomcat.websocket.server.WsFilter.doFilter( *WsFilter.java:51*)/pre/ppbnote/b Thanks Regards, Smitha S CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***