Auditing a project with a remote CommandLine

Overview

When auditing a project using a remote CommandLine that doesn't have access to the H2 audit database, a NullPointerException will be returned.

 

Symptoms/Description

Below is the exception returned while fetching an audit report for a project where a remote CommandLine is used and where the audit database location is not on a shared location:

 

java.lang.RuntimeException: java.lang.NullPointerException
   at org.talend.commandline.command.ExtensionCommandSwitch.caseExtensionServerCommand(ExtensionCommandSwitch.java:148)
   at org.talend.commandline.client.command.extension.AbstractExtensionCommandSwitch.doSwitch(AbstractExtensionCommandSwitch.java:31)
   at org.talend.commandline.command.CommandProcessorSwitch.caseExtensionCommand(CommandProcessorSwitch.java:161)
   at org.talend.commandline.client.util.CommandAbstractSwitch.doSwitch(CommandAbstractSwitch.java:70)
   at org.talend.commandline.command.CommandConsumer.executeCommand(CommandConsumer.java:57)
   at org.talend.commandline.command.CommandConsumer.execute(CommandConsumer.java:35)
   at org.talend.commandline.mode.ServerCommandLine$CommmandConsumerRunnable.run(ServerCommandLine.java:139)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
   at org.talend.commandline.audit.datasource.HibernateUtils.checkAuditDB(HibernateUtils.java:141)
   at org.talend.commandline.audit.datasource.HibernateUtils.init(HibernateUtils.java:106)
   at org.talend.commandline.audit.TalendAuditSelectMode2.createHibernateSessionFactory(TalendAuditSelectMode2.java:305)
   at org.talend.commandline.audit.command.PopulateAuditExecuteCommand.execute(PopulateAuditExecuteCommand.java:130)
   at org.talend.commandline.command.ExtensionCommandSwitch.caseExtensionServerCommand(ExtensionCommandSwitch.java:146)
   ... 7 more

Resolution

With a remote CommandLine, ensure that the H2 audit database location is shared so that both tomcat and commandline can access it.

This error can also be reported if a CommandLine local to TAC is used without enough permissions on the audit database directory.

Ensure that the CommandLine user has sufficient permissions on H2 audit database directory and is able to read and write files.

The exact cause of the error can be found in the .log file of the CommandLine directory available at CMD_LINE/commandline-workspace/.metadata

 

Documentation suggests using the same user to start the CommandLine and Tomcat: to ensure correct management, make sure to launch Tomcat using the same administrator account as for the CommandLine.

 

For example: Create an account TISAdmin for both Tomcat and CommandLine.

Version history
Revision #:
8 of 8
Last update:
‎05-05-2017 06:43 PM
Updated by:
 
Tags (1)