Mendix runtime library problems (org.postgresql.postgresql.42.1.4.jar file)

3
Hey guys, It's quite possible that someone will run into the same problem I had, and that is an error in console, goes into the deployment/logs/m2ee_log.txt: nov 14, 2017 11:58:16 AM org.postgresql.ds.common.BaseDataSource getConnection SEVERE: Failed to create a Non-Pooling DataSource from PostgreSQL JDBC Driver 42.1.4 for postgres at jdbc:postgresql://localhost:5434/Casix-Sprint65?prepareThreshold=2: org.postgresql.util.PSQLException: Your security policy has prevented the connection from being attempted. You probably need to grant the connect java.net.SocketPermission to the database server host and port that you wish to connect to. This error looks a bit different on the Mendix console, once you run the project: Log Level: Error Log Node : ConnectionBus Message : Opening JDBC connection to Some(localhost:5434) failed with SQLState: 99999 Error code: 0 Message: Your security policy has prevented the connection from being attempted. You probably need to grant the connect java.net.SocketPermission to the database server host and port that you wish to connect to., giving up...(4/4) Now, this problem is being caused on the Mendix runtime library, namely this file: $installation_directory$\7.8.0\runtime\bundles\org.postgresql.postgresql.42.1.4.jar We have a setup where we use Postgres DB, obviously, and console log goes ham on errors when we start a project and use it. Basically, almost every DB transaction throws this error. Now, a quick and dirty solution is to (inside program files\mendix\...) delete this JAR file and replace it with org.postgresql.postgresql.42.0.0.jar (you can download it from Postgres website, OR, if you use any MX 7.x version before 7.1.1, you can get it from there). Another thing worth mentioning is that this error appears starting Mx.7.7.1, and of course continues with 7.8.0. Could be that this is our project specific, but if someone else has this problem, this is a quick and dirty hotfix that you can use. I haven't found so far any impact on our app when using the old JAR (for local development, of course, this is a Mendix runtime library), but if I encounter something, I'll let you guys know. Cheers!
asked
1 answers
2

Got the following response from Mendix Support:

Hi Dennis,

This behavior has been fixed in 7.10.
This does not occur in the cloud. We have not received reports of any of that in the cloud. 
The workaround posted on the forum is usable for your situation. 

answered