Unhelpful output when build fails because no platform rules matched
Hello everyone, I hope you are well, I have a problem installing my pl/java, all the prerequisites are installed but I don't understand why there is this error (when I runs mvn clean install) and I tried everything possible to resolve it without success.
here is a picture of the error it gives me, thank you in advance for your help on this
Hmm, I have not seen that one before.
I see that you are building 1.5-SNAPSHOT. Does the same thing happen when you build from a released version?
Also, the 1.5 series has not been the development focus for a while now. Its native portion was built with the nar-maven-plugin, which was a frequent source of issues and difficult workarounds.
Do you have a requirement that prevents you using the PL/Java 1.6 series?
no I don't have any particular requirements on the version, but everything I've tried always gives an error on the backend native code.
but I'm still going to try 1.6 see
voici la nouvelle erreur avec 1.6-SNAPSHOT
Ah, there's a slightly more traceable error message, anyway. A JavaScript error, null is not an Object, no doubt from the JS code in pljava-so/pom.xml that handles compiling and linking. Says line number 315, and that JS code begins at line 31 of the POM, so it's right after the code that tries to select the right compiling/linking rules for the platform:
https://github.com/tada/pljava/blob/REL1_6_STABLE/pljava-so/pom.xml#L336
It seems that none of the platform probe tests succeeded (which explains why there was no Using compiling/linking rules for ... message shown).
I am not sure whether you are trying to build with Windows MinGW or with Windows MSVC. I see there are msys64 components in some of your paths, which would make me think MinGW, but I noticed in your earlier screenshot, nar-maven-plugin said Using AOL: amd64-Windows-msvc.
At any rate, it seems that neither probe succeeded, so you might start by looking at the two probe tests to see how they identify each platform:
https://github.com/tada/pljava/blob/REL1_6_STABLE/pljava-so/pom.xml#L206
https://github.com/tada/pljava/blob/REL1_6_STABLE/pljava-so/pom.xml#L264
My first guess would be that you might not have set one of the expected environment variables. I hope that those are documented in the corresponding build pages, but something might need to be clarified.
https://tada.github.io/pljava/build/mingw64.html
https://tada.github.io/pljava/build/buildmsvc.html
As a side note, if you are planning to contribute to development of PL/Java, it can be useful to build from the development snapshots, but if you simply intend to use it, building from a version that has been released is preferable. The latest release in the 1.6 series has tag V1_6_7.
I will try your suggestions and see. THANKS
when I try the V1_6_7 tag, I have the same problem, maybe it's my version of postgres (version 14) or I didn't install maven correctly?
Thank you in advance for your answer?
hello @jcflack , I finally got around to it thanks to your help, and I thank you for it.
finally I used Windows MSVC and the V1_6_7 tag after noticing that my postgre was built with MSVC:
And here is the result:
Thank you again for your help
I am glad that it worked.
I will treat this issue as a bug report that the build process gives a null-pointer exception instead of an explanatory message when no supported platform rules have matched.
All right
Believed resolved in 1.6.8.
Hi @jcflack , my postgre is not built with MSVC, i am using mingw32, Apache Maven 3.9.9, postgres 16, java 21 & pljava v 1.6.8, But still facing the same issue.
Can you please help me to resolve this as i am unable to create a build of pljava
e
Hi , Can you help me with this I am facing the same issue. How you have resolved this issue?
@Adarsh-k0802, maybe open a new issue? This issue is closed, and yours is not the same.
This issue involved the build system not detecting what build rules to use.
Your screenshot shows a simple conflict. You have Maven's environment set up so that a MinGW build is selected. However, the pg_config found on the PATH (or specified on the mvn command line, if you did that) definitely refers to a PostgreSQL that was built with MSVC. (The quoted version string shown comes straight from the version of PostgreSQL that is installed, so what it says is true.)
If there is also a PostgreSQL built with MinGW installed on your system, all you need to do is adjust your PATH (or use a -Dpgsql.pgconfig= option on the mvn command line) to make sure that the MinGW-built PostgreSQL is the one that will be found for the build.
Hi @jcflack , I have resolved that issue. Now I am facing a new issue at the time of installation when I run "CREATE EXTENSION pljava;" it's showing access is denied.
Hi @Adarsh-k0802,
Again, if you don't find a solution, that would warrant opening a new issue. It would not be related to this one at all.
If you do open a new issue, please be sure to include the full error output.
It is often more helpful to copy/paste the text than to post screenshots. For example, others can more easily find a relevant issue using a search.