yandex-qatools / postgresql-embedded

Embedded PostgreSQL Server
Other
493 stars 90 forks source link

java.lang.NoSuchFieldException: handle thrown possible because of JDK11 #153

Open LukeButters opened 5 years ago

LukeButters commented 5 years ago

Hi when following the tutorial I get this exception:

java.lang.NoSuchFieldException: handle
    at java.base/java.lang.Class.getDeclaredField(Class.java:2412)
    at de.flapdoodle.embed.process.runtime.Processes.windowsProcessId(Processes.java:109)
    at de.flapdoodle.embed.process.runtime.Processes.access$200(Processes.java:51)
    at de.flapdoodle.embed.process.runtime.Processes$PidHelper$2.getPid(Processes.java:209)
    at de.flapdoodle.embed.process.runtime.Processes.processId(Processes.java:72)
    at de.flapdoodle.embed.process.runtime.ProcessControl.<init>(ProcessControl.java:64)
    at de.flapdoodle.embed.process.runtime.ProcessControl.start(ProcessControl.java:205)
    at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:99)
    at ru.yandex.qatools.embed.postgresql.AbstractPGProcess.<init>(AbstractPGProcess.java:19)
    at ru.yandex.qatools.embed.postgresql.InitDbProcess.<init>(InitDbProcess.java:56)
    at ru.yandex.qatools.embed.postgresql.InitDbExecutable.start(InitDbExecutable.java:23)
    at ru.yandex.qatools.embed.postgresql.InitDbExecutable.start(InitDbExecutable.java:14)
    at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:108)
    at ru.yandex.qatools.embed.postgresql.PostgresProcess.runCmd(PostgresProcess.java:119)
    at ru.yandex.qatools.embed.postgresql.PostgresProcess.runCmd(PostgresProcess.java:74)
    at ru.yandex.qatools.embed.postgresql.PostgresProcess.onBeforeProcess(PostgresProcess.java:196)
    at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:83)
    at ru.yandex.qatools.embed.postgresql.AbstractPGProcess.<init>(AbstractPGProcess.java:19)
    at ru.yandex.qatools.embed.postgresql.PostgresProcess.<init>(PostgresProcess.java:68)
    at ru.yandex.qatools.embed.postgresql.PostgresExecutable.start(PostgresExecutable.java:25)
    at ru.yandex.qatools.embed.postgresql.PostgresExecutable.start(PostgresExecutable.java:13)
    at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:108)
    at ru.yandex.qatools.embed.postgresql.EmbeddedPostgres.start(EmbeddedPostgres.java:194)
    at ru.yandex.qatools.embed.postgresql.EmbeddedPostgres.start(EmbeddedPostgres.java:165)
    at ru.yandex.qatools.embed.postgresql.EmbeddedPostgres.start(EmbeddedPostgres.java:139)
littlewoo commented 5 years ago

I see the same issue... It seems that the exception isn't thrown - it's caught and then printed to std.err.

LukeButters commented 5 years ago

I think this might only matter on windows and so it might make sense to look for the field when the OS is windows.

TurtleTony commented 5 years ago

This also happens on Linux, it doesn't seem to break anything but it's really ugly. This should be fixed

mdavydau commented 5 years ago

Quick fix for current issue

        <dependency>
            <groupId>ru.yandex.qatools.embed</groupId>
            <artifactId>postgresql-embedded</artifactId>
            <version>2.10</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>de.flapdoodle.embed</groupId>
                    <artifactId>de.flapdoodle.embed.process</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>de.flapdoodle.embed</groupId>
            <artifactId>de.flapdoodle.embed.process</artifactId>
            <version>2.0.5</version>
        </dependency>
SButterfly commented 4 years ago

fix https://github.com/yandex-qatools/postgresql-embedded/commit/7ed616e251dda4ca1f6b45217a9005f5128d7fd1

tovbinm commented 4 years ago

@SButterfly are you folks planning to release this?

SButterfly commented 4 years ago

@smecsia Could you please release new version?