How to fix "SPI_ERROR_UNCONNECTED" error while installing PL/Java on Postgresql-9.5 - postgresql-9.5

I'm trying to install PL/Java on PostgreSQL-9.5. My current server is Ubuntu 16.04. My reference link to install PL/Java is the official website: https://tada.github.io/pljava/install/install.html
The build process for PL/Java, as described in the link https://tada.github.io/pljava/build/build.html is working fine.
When I run mvn clean install the output is: maven output
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PostgreSQL PL/Java ................................. SUCCESS [ 1.049 s]
[INFO] PL/Java API ........................................ SUCCESS [ 2.499 s]
[INFO] PL/Java backend Java code .......................... SUCCESS [ 1.574 s]
[INFO] PL/Java backend native code ........................ SUCCESS [ 17.971 s]
[INFO] PL/Java Ant tasks .................................. SUCCESS [ 0.179 s]
[INFO] PL/Java examples ................................... SUCCESS [ 0.747 s]
[INFO] PL/Java packaging .................................. SUCCESS [ 0.736 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.420 s
[INFO] Finished at: 2019-06-21T01:31:58-07:00
[INFO] Final Memory: 47M/576M
[INFO] ------------------------------------------------------------------------
When I run the self-extracting installer JAR, the output is: JAR Installer output
/usr/lib/postgresql/9.5/lib/libpljava-so-1.6.0-SNAPSHOT.so as bytes
/usr/share/postgresql/9.5/pljava/pljava-1.6.0-SNAPSHOT.jar as bytes
/usr/share/postgresql/9.5/pljava/pljava-api-1.6.0-SNAPSHOT.jar as bytes
/usr/share/postgresql/9.5/pljava/pljava-examples-1.6.0-SNAPSHOT.jar as bytes
/usr/share/postgresql/9.5/extension/pljava.control as lines (ASCII)
/usr/share/postgresql/9.5/pljava/pljava--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--unpackaged--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.2--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.1--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.1-BETA3--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.1-BETA2--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.1-BETA1--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.0--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.0-BETA3--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.0-BETA2--1.6.0-SNAPSHOT.sql as lines (UTF8)
/usr/share/postgresql/9.5/pljava/pljava--1.5.0-BETA1--1.6.0-SNAPSHOT.sql as lines (UTF8)
I have explictly set libjvm_location as well: libjvm_location set
postgres=# alter system set pljava.libjvm_location to '/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so';
ALTER SYSTEM
postgres=#
When I run CREATE EXTENSION pljava, i get the following error:
postgres=# CREATE EXTENSION pljava;
ERROR: java.sql.SQLException: SPI function SPI_prepare failed with error SPI_ERROR_UNCONNECTED

Another old question, answering just so future visitors will find something.
In this question, the version of PL/Java being built was an unreleased version (1.6.0-SNAPSHOT) and simply didn't include the changes at that time to support PostgreSQL 9.5.
Snapshot versions, and anything built from the master (development) branch, are moving targets, might be far from release, not work, set your house on fire, etc. Recommended practice is to check the releases page and select a recent official release.
If it will be used on Ubuntu or Debian, rather than building from source, it's usually simpler to add the PGDG apt repository and simply apt-get install postgresql-9.5-pljava (or your PostgreSQL version in place of 9.5).

Related

When I run my test through jenkins chrome browser is not triggered and also showing testng.xml file is not matching

Chrome browser is not launching when I click the build now link in jenkins, but showing build is success.
Solution provided in Jenkins : Selenium GUI tests are not visible on Windows are not working for me. Someone please help me in this.
Started by user Karthick Ragu
Running as SYSTEM
Building in workspace C:\Program Files\Jenkins\workspace\killerFramework
Parsing POMs
Established TCP socket on 51445
[karthick.framework] $ "C:\Program Files\Java\jdk1.8.0_181/bin/java" -cp "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven/conf/logging" jenkins.maven3.agent.Maven35Main "C:\Program Files\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\TestMaven" "C:\Program Files\Jenkins\war\WEB-INF\lib\remoting-3.35.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar" "C:\Program Files\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar" 51445
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\LEARNING\sel\karthick.framework\pom.xml clean test
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< web.automation.killer:karthick.framework >--------------
[INFO] Building karthick.framework 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # karthick.framework ---
[INFO] Deleting D:\LEARNING\sel\karthick.framework\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # karthick.framework ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # karthick.framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # karthick.framework ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # karthick.framework ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to D:\LEARNING\sel\karthick.framework\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M3:test (default-test) # karthick.framework ---
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.339 s
[INFO] Finished at: 2019-10-06T23:35:41+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving D:\LEARNING\sel\karthick.framework\pom.xml to web.automation.killer/karthick.framework/0.0.1-SNAPSHOT/karthick.framework-0.0.1-SNAPSHOT.pom
channel stopped
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
Did not find any matching files.
Finished: SUCCESS
The error is loud and clear
Looking for TestNG results report in workspace using pattern:
**/testng-results.xml Did not find any matching files.
That mean Jenkins not able to found xml file as per the path you have provided in jenkins.
Check if the path or filename is fine.
Put the full absolute path first to check and then try to create ** relative path

How to run javaee7 sdk samples?

My teacher want me to run javaee7 sdk sample "annotation-war". Then I download the javaee7 sdk from http://www.oracle.com/technetwork/java/javaee/downloads/index.html. But, I don't know how to run it.
I have tried the following steps:
First, I import code into Intelij IDEA, and run mvn cargo:run, but some error happen
"C:\Program Files\Java\jdk1.8.0_101\bin\java" -Dmaven.multiModuleProjectDirectory=C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war -Dmaven.home=C:\zjf\soft\apache-maven-3.3.9 -Dclassworlds.conf=C:\zjf\soft\apache-maven-3.3.9\bin\m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\zjf\soft\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.3 -s C:\zjf\soft\apache-maven-3.3.9\conf\settings.xml -Dmaven.repo.local=C:\zjf\soft\apache-maven-3.3.9\repo org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.422 s
[INFO] Finished at: 2016-12-06T19:12:34+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
Then I think may be I have done the wrong thing, so I read the docs in "annotation-war". It's ok to run mvn clean and mvn verify. But when I run mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish, I still encounter the same problem:
C:\zjf\code\IDEA\javaee_samples\servlet\annotation-war>mvn cargo:run -Dglassfish.home=C:\zjf\soft\glassfish
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building annotation-war 4.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.0:run (default-cli) # annotation-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.038 s
[INFO] Finished at: 2016-12-06T20:59:57+08:00
[INFO] Final Memory: 8M/184M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project annotation-war: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish4x], type = [installed]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
I really don't know how to run javaee SDK samples. Can anyone who know how to run it give me some help?
The simplest way to get it running is to first build the project with mvn install which will output a WAR file. The bottom of the log will tell you the full, absolute path to the WAR file. the install Maven goal will also put copy it to your local repository which is managed by Maven, so you will see two different paths to the same WAR file. Either of these works, e.g:
/path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
You can then use the asadmin tool in GlassFish to deploy the WAR file, first making sure GlassFish is running:
C:\zjf\soft\glassfish\glassfish4\bin\asadmin start-domain
C:\zjf\soft\glassfish\glassfish4\bin\asadmin deploy /path/to/my/app/target/annotation-war-1.0.0-SNAPSHOT.war
This isn't the only way to get it running (there are many) but you may find this is the easiest to undestand, with the fewest things that might go wrong, despite it being a bit long-winded.

Getting start with Maven

I am very new to Maven.I have installed the maven on my local machine.
After installation for trial basis i was trying to execute mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
for that i am getting below error message.
C:\work\maven2.2\bin>mvn archetype:generate -DarchetypeGroupId=org.apache
.maven.archetypes -DgroupId=com.mycompany.app -DartifactId=my-app
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file: repo1.ma
ven.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Aug 30 11:45:49 IST 2011
[INFO] Final Memory: 1M/59M
[INFO] ------------------------------------------------------------------------
Can any one help me if i need to have a prerequisite setting for the same?
Thanks in advance. :)
It's comand is correct and on my computer run correctly. But you have Error transferring file. So on this branch you may read about this error.
EDIT:
Tutorials:
First of all read this article : maven in 5 minutes
For more information : Maven Getting Started Guide
The second article will give you all you need to understend maven.

Simple Wicket / Maven quickstart problem

Wicket gives a simple "quickstart" command generator for use with Maven on their homepage at http://wicket.apache.org/start/quickstart.html
I installed this and understand that Maven automatically downloads requisites that it needs from its central repository. But when I run the command it generates, I get:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.161s
[INFO] Finished at: Fri May 06 22:07:28 EDT 2011
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\xxxxxx\Projects\[project dir]). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
What am I doing wrong?
the message suggests that Maven didn'recognize archetype plugin.
Can you copy and paste exact command that you are using?
Are using Windows cmd shell?
Try escaping arguments.

What could be causing 'error transferring file' in maven?

I have installed maven 2.2.1 on my debian machine and getting the following error
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repository.exoplatform.org
What I have been able to find relating to this problem is its typically caused by not having proxy settings correctly configured or a firewall blocking traffic, but I dont have either on this machine. Also, I have the same settings file on my windows machine and it works fine.
Any suggestions would be greatly appreciated as I am stumped.
exo#melb-web:~/test$ mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-07 05:16:01+1000)
Java version: 1.5.0_22
Java home: /usr/local/bin/jdk1.5.0_22/jre
Default locale: en_AU, platform encoding: UTF-8
OS name: "linux" version: "2.6.22-3-amd64" arch: "i386" Family: "unix"
exo#melb-web:~/test$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repository.exoplatform.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 30 10:18:33 EST 2010
[INFO] Final Memory: 2M/136M
[INFO] ------------------------------------------------------------------------
* EDIT *
I tried removing the settings.xml and generating a new maven project. I got the following
exo#melb-web:~/test$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: repo1.maven.org
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 30 11:40:26 EST 2010
[INFO] Final Memory: 1M/136M
[INFO] ------------------------------------------------------------------------
I think this rules out it being a problem with the settings.xml or a pom. Is there a way to get more information about why maven cant connect to the repository?
I've tried the same commands and get the same error message, so I've run using the debug flag. This gives a different root exception depending on the proxy settings etc.
Try running the same in case you get better verbose output.
mvn -X archetype:generate
Case 1:
Machine not connected to network (Cable disabled) gives a debug message
[DEBUG] Exception
org.apache.maven.wagon.TransferFailedException: Error transferring file
...
Caused by: java.net.UnknownHostException: repo1.maven.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
[INFO] Repository 'central' will be blacklisted
Case 2:
Machine connected with incorrect proxy gives the debug message
[DEBUG] Exception
org.apache.maven.wagon.TransferFailedException: Error transferring file
...
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
[INFO] Repository 'central' will be blacklisted
Here error could be 403, connection reset or Authorization or access forbidden error
Case 3:
Machine with direct connection to internet
[DEBUG] Trying repository central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archet
ype-plugin/2.0-alpha-5/maven-archetype-plugin-2.0-alpha-5.jar
[DEBUG] Artifact resolved
[INFO] ------------------------------------------------------------------------
and so on till it works.
Just to close the loop on this one - it turned out to be an issue with the libraries debian had available for java uses to resolve hostnames. The fix is to apply a new libdns for java as described here http://www.ehow.com/how_4747553_fix-unknownhostexception-java-applications-ubuntu.html. Once I did this I am able to run mvn with jdk5 and jdk6.
I would guess it has something to do with the repository settings in the pom, a parent pom or in your ~/.m2/settings.xml file. Its also possible that the repo at exoplatform is misconfigured.
With no repositories set the archetype plugin would come from repo1.maven.org
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/
I had the same problem. In my case it was actually a leftover settings.xml file from a prior job. I backed up and removed ~/.m2/settings.xml and the build went through just fine.
Update to maven 3.0.4 or up, if possible.
I've studied the maven source code: There is a bootstrap problem inside maven 2.2.1. The proxy is looked up as HTTPS when accessing HTTPS servers, but you only can have one proxy as active. There is no fallback to HTTP proxy. In maven 3.0.4 this issue seems to be solved.
The quick "solution" is to give fully qualified plugin name in the command :
mvn org.mortbay.jetty:maven-jetty-plugin:run
Don't forget to turn off your VPN especially for Chinese people. It's an SSL handshake issue.