scristalli / sql-developer-keepalive

MIT License
149 stars 21 forks source link

Keep Alive extension not working with SQL Developer 19.2.1.247 #33

Closed marcospont closed 4 years ago

marcospont commented 4 years ago

Hi,

I have tried to install keep alive extension on Oracle SQL Developer for Mac, but had no success.

Steps executed: 1) Downloaded from https://github.com/scristalli/sql-developer-keepalive/releases/download/1.3.1/keepalive.zip 2) Help > Check for Updates 3) Install from Local Files, choose keepalive.zip from the Downloads Folder, click Next 4) Keep alive is displayed in a tree view under New Installs > Others, click Finish 5) SQL Developer asks to be restarted 6) Once restarted, the extension cannot be used from the connections contextual menu

Steps tried to fix: 1) Looked into the .../extensions folder, keepalive.jar didn't have the same permissions of the other jars 2) Changed keepalive.jar permissions to 775 to match the other jar files in the folder 3) Moved ownership of keepalive.jar to root to match the other jar files in the folder 3) Restarted SQL Developer, still can't see the extension working

OS: Catalina 10.15.5 SQL Developer: 19.2.1.247

scristalli commented 4 years ago

@marcospont at the moment it is not possible to use the extension from the contextual menu, for instance to activate it on a per connection basis; it can only be activated from the dedicated menu icon in the top bar (cfr. README). Could you please confirm if that works, or if you don't see an icon at all?

marcospont commented 4 years ago

Sorry about the confusion. I have mentioned the contextual menu because I read about it in some tutorial about the extension. About the dedicated icon, I don't see it in the top bar at all.

Em qui, 16 de jul de 2020 06:38, Stefano Cristalli notifications@github.com escreveu:

@marcospont https://github.com/marcospont at the moment it is not possible to use the extension from the contextual menu, for instance to activate it on a per connection basis; it can only be activated from the dedicated menu icon in the top bar (cfr. README). Could you please confirm if that works, or if you don't see an icon at all?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scristalli/sql-developer-keepalive/issues/33#issuecomment-659298018, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCGR7PNPQ4W2TECQ6HIPUTR33DA7ANCNFSM4O2ZMAKQ .

scristalli commented 4 years ago

I'm currently unable to reproduce your setup, other users have previously had similar problems on Windows and they were related to permissions. If fixing the permissions on the JAR was not sufficient, I suspect that the user running SQL Developer needs to have some permissions when the extension is installed. In the wiki I wrote many years ago Make sure that you have writing permissions on the installation folder of SQL Developer. To aquire them, launch this command (edit the path if necessary): sudo chmod -R o+w /opt/sqldeveloper Not sure if that's going to work, or if it's overkill, but you could try. You could also try to run SQL Developer as root, but I don't know if doing so will make future runs as an unprivileged user not possible due to change in ownership of some files (I know that it happens with some other Oracle software). If none of this works, you could try with a standalone version of SQL Developer (i.e. the run that's just run with Java and not installed).

marcospont commented 4 years ago

Is there a way to check what is happening in SQLDeveloper behind the scene when the extension gets installed or when it is launched after the installation and tries to activate it? Are there any logs or a verbose mode?

Em qui, 16 de jul de 2020 09:38, Stefano Cristalli notifications@github.com escreveu:

I'm currently unable to reproduce your setup, other users have previously had similar problems on Windows and they were related to permissions. If fixing the permissions on the JAR was not sufficient, I suspect that the user running SQL Developer needs to have some permissions when the extension is installed. In the wiki I wrote many years ago Make sure that you have writing permissions on the installation folder of SQL Developer. To aquire them, launch this command (edit the path if necessary): sudo chmod -R o+w /opt/sqldeveloper Not sure if that's going to work, or if it's overkill, but you could try. You could also try to run SQL Developer as root, but I don't know if doing so will make future runs as an unprivileged user not possible due to change in ownership of some files (I know that it happens with some other Oracle software). If none of this works, you could try with a standalone version of SQL Developer (i.e. the run that's just run with Java and not installed).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scristalli/sql-developer-keepalive/issues/33#issuecomment-659383553, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCGR7M66ZF7SE436D5PA7LR33YEDANCNFSM4O2ZMAKQ .

scristalli commented 4 years ago

@marcospont I'm not sure. Maybe it will write something to stdout if you launch it from the console, or if it writes a log I would look for it in its home directory (or with strace/lsof, should it be necessary). I'm not aware of any verbose mode, but maybe there is one.

marcospont commented 4 years ago

@scristalli found the issue: I had renamed the keepalive.jar in the extensions folder and SQLDeveloper was not finding it during the initialization.

Two links that I found that might be very helpful for anyone troubleshooting this:

SQLDeveloper Debug Mode: https://www.thatjeffsmith.com/archive/2012/10/using-debug-mode-in-oracle-sql-developer-to-log-sql/

How to redirect SQLDeveloper log to a file: https://www.igorkromin.net/index.php/2016/01/23/how-to-redirect-sqldeveloper-debug-log-to-a-file/

I have enabled debug mode, which allows me to see log messages in a panel on the SQLDeveloper IDE. Unfortunately, no messages about extensions/plugins activation were there.

After I changed the log handler to write to a file, then I was able to see a warning about not finding keepalive.jar in the expected folder.

Thanks for your help, closing this one :)

scristalli commented 4 years ago

@marcospont thank you for your contribution in debugging the extension. If you want, you can update the wiki your debugging suggestions.