Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix https://github.com/ArcadeData/arcadedb/issues/97 #1333

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

LLuke
Copy link
Contributor

@LLuke LLuke commented Nov 19, 2023

What does this PR do?

Both console.bat and serer.bat don't take command line argument well due to two similar defects.

Motivation

Share the fixes so that the windows users can use arcadedb out of the box in the arcadedb future releases.

Related issues

The @echo off also partially addressed the noisy issue with #1331

Additional Notes

Test:

create a test database at a new location with console and import something

.\arcadedb-23.10.1\bin\console.bat -Darcadedb.server.databaseDirectory=Z:\arcadedb\databases
> create database arcadedb_test

Database 'arcadedb_test' created
{arcadedb_test}> import database https://github.com/ArcadeData/arcadedb-datasets/raw/main/orientdb/OpenBeer.gz
{arcadedb_test}> quit

start the server with the newly created databse

\arcadedb-23.10.1\bin\server.bat -Darcadedb.server.plugins=Postgres:com.arcadedb.postgres.PostgresProtocolPlugin -Darcadedb.postgres.port=3333 -Darcadedb.server.databaseDirectory=Z:\arcadedb\databases
...

2023-11-18 18:29:33.567 INFO  [PostgresNetworkListener] <ArcadeDB_0> Listening for incoming connections on 0.0.0.0:3333 (protocol v.-1)
2023-11-18 18:29:33.567 INFO  [ArcadeDBServer] <ArcadeDB_0> - Postgres plugin started
...

Test and found the database in the web console (-Darcadedb.server.databaseDirectory=... now works) and it is accessible using pg8000 with code example in #399

Checklist

  • [X ] I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@lvca lvca requested a review from gramian November 19, 2023 13:27
@lvca lvca added the bug Something isn't working label Nov 19, 2023
@lvca lvca added this to the 23.11.1 milestone Nov 19, 2023
@LLuke
Copy link
Contributor Author

LLuke commented Nov 19, 2023

This is probably a CI issue on arcadedb side. I ran tests before checking in.

@lvca lvca self-requested a review November 20, 2023 00:50
@lvca lvca merged commit 4b98478 into ArcadeData:main Nov 20, 2023
6 of 8 checks passed
@lvca
Copy link
Contributor

lvca commented Nov 20, 2023

That's great! Thanks for your first contribution @LLuke !

@gramian
Copy link
Collaborator

gramian commented Nov 20, 2023

@lvca @LLuke

I tested the current head with these changes (and the jansi dependency). Both, server and console start. The server seems to work fine and the Windows firewall request permissions. However starting the console, I get the following error:

Exception in thread "WindowsStreamPump" java.lang.NoSuchMethodError: 'int org.fusesource.jansi.internal.Kernel32.WaitForSingleObject(long, int)'
        at org.jline.terminal.impl.jansi.win.JansiWinSysTerminal.processConsoleInput(JansiWinSysTerminal.java:210)
        at org.jline.terminal.impl.AbstractWindowsTerminal.pump(AbstractWindowsTerminal.java:464)
        at java.base/java.lang.Thread.run(Thread.java:840)

Furthermore, and importantly, the console does not accept keyboard input, meaning no pressed key results in an input.

I tested on Windows 10 (64bit) with MS OpenJDK17 (17.0.9).

@lvca
Copy link
Contributor

lvca commented Nov 20, 2023

@gnodet any idea why that can happen? Maybe we have some other version of jline linked from Gremlin? Checking...

@lvca
Copy link
Contributor

lvca commented Nov 20, 2023

jline is added only one time and it's the latest:

|  +- org.jline:jline-terminal:jar:3.24.1:compile
[INFO] |  |  \- org.jline:jline-native:jar:3.24.1:compile
[INFO] |  +- org.jline:jline-reader:jar:3.24.1:compile
[INFO] |  \- org.jline:jline-terminal-jansi:jar:3.24.1:compile
[INFO] |     \- org.fusesource.jansi:jansi:jar:2.4.1:compile

So it must be something with the last version of jansi using a native method:

    public static native int WaitForSingleObject(long hHandle, int dwMilliseconds);

@gnodet
Copy link

gnodet commented Nov 20, 2023

Ok, I'll try to reproduce and investigate.

@lvca
Copy link
Contributor

lvca commented Nov 20, 2023

For now I reverted the inclusion of jansi lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants