RegisterOutput Error
Any idea why I would get this failure on registering my connector. Hadn't seen it before. I was trying to setup a new system and was issuing commands to setup the database. Note I was able to register Null Output and File System connectors without error. D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents. output.dupfinder.DupFinderConnector DupFinder Configuration file successfully read Exception in thread main java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.getConnectorNoCheck(OutputConnectorFactory.java:149) at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.install(OutputConnectorFactory.java:50) at org.apache.manifoldcf.agents.outputconnmgr.OutputConnectorManager.registerConnector(OutputConnectorManager.java:180) at org.apache.manifoldcf.agents.RegisterOutput.doExecute(RegisterOutput.java:47) at org.apache.manifoldcf.agents.TransactionalAgentsInitializationCommand.execute(TransactionalAgentsInitializationCommand.java:43) at org.apache.manifoldcf.agents.RegisterOutput.main(RegisterOutput.java:70) D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents.output.nullconnector.NullConnector NullOutput Configuration file successfully read Successfully registered output connector 'org.apache.manifoldcf.agents.output.nullconnector.NullConnector' D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.crawler.Register org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector FileSystem Configuration file successfully read Successfully registered connector 'org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector' D:\Program Files\Apache\ManifoldCF\myMCF
Re: RegisterOutput Error
Looking at the OutputConnectorFactory code, it seems there are two problems. The exception handling has a bug assuming a null value won't be passed. Line 149 says throw (ManifoldCFException) z; where z is null. The main problem is why registering my connector is now producing an InvocationTargetException? and it wasn't a problem before? public DupFinderConnector() throws ManifoldCFException { Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); calendar = Calendar.getInstance(); hashGen = new HashsumGenerator(); } On 6/8/2011 12:00 PM, Farzad Valad wrote: Any idea why I would get this failure on registering my connector. Hadn't seen it before. I was trying to setup a new system and was issuing commands to setup the database. Note I was able to register Null Output and File System connectors without error. D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents. output.dupfinder.DupFinderConnector DupFinder Configuration file successfully read Exception in thread main java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.getConnectorNoCheck(OutputConnectorFactory.java:149) at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.install(OutputConnectorFactory.java:50) at org.apache.manifoldcf.agents.outputconnmgr.OutputConnectorManager.registerConnector(OutputConnectorManager.java:180) at org.apache.manifoldcf.agents.RegisterOutput.doExecute(RegisterOutput.java:47) at org.apache.manifoldcf.agents.TransactionalAgentsInitializationCommand.execute(TransactionalAgentsInitializationCommand.java:43) at org.apache.manifoldcf.agents.RegisterOutput.main(RegisterOutput.java:70) D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents.output.nullconnector.NullConnector NullOutput Configuration file successfully read Successfully registered output connector 'org.apache.manifoldcf.agents.output.nullconnector.NullConnector' D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.crawler.Register org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector FileSystem Configuration file successfully read Successfully registered connector 'org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector' D:\Program Files\Apache\ManifoldCF\myMCF
Re: RegisterOutput Error
The code is: Throwable z = e.getTargetException(); if (z instanceof Error) throw (Error)z; else throw (ManifoldCFException)z; The problem cannot be that z is null, because z instanceof Error does not blow up. Indeed: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException is the message. The code is not resilient against RuntimeError exceptions is one problem. The problem with your connector code is therefore a NPE being thrown. I'll check in changes here and it should be possible for you to tell what is happening. Karl On Wed, Jun 8, 2011 at 2:55 PM, Farzad Valad ho...@farzad.net wrote: Looking at the OutputConnectorFactory code, it seems there are two problems. The exception handling has a bug assuming a null value won't be passed. Line 149 says throw (ManifoldCFException) z; where z is null. The main problem is why registering my connector is now producing an InvocationTargetException? and it wasn't a problem before? public DupFinderConnector() throws ManifoldCFException { Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); calendar = Calendar.getInstance(); hashGen = new HashsumGenerator(); } On 6/8/2011 12:00 PM, Farzad Valad wrote: Any idea why I would get this failure on registering my connector. Hadn't seen it before. I was trying to setup a new system and was issuing commands to setup the database. Note I was able to register Null Output and File System connectors without error. D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents. output.dupfinder.DupFinderConnector DupFinder Configuration file successfully read Exception in thread main java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.getConnectorNoCheck(OutputConnectorFactory.java:149) at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.install(OutputConnectorFactory.java:50) at org.apache.manifoldcf.agents.outputconnmgr.OutputConnectorManager.registerConnector(OutputConnectorManager.java:180) at org.apache.manifoldcf.agents.RegisterOutput.doExecute(RegisterOutput.java:47) at org.apache.manifoldcf.agents.TransactionalAgentsInitializationCommand.execute(TransactionalAgentsInitializationCommand.java:43) at org.apache.manifoldcf.agents.RegisterOutput.main(RegisterOutput.java:70) D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents.output.nullconnector.NullConnector NullOutput Configuration file successfully read Successfully registered output connector 'org.apache.manifoldcf.agents.output.nullconnector.NullConnector' D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.crawler.Register org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector FileSystem Configuration file successfully read Successfully registered connector 'org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector' D:\Program Files\Apache\ManifoldCF\myMCF
[jira] [Updated] (CONNECTORS-210) Connector instantiation code doesn't handle RuntimeException exceptions properly
[ https://issues.apache.org/jira/browse/CONNECTORS-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Karl Wright updated CONNECTORS-210: --- Component/s: Framework crawler agent Framework agents process Affects Version/s: ManifoldCF 0.3 ManifoldCF 0.1 ManifoldCF 0.2 Connector instantiation code doesn't handle RuntimeException exceptions properly Key: CONNECTORS-210 URL: https://issues.apache.org/jira/browse/CONNECTORS-210 Project: ManifoldCF Issue Type: Bug Components: Framework agents process, Framework crawler agent Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3 Reporter: Karl Wright Assignee: Karl Wright When a connector, on instantiation, throws a NPE, you get the following exception thrown by the registry code: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CONNECTORS-210) Connector instantiation code doesn't handle RuntimeException exceptions properly
[ https://issues.apache.org/jira/browse/CONNECTORS-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Karl Wright resolved CONNECTORS-210. Resolution: Fixed Fix Version/s: ManifoldCF 0.3 r1133518 Connector instantiation code doesn't handle RuntimeException exceptions properly Key: CONNECTORS-210 URL: https://issues.apache.org/jira/browse/CONNECTORS-210 Project: ManifoldCF Issue Type: Bug Components: Framework agents process, Framework crawler agent Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3 Reporter: Karl Wright Assignee: Karl Wright Fix For: ManifoldCF 0.3 When a connector, on instantiation, throws a NPE, you get the following exception thrown by the registry code: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: RegisterOutput Error
Ok, I have checked in a fix for the RuntimeException handling. If you try the new code, you should get a full trace for the NPE that is causing the problem. Karl On Wed, Jun 8, 2011 at 3:20 PM, Karl Wright daddy...@gmail.com wrote: The code is: Throwable z = e.getTargetException(); if (z instanceof Error) throw (Error)z; else throw (ManifoldCFException)z; The problem cannot be that z is null, because z instanceof Error does not blow up. Indeed: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException is the message. The code is not resilient against RuntimeError exceptions is one problem. The problem with your connector code is therefore a NPE being thrown. I'll check in changes here and it should be possible for you to tell what is happening. Karl On Wed, Jun 8, 2011 at 2:55 PM, Farzad Valad ho...@farzad.net wrote: Looking at the OutputConnectorFactory code, it seems there are two problems. The exception handling has a bug assuming a null value won't be passed. Line 149 says throw (ManifoldCFException) z; where z is null. The main problem is why registering my connector is now producing an InvocationTargetException? and it wasn't a problem before? public DupFinderConnector() throws ManifoldCFException { Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); calendar = Calendar.getInstance(); hashGen = new HashsumGenerator(); } On 6/8/2011 12:00 PM, Farzad Valad wrote: Any idea why I would get this failure on registering my connector. Hadn't seen it before. I was trying to setup a new system and was issuing commands to setup the database. Note I was able to register Null Output and File System connectors without error. D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents. output.dupfinder.DupFinderConnector DupFinder Configuration file successfully read Exception in thread main java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.getConnectorNoCheck(OutputConnectorFactory.java:149) at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.install(OutputConnectorFactory.java:50) at org.apache.manifoldcf.agents.outputconnmgr.OutputConnectorManager.registerConnector(OutputConnectorManager.java:180) at org.apache.manifoldcf.agents.RegisterOutput.doExecute(RegisterOutput.java:47) at org.apache.manifoldcf.agents.TransactionalAgentsInitializationCommand.execute(TransactionalAgentsInitializationCommand.java:43) at org.apache.manifoldcf.agents.RegisterOutput.main(RegisterOutput.java:70) D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents.output.nullconnector.NullConnector NullOutput Configuration file successfully read Successfully registered output connector 'org.apache.manifoldcf.agents.output.nullconnector.NullConnector' D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.crawler.Register org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector FileSystem Configuration file successfully read Successfully registered connector 'org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector' D:\Program Files\Apache\ManifoldCF\myMCF
Re: RegisterOutput Error
You were absolutely right as always. The line in my code was Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); inside the constructor that was causing this. I added this line after I had registered my code in the old system and hence never saw this error till setting up a new system. I guess I can't log inside the constructor? On 6/8/2011 2:34 PM, Karl Wright wrote: Ok, I have checked in a fix for the RuntimeException handling. If you try the new code, you should get a full trace for the NPE that is causing the problem. Karl On Wed, Jun 8, 2011 at 3:20 PM, Karl Wrightdaddy...@gmail.com wrote: The code is: Throwable z = e.getTargetException(); if (z instanceof Error) throw (Error)z; else throw (ManifoldCFException)z; The problem cannot be that z is null, because z instanceof Error does not blow up. Indeed: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException is the message. The code is not resilient against RuntimeError exceptions is one problem. The problem with your connector code is therefore a NPE being thrown. I'll check in changes here and it should be possible for you to tell what is happening. Karl On Wed, Jun 8, 2011 at 2:55 PM, Farzad Valadho...@farzad.net wrote: Looking at the OutputConnectorFactory code, it seems there are two problems. The exception handling has a bug assuming a null value won't be passed. Line 149 says throw (ManifoldCFException) z; where z is null. The main problem is why registering my connector is now producing an InvocationTargetException? and it wasn't a problem before? public DupFinderConnector() throws ManifoldCFException { Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); calendar = Calendar.getInstance(); hashGen = new HashsumGenerator(); } On 6/8/2011 12:00 PM, Farzad Valad wrote: Any idea why I would get this failure on registering my connector. Hadn't seen it before. I was trying to setup a new system and was issuing commands to setup the database. Note I was able to register Null Output and File System connectors without error. D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents. output.dupfinder.DupFinderConnector DupFinder Configuration file successfully read Exception in thread main java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.getConnectorNoCheck(OutputConnectorFactory.java:149) at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.install(OutputConnectorFactory.java:50) at org.apache.manifoldcf.agents.outputconnmgr.OutputConnectorManager.registerConnector(OutputConnectorManager.java:180) at org.apache.manifoldcf.agents.RegisterOutput.doExecute(RegisterOutput.java:47) at org.apache.manifoldcf.agents.TransactionalAgentsInitializationCommand.execute(TransactionalAgentsInitializationCommand.java:43) at org.apache.manifoldcf.agents.RegisterOutput.main(RegisterOutput.java:70) D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents.output.nullconnector.NullConnector NullOutput Configuration file successfully read Successfully registered output connector 'org.apache.manifoldcf.agents.output.nullconnector.NullConnector' D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.crawler.Register org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector FileSystem Configuration file successfully read Successfully registered connector 'org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector' D:\Program Files\Apache\ManifoldCF\myMCF
Re: RegisterOutput Error
Actually, for an output connector you cannot use the connectors logger, since that is a pull-agent logger. Instead you need to use the ingest logger, which is the agents equivalent. The book covers this in chapter 8. Karl On Wed, Jun 8, 2011 at 3:47 PM, Farzad Valad ho...@farzad.net wrote: You were absolutely right as always. The line in my code was Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); inside the constructor that was causing this. I added this line after I had registered my code in the old system and hence never saw this error till setting up a new system. I guess I can't log inside the constructor? On 6/8/2011 2:34 PM, Karl Wright wrote: Ok, I have checked in a fix for the RuntimeException handling. If you try the new code, you should get a full trace for the NPE that is causing the problem. Karl On Wed, Jun 8, 2011 at 3:20 PM, Karl Wrightdaddy...@gmail.com wrote: The code is: Throwable z = e.getTargetException(); if (z instanceof Error) throw (Error)z; else throw (ManifoldCFException)z; The problem cannot be that z is null, because z instanceof Error does not blow up. Indeed: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException is the message. The code is not resilient against RuntimeError exceptions is one problem. The problem with your connector code is therefore a NPE being thrown. I'll check in changes here and it should be possible for you to tell what is happening. Karl On Wed, Jun 8, 2011 at 2:55 PM, Farzad Valadho...@farzad.net wrote: Looking at the OutputConnectorFactory code, it seems there are two problems. The exception handling has a bug assuming a null value won't be passed. Line 149 says throw (ManifoldCFException) z; where z is null. The main problem is why registering my connector is now producing an InvocationTargetException? and it wasn't a problem before? public DupFinderConnector() throws ManifoldCFException { Logging.connectors.log(Level.ALL, DupFinder Version 1.0.0); calendar = Calendar.getInstance(); hashGen = new HashsumGenerator(); } On 6/8/2011 12:00 PM, Farzad Valad wrote: Any idea why I would get this failure on registering my connector. Hadn't seen it before. I was trying to setup a new system and was issuing commands to setup the database. Note I was able to register Null Output and File System connectors without error. D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents. output.dupfinder.DupFinderConnector DupFinder Configuration file successfully read Exception in thread main java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to org.apache.manifoldcf.core.interfaces.ManifoldCFException at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.getConnectorNoCheck(OutputConnectorFactory.java:149) at org.apache.manifoldcf.agents.interfaces.OutputConnectorFactory.install(OutputConnectorFactory.java:50) at org.apache.manifoldcf.agents.outputconnmgr.OutputConnectorManager.registerConnector(OutputConnectorManager.java:180) at org.apache.manifoldcf.agents.RegisterOutput.doExecute(RegisterOutput.java:47) at org.apache.manifoldcf.agents.TransactionalAgentsInitializationCommand.execute(TransactionalAgentsInitializationCommand.java:43) at org.apache.manifoldcf.agents.RegisterOutput.main(RegisterOutput.java:70) D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.agents.RegisterOutput org.apache.manifoldcf.agents.output.nullconnector.NullConnector NullOutput Configuration file successfully read Successfully registered output connector 'org.apache.manifoldcf.agents.output.nullconnector.NullConnector' D:\Program Files\Apache\ManifoldCF\myMCFprocesses\script\executecommand.bat org.apache.manifoldcf.crawler.Register org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector FileSystem Configuration file successfully read Successfully registered connector 'org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector' D:\Program Files\Apache\ManifoldCF\myMCF