tada / pljava

PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, Functions, Aggregates, Operators, Types, etc., to the PostgreSQL™ backend.
http://tada.github.io/pljava/
Other
238 stars 77 forks source link

undefined symbol: GetMemoryChunkContext #487

Closed BruceBaiz closed 1 week ago

BruceBaiz commented 1 month ago

When I do CREATE EXTENSION pljava; This statement will prompt libpljava-so-1.6.7.so: undefined symbol: GetMemoryChunkContext. I have no problem building jar packages with maven.

I'm very new to pljava. Any help would be really appreciated.

java version - 17 postgres version -14 apache maven - 3.9.6

jcflack commented 1 month ago

That is puzzling. PostgreSQL 14 definitely defines GetMemoryChunkContext, as a static inline function, here:

https://github.com/postgres/postgres/blob/REL_14_12/src/include/utils/memutils.h#L101

Is it possible you have a different PostgreSQL version (or more than one PostgreSQL version) installed on the box where you built PL/Java, and the build found the .h files for a mismatched version?

Or is it possible you are running some variant of PostgreSQL that differs from the community version?

Could you attach the output of running the pg_config command in the same environment where you ran mvn to build PL/Java?

Also, relative to the directory shown as INCLUDEDIR_SERVER in the pg_config output, in the file utils/memutils.h, what definition of GetMemoryChunkContext is found (if any)?

It would also be helpful to know your OS.

BruceBaiz commented 1 week ago

Thank you very much, I have solved this problem by another way. The above problem occurred when I chose to download the plava 1.6.7 source code in ubuntu and then re-create the extension after building it with maven But this time I have downloaded pljava directly by using ubuntu's apt package management tool without such problems, so I created the extension successfully.