Since migrating to Maven, a lot of Java project builds on Hudson randomly fail with the following error message:
[ERROR] Process did not initiate connection and is still alive; killing it
[ERROR] Failure: hudson.AbortException: Process failed to connect; exit code: 143
ERROR: Process failed to connect; exit code: 143
The build queue is not full. The next build usually works just fine. Any clues on what is happening?
I'm using Hudson version 3.2.1 with Hudson Maven3 Plug-in version 3.0.4
Full log (edited for simplicity/security):
Started by user anonymous
Building on master
Updating {svn path} revision: {date} depth:infinity ignoreExternals: false
At revision {number}
no change for {svn path} since the previous build
[INFO] Using bundled Maven 3 installation
[INFO] Checking Maven 3 installation environment
[workspace] $ {maven home}/mvn --help
[INFO] Checking Maven 3 installation version
[INFO] Detected Maven 3 installation version: 3.1.1
[workspace] $ {maven home}/mvn clean package -V -B -Dmaven.ext.class.path={classpath} -Dhudson.eventspy.port=54304 -f pom.xml
[DEBUG] Waiting for connection on port: 54304
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 12:22:22-0300)
Maven home: {maven home}
Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
Java home: {java home}
Default locale: en_US, platform encoding: ISO-8859-1
OS name: "linux", version: "2.6.18-407.el5", arch: "amd64", family: "unix"
[ERROR] Process did not initiate connection and is still alive; killing it
[ERROR] Failure: hudson.AbortException: Process failed to connect; exit code: 143
ERROR: Process failed to connect; exit code: 143
Sending e-mails to: {e-mail}
[DEBUG] Skipping watched dependency update for build: project-trunk #6 due to result: FAILURE
Finished: FAILURE
Since having random failures defeats the whole purpose of having a continuous integration tool, the answer is moving on to Jenkins for better Maven support.
Related
I'm trying to deploy a new version of my app to the path /app-test using the ## notation.
I've set the warFileName in pom.xml to be app-test##2021-01-21-pkix-fix and then called
mvn clean tomcat7:deploy
which generates and builds a .war successfully:
...
[INFO] Generating war /xyz/target/app-test##2021-01-21-pkix-fix.war
[INFO] Building war: /xyz/target/app-test##2021-01-21-pkix-fix.war
As it proceeds to upload the resources, it tries to do so multiple times while adding /deploy?path for the 2nd time. The third attempt makes even less sense:
[INFO] Deploying war to http://mydomain.eu/app-test##2021-01-21-pkix-fix
Uploading: http://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: http://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploading: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploading: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
Uploaded: https://mydomain.eu/manager/text/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix/deploy?path=%2Fapp-test%23%232021-01-21-pkix-fix
The deployment then fails:
FAIL - Failed to deploy application at context path /app-test##2021-01-21-pkix-fix/deploy?path=/app-test##2021-01-21-pkix-fix
because paths must not contain the = char which is confirmed by the catalina-daemon.out error log:
...
javax.management.MalformedObjectNameException: Invalid character '=' in value part of property
at javax.management.ObjectName.construct(ObjectName.java:618)
at javax.management.ObjectName.<init>(ObjectName.java:1382)
...
Here's my condensed pom.xml.
I suspect this has to do with my relatively recent mvn upgrade through homebrew. Here's my current version:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 1.8.0_112, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
Why does tomcat keep adding /deploy?path to my deployments?
As I'm investigating further, it's likely it's related to the tomcat7-maven-plugin but the docs haven't really clarified anything.
When all else fails, there's always the option to deploy the .war manually.
Package the program first:
mvn clean package [-P profile_name]
and then locate the .war in /target:
I'm trying to setup SonarQube on Travis for a Java project by following Travis documentation https://docs.travis-ci.com/user/sonarqube/
My resulting my .travis.yml file is as follows:
sudo: required
cache:
directories:
- $HOME/.m2
language: java
services:
- docker
jdk:
- oraclejdk8
os:
- linux
env:
matrix:
- NEO_VERSION=3.0.9
WITH_DOCKER=true
EXTRA_PROFILES=-Pwith-neo4j-io
- NEO_VERSION=3.1.2
WITH_DOCKER=true
EXTRA_PROFILES=-Pwith-neo4j-io
addons:
sonarqube:
organization: ${SONAR_ORGANIZATION}
token:
secure: ${SONAR_TOKEN}
branches:
- master
- sonarqube
before_script:
script:
- build/run.sh
- sonar-scanner
install: true
after_success:
- mvn clean test jacoco:report coveralls:report
- "[ ${TRAVIS_PULL_REQUEST} = 'false' ] && [[ ${TRAVIS_BRANCH} = 'master' ]] && mvn clean deploy -DskipTests --settings ./deploy-settings.xml"
My resulting sonar-scanner.properties file is:
# must be unique in a given SonarQube instance
sonar.projectKey=liquigraph
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=Liquigraph
sonar.projectVersion=1.0
# Set modules IDs
sonar.modules=liquigraph-cli,liquigraph-core,liquigraph-maven-plugin,liquigraph-spring-boot-starter,liquigraph-examples
# Modules inherit properties set at parent level
sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.language=java
But when I commit and Travis start building, sonar job fails with following logs:
. . .
$ sonar-scanner
INFO: Scanner configuration file: /home/travis/.sonarscanner/sonar-scanner-2.8/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_111 Oracle Corporation (64-bit)
INFO: Linux 4.4.0-51-generic amd64
INFO: User cache: /home/travis/.sonar/cache
. . .
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 13.770s
INFO: Final Memory: 64M/505M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.sources
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
I did put my sonar-scanner.properties in the root of my project folder. Why travis cannot find and instead is using /home/travis/.sonarscanner/sonar-scanner-2.8/conf/sonar-scanner.properties?
If your project is a Maven project, then simply use the Scanner for Maven: mvn sonar:sonar
Look at https://about.sonarqube.com/get-started/ for details.
If you really want to use the SonarQube Scanner, then your issue is that you are not using the correct name for the configuration file. It should be sonar-project.properties.
This is only happens to 3rd party Maven repository for ElasticSearch on EC2 instance. It's working fine locally.
https://maven.elasticsearch.org/releases
Is it a configuration issue?
[ERROR] Failed to execute goal on project system-s: Could not resolve
dependencies for project com.7leaf:system-s:jar:0.0.1: Failed to collect
dependencies at org.elasticsearch.plugin:shield:jar:2.4.1: Failed to read
artifact descriptor for org.elasticsearch.plugin:shield:jar:2.4.1: Could not
transfer artifact org.elasticsearch.plugin:shield:pom:2.4.1 from/to es-repo
(https://maven.elasticsearch.org/releases): Received fatal alert:
handshake_failure -> [Help 1]
This is the Maven and Java version on the server.
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /usr/share/apache-maven
Java version: 1.8.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.24.amzn1.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.23-31.51.amzn1.x86_64", arch: "amd64", family: "unix"
After trying out a few things, I found out that the issue is SSL and for this case, I'm able to switch to use non-SSL endpoint instead to solve the issue.
Switch to use
http://maven.elasticsearch.org/releases
instead of
https://maven.elasticsearch.org/releases
I was using JDEE for my java projects in Emacs. JDEE does not work well for maven. Recently I came across Malabar Mode which has better support for Maven based Java projects in Emacs.
I managed to install malbar-mode using melpa in M-x list-packages. But when I'm getting error message on mvn package for my simple app https://github.com/vijayendra/JavaSrc/tree/master/my-app
Projects.get('/home/egnyte/src/my-app/pom.xml', []).run(['package'], [], [:])
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.081s
[INFO] Finished at: Sat Dec 06 23:55:22 PST 2014
[INFO] Final Memory: 20M/48M
[INFO] ------------------------------------------------------------------------
[ERROR] Execution error
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for or\
g.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
My emacs version is as follows:
emacs -version
GNU Emacs 24.3.1
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
My .emacs file is as follows:
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
;; unstable packages
;; (add-to-list 'package-archives
;; '("melpa" . "http://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
(require 'cedet)
(require 'semantic)
(load "semantic/loaddefs.el")
(semantic-mode 1)
(setq malabar-groovy-lib-dir "~/.m2/repository/com/software-ninja/malabar/1.5.10")
(require 'malabar-mode)
(add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))
My maven version is as follows:
mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T13:58:10-07:00)
Maven home: /home/egnyte/lib/apache-maven-3.2.3
Java version: 1.7.0_65, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.8.0-29-generic", arch: "amd64", family: "unix"
How can I get malabar mode to work?
There are two answers.
First, malabar-mode is stuck at maven 3.0.4 so try that version. Also do not set the lib dir. It should be set automatically.
Second, in order to get around the maven version I am rewriting malabar-mode from scratch. Follow the instructions at https://github.com/m0smith/malabar-mode/blob/develop/doc/2.0/INSTALL.md. This version should work for all versions of maven after 3.0.4. It is a work in progress and not all the features are there yet.
If you have problems or suggestions create an issue in the GitHub repo as now is a good time to get your wishes known
EDIT: 2.0 of malabar has been released to MELPA. To install now:
```
(load-file "~/projects/cedet/cedet-devel-load.el")
(add-hook 'after-init-hook (lambda ()
(message "activate-malabar-mode")
(activate-malabar-mode)))
(add-hook 'malabar-java-mode-hook 'flycheck-mode)
(add-hook 'malabar-groovy-mode-hook 'flycheck-mode)
```
COMMAND:
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.beardedgeeks -DarchetypeArtifactId
=gae-eclipse-maven-archetype -DarchetypeVersion=1.1.2 -DarchetypeRepository=http://beardedgeeks.googlecode.com/svn/repository/release
s
OUTPUT:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager getting plugin 'org.apache.maven.plugins:maven-archetype-plugin': Plugin 'org.apache.maven
.plugins:maven-archetype-plugin:2.0-alpha-4' has an invalid descriptor:
1) Plugin's descriptor contains the wrong group ID: net.kindleit
2) Plugin's descriptor contains the wrong artifact ID: maven-gae-plugin
3) Plugin's descriptor contains the wrong version: 0.5.9
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jun 09 20:48:35 CEST 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
I have a hard time believing this Maven plugin has an invalid descriptor since other people seem to be using it with no problem. Am I doing something wrong?
Can't reproduce your problem, the following command works fine for me (copied & pasted from GAE + Eclipse + Maven Archetype):
mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate \
-DarchetypeGroupId=org.beardedgeeks \
-DarchetypeArtifactId=gae-eclipse-maven-archetype \
-DarchetypeVersion=1.1.2 \
-DarchetypeRepository=http://beardedgeeks.googlecode.com/svn/repository/releases
Tested with Maven 2.2.1:
$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-sun-1.6.0.20/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-22-generic" arch: "i386" Family: "unix"
I often experience problems with crappy metadata in my local repository. This kind of error usually vanishes after I do
rm -Rf my/home/dir/.m2/repository/net/kendleit/maven-gae-plugin
but actually the reason why it works with Pascal is that Pascal uses this url http://beardedgeeks.googlecode.com/svn/repository/releases whereas you use this url http://beardedgeeks.googlecode.com/svn/repository/release (an s is missing, hence there's a 404)
do the rm as mentioned above and then run again with the correct url
EDIT: sorry there is actually a trailing s I didn't see. I take everything back, but still: try to delete the metadata in your local repo
Reason:
the GAV (groupid, artifactid, version) in Nexus (consequently in local repository and in the pom.xml) is not the same as the one in the jar file in \META-INF\maven\plugin.xml
This usually happens when you upload manually the plugin artifact in your own Nexus (or any other maven enterprise repository)
Solution:
download the jar, see what are the GAV values in plugin.xml
upload the jar on Nexus, passing as GAV the information from the plugin.xml
Update the pom.xml accordingly
Make sure to remove from Nexus the old inconsistent artifact.