On windows 10, ADS 18.0.12, I try to do New Project and pick one of the pre-made templates. When I click Create, I get the error "Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4LogChute with the current runtime configuration".
In contrast, on Mac, I can do a simple project create and the base template project "Database Schema and Data Exporter" runs successfully against a registered server.
|
36 KB
|
83 KB
When I checked the ADS log from the Help menu, it shows this line in the log:
Caused by: java.io.FileNotFoundException: velocity.log (Access is denied)
I exited the application and from Windows 10 restarted ADS with "Run as Administrator" option. This allowed the New Project to work and did create a script in the directory as well. The script also ran successfully.
So this support issue really becomes how to allow project creation/running with sufficient permissions on Windows 10, hopefully without requiring to run the application as administrator.
Also, this was running OK on my Macbook Pro. Interestingly, the user I log into with does not have administrator privileges. Whenever I need to do something needing elevated privilege on my Mac, I am prompted for an administrator user and password. So I'm not sure how ADS installed differently with enough rights to create projects on the Mac, but not so with Windows 10.
Also, this was running OK on my Macbook Pro. Interestingly, the user I log into with does not have administrator privileges. Whenever I need to do something needing elevated privilege on my Mac, I am prompted for an administrator user and password. So I'm not sure how ADS installed differently with enough rights to create projects on the Mac, but not so with Windows 10.
ADS was trying to create velocity.log at the working directory (where datastudio.exe resides). If the user does not have write access to the working directory, the exception would occur.
We should move the log file to <user_home>\.datastudio\logs. This can be achieved by adding the following property to the velocity engine:
... // Init Velocity. Tell it what resource loader to use VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RUNTIME_LOG, OptionSettings.CONFIG_DIRECTORY+File.separator+"logs"+File.separator+"velocity.log"); ... ve.init(); ...
There are 12 classes (6 in ADS, 6 in standalone) that contain copies of velocity engine initialization code. I'd recommend also refactoring these classes and move these common code to base class TemplateOptionProperties. Also, the standalone classes might need a different RuntimeConstants.RUNTIME_LOG value.
[SP] @tom: we don't have to fix the standalone classes. Just the ones in ADS
ADS was trying to create velocity.log at the working directory (where datastudio.exe resides). If the user does not have write access to the working directory, the exception would occur.
We should move the log file to <user_home>\.datastudio\logs. This can be achieved by adding the following property to the velocity engine:
... // Init Velocity. Tell it what resource loader to use VelocityEngine ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RUNTIME_LOG, OptionSettings.CONFIG_DIRECTORY+File.separator+"logs"+File.separator+"velocity.log"); ... ve.init(); ...
There are 12 classes (6 in ADS, 6 in standalone) that contain copies of velocity engine initialization code. I'd recommend also refactoring these classes and move these common code to base class TemplateOptionProperties. Also, the standalone classes might need a different RuntimeConstants.RUNTIME_LOG value.
[SP] @tom: we don't have to fix the standalone classes. Just the ones in ADS
V18 svn #54791 and V19 svn #54792 - Refactored code to TemplateOptionProperties and added the log property specified by Kin-hong.
I tested by creating new projects and verifying that fields are populated correctly. Also, I confirmed that the Velocity log is now stored under .datastudio.
Hi QA Team,
Please test the various projects across all three operating systems. Confirm the location of the Velocity log and that the template fields are populated correctly.
Thanks, Tom
V18 svn #54791 and V19 svn #54792 - Refactored code to TemplateOptionProperties and added the log property specified by Kin-hong.
I tested by creating new projects and verifying that fields are populated correctly. Also, I confirmed that the Velocity log is now stored under .datastudio.
Hi QA Team,
Please test the various projects across all three operating systems. Confirm the location of the Velocity log and that the template fields are populated correctly.
Thanks, Tom
Verified in ADS v18.0.15-3 in Win and Mac OSX. See location of velocity.log in screenshot. Template fields are populated correctly as well
Verified in ADS v18.0.15-3 in Win and Mac OSX. See location of velocity.log in screenshot. Template fields are populated correctly as well
Hi Bob,
The below patch fixes this issue:
Hi Bob,
The below patch fixes this issue:
Issue #15328 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 18.0.15-3 & ADS 19.0.0-alpha-48 |
No time estimate |
When I checked the ADS log from the Help menu, it shows this line in the log:
Caused by: java.io.FileNotFoundException: velocity.log (Access is denied)
I exited the application and from Windows 10 restarted ADS with "Run as Administrator" option. This allowed the New Project to work and did create a script in the directory as well. The script also ran successfully.
So this support issue really becomes how to allow project creation/running with sufficient permissions on Windows 10, hopefully without requiring to run the application as administrator.