I set up my own Jenkins and tried to get a project to build on it.
When I execute it from Jenkins i get the following log:
Parsing POMs
[workspace] $ /usr/local/java/jdk1.7.0_40/bin/java -Xmx512m -XX:MaxPermSize=128m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.4.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.32.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.4.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.4.jar 53026
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /var/lib/jenkins/jobs/RecipeManager/workspace/pom.xml mvn clean install -Denvironment=ci -X -e
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_40, vendor: Oracle Corporation
Java home: /usr/local/java/jdk1.7.0_40/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.2.0-4-amd64", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Using local repository at /var/lib/jenkins/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /var/lib/jenkins/.m2/repository
Oct 14, 2013 11:09:43 PM org.apache.maven.cli.event.ExecutionEventLogger projectDiscoveryStarted
INFO: Scanning for projects...
[DEBUG] Extension realms for project de.recipeManager:RecipeManager:war:0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging war from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: de.recipeManager:RecipeManager:war:0.1-SNAPSHOT
[DEBUG] Tasks: [mvn, clean, install]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO:
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO: ------------------------------------------------------------------------
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO: Building RecipeManager 0.1-SNAPSHOT
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger projectStarted
INFO: ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logResult
INFO: ------------------------------------------------------------------------
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logResult
INFO: BUILD FAILURE
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: ------------------------------------------------------------------------
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Total time: 0.621s
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Finished at: Mon Oct 14 23:09:44 CEST 2013
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger logStats
INFO: Final Memory: 5M/15M
Oct 14, 2013 11:09:44 PM org.apache.maven.cli.event.ExecutionEventLogger sessionEnded
INFO: ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/jobs/RecipeManager/workspace/pom.xml to de.recipeManager/RecipeManager/0.1-SNAPSHOT/RecipeManager-0.1-SNAPSHOT.pom
Sending e-mails to: davejs92#gmail.com
channel stopped
Sending e-mails to: davejs92#gmail.com
Finished: FAILURE
I ran it with -X and -e to see the full output but I can't see where it breaks.
And if I add a post-build step and execute the following in the shell it works well:
cd /var/lib/jenkins/jobs/RecipeManager/workspace
mvn clean install -Denvironment=ci
My pom.xml looks like that and works well if it's executed without Jenkins:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.recipeManager</groupId>
<artifactId>RecipeManager</artifactId>
<packaging>war</packaging>
<version>0.1-SNAPSHOT</version>
<name>RecipeManager</name>
<url>http://maven.apache.org</url>
<properties>
<spring-version>3.2.3.RELEASE</spring-version>
<jetty-version>8.1.2.v20120308</jetty-version>
<java-version>1.7</java-version>
</properties>
<dependencies>
<!--Spring-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.2.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.2.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.2.0.M2</version>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>0.7.0.RELEASE</version>
</dependency>
<!--Database:-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.2.3.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<!--JSON Mapping-->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!--Tests-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-version}</version>
</plugin>
</plugins>
</build>
</project>
Does anyone understand the log?
I'd suggest trimming the project configuration down to the smallest number of steps possible, and make sure you know exactly what goals your "build" step is invoking (try "clean install" to start - currently it looks like it's failing in site-deploy - did you want it to run that? Does it have enough information to do the right thing there if you do?), get that working and then add things back.
Note also that Jenkins can fail the build because a post-build step failed. For example, if you have the "Archive the artifacts" checked but the build doesn't contain any artifacts that match, your build can still fail even if Maven succeeds.
Had the same problem, and it was due to "send a mail for each fail module" in maven configuration. I guess that maven can't find any mail adress to send to, and fail without telling why.
I had the same issue because of this configuration:
post {
always {
publishHTML target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'tests/target/results/',
reportFiles: 'com.infineon.aurix.tests.html',
reportName: 'ADS RCPTT Tests Report'
]
junit 'tests/target/surefire-reports/*.xml'
}
}
The reportDir parameter of the publishHTML step was pointing to a non existing folder. Nothing in the logs, Stage green but the whole Pipeline Job fails.
Related
Java 8, maven compile issue on Jenkins
struggling for ages with this one. I can locally build, compile and test everything without a problem. I use same maven command as I use on my Jenkins. I wiped my .m2 folder so I have same empty repo and still everything fine.
This is the maven command I use:
(mvn) -U clean install -PTestExecutor -Dheadless=true -C
this is my POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx</groupId>
<artifactId>testing</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<cucumber.version>7.3.3</cucumber.version>
<selenium.version>4.1.4</selenium.version>
<awaitility.version>4.2.0</awaitility.version>
<assertj.version>3.22.0</assertj.version>
<commonsmodel.version>5.3.3</commonsmodel.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.surefire.version>3.0.0-M6</maven.surefire.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<junit-jupiter-engine.version>5.8.2</junit-jupiter-engine.version>
<maven-cucumber-reporting.version>5.7.0</maven-cucumber-reporting.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter-engine.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jodah</groupId>
<artifactId>failsafe</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>${cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${maven-cucumber-reporting.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>TestExecutor</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter-engine.version}</version>
</dependency>
</dependencies>
<configuration>
<includes>
<includes>**/ExecutorTest.java</includes>
</includes>
</configuration>
</plugin>
<!--cucumber report plugin-->
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${maven-cucumber-reporting.version}</version>
<executions>
<execution>
<id>generate-cucumber-reports</id>
<phase>test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Automation report</projectName>
<outputDirectory>${project.build.directory}/cucumber-reports</outputDirectory>
<inputDirectory>${project.build.directory}/cucumber</inputDirectory>
<jsonFiles>
<param>**/*.json</param>
</jsonFiles>
<checkBuildResult>false</checkBuildResult>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
and this is the full error report on Jenkins output:
Executing Maven: -B -f /appl/xxx/jenkins/workspace/Customer_Portal/web-full-suite/pom.xml -s /appl/xxx/maven/apache-maven-3.3.9/conf/settings.xml -U clean install -PTestExecutor -Dheadless=true -C
[INFO] Scanning for projects...
[HUDSON] Collecting dependencies info
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testing 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/org/apache/maven/maven-core/3.1.0/maven-core-3.1.0.pom
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/org/apache/maven/maven-core/3.1.0/maven-core-3.1.0.pom
[WARNING] The POM for org.apache.maven:maven-core:jar:3.1.0 is missing, no dependency information available
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/org/apache/maven/maven-plugin-api/3.1.0/maven-plugin-api-3.1.0.pom
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/org/apache/maven/maven-plugin-api/3.1.0/maven-plugin-api-3.1.0.pom
[WARNING] The POM for org.apache.maven:maven-plugin-api:jar:3.1.0 is missing, no dependency information available
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/io/cucumber/messages/maven-metadata.xml
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/io/cucumber/messages/maven-metadata.xml
[INFO] Downloaded: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/io/cucumber/messages/maven-metadata.xml (421 B at 20.6 KB/sec)
[WARNING] The POM for org.apache.maven:maven-plugin-api:jar:3.8.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo/org/apache/maven/maven/3.1.0/maven-3.1.0.pom
[INFO] Downloading: http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/plugins-release/org/apache/maven/maven/3.1.0/maven-3.1.0.pom
[WARNING] Attempt to (de-)serialize anonymous class org.jfrog.hudson.maven2.MavenDependenciesRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.828 s
[INFO] Finished at: 2022-06-13T16:59:43+02:00
[INFO] Final Memory: 18M/152M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal on project testing: Could not resolve dependencies for project com.xxx:testing:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:3.0.0-M6 -> org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M6 -> org.apache.maven.shared:maven-common-artifact-filters:jar:3.1.1 -> org.apache.maven:maven-artifact:jar:3.1.0: Failed to read artifact descriptor for org.apache.maven:maven-artifact:jar:3.1.0: Could not find artifact org.apache.maven:maven:pom:3.1.0 in XXX-Repo (http://nlxxxxcv166.srvfarm4-eur.xxx-group.com:8081/artifactory/Maven_repo) -> [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/DependencyResolutionException
[JENKINS] Archiving /appl/xxx/jenkins/workspace/Customer_Portal/web-full-suite/pom.xml to com.xxx/testing/1.0-SNAPSHOT/testing-1.0-SNAPSHOT.pom
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /cucumber/cucumber.html to /appl/xxx/jenkins/jobs/Customer_Portal/jobs/web-full-suite/htmlreports/HTML_20Report
ERROR: Specified HTML directory '/cucumber/cucumber.html' does not exist.
Publishing Selenium report...
Copying the reports.
parsing resultFile cucumber/cucumber.html
Unable to parse cucumber/cucumber.html: java.io.IOException: org.xml.sax.SAXParseException; systemId: file:/appl/xxx/jenkins/jobs/Customer_Portal/jobs/web-full-suite/builds/160/seleniumReports/cucumber/cucumber.html; lineNumber: 1; columnNumber: 10; DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
Set result to FAILURE
Finished: FAILURE
My spring boot app works fine on local machine. But when i try to deploy on GAE using this command, it gives me below error
mvn appengine:deploy
.........................................................failed.
[INFO] GCLOUD: ERROR: (gcloud.app.deploy) Error Response: [9]
[INFO] GCLOUD: Application startup error:
[INFO] GCLOUD: -XX:InitialHeapSize=514850816 -XX:MaxHeapSize=514850816 -XX:+Para
llelRefProcEnabled -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -X
X:+UseCompressedOops -XX:+UseG1GC
[INFO] GCLOUD: openjdk version "1.8.0_121"
[INFO] GCLOUD: OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-1~bpo8+1-b
13)
[INFO] GCLOUD: OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
[INFO] GCLOUD:
[INFO] GCLOUD: no main manifest attribute, in /app/demo-0.0.1-SNAPSHOT.jar
[INFO] GCLOUD:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:35 min
[INFO] Finished at: 2017-04-09T12:13:50+05:30
[INFO] Final Memory: 41M/422M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.2
.1:deploy (default-cli) on project demo: Execution default-cli of goal com.googl
e.cloud.tools:appengine-maven-plugin:1.2.1:deploy failed: Non zero exit: 1 -> [H
elp 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException
[POM.XML]
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>hello-boot</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
<version>1.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>1.4.9</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.7.v20160115</version>
</plugin>
<!--
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
-->
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>org.jboss.repository.releases</id>
<name>JBoss Maven Release Repository</name>
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
Any idea what is causing this error and how to fix it?
Just Incase anyone else has this issue:
add the following to pom.xml:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.0.5.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
this will repack the jar so that google can execute it
Answering on this old question :
Even I got similar errors in GAE, when using appdeploy command.
2020-02-25T21:33:31Z I0225 21:33:31.690485 40 jvm_internals.cc:130] ClassPathLookup constructor time: 150200 microseconds
2020-02-25T21:33:34Z I0225 21:33:34.075877 40 jvmti_agent.cc:431] Attaching Java debuglet
2020-02-25T21:33:42Z 2020-02-25 21:33:42.791 INFO 1 --- [main] com.company.api.Application : Started Application in 8.904 seconds (JVM running for 11.795)
2020-02-25T21:36:46Z I0225 21:36:46.523680 27 jvmti_globals.cc:327] Build time: May 7 2019 08:21:19
2020-02-25T21:36:46Z I0225 21:36:46.524086 27 jvmti_agent.cc:158] Java debuglet initialization started
2020-02-25T21:36:46Z I0225 21:36:46.524536 27 jvmti_agent.cc:192] Java debuglet initialization completed
2020-02-25T21:36:46Z I0225 21:36:46.674103 27 jvmti_agent.cc:203] Java VM started
2020-02-25T21:36:46Z I0225 21:36:46.689312 27 jvmti_agent.cc:213] JvmtiAgent::JvmtiOnVMInit initialization time: 15208 microseconds
2020-02-25T21:36:46Z I0225 21:36:46.689525 40 jvmti_agent_thread.cc:99] Agent thread started: CloudDebugger_main_worker_thread
2020-02-25T21:36:46Z I0225 21:36:46.689833 40 jvm_internals.cc:374] Loading internals from /opt/cdbg/cdbg_java_agent_internals.jar
2020-02-25T21:36:46Z OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
2020-02-25T21:36:47Z I0225 21:36:47.284777 40 jvm_internals.cc:130] ClassPathLookup constructor time: 162702 microseconds
2020-02-25T21:36:49Z I0225 21:36:49.708652 40 jvmti_agent.cc:431] Attaching Java debuglet
2020-02-25T21:36:58Z 2020-02-25 21:36:58.922 INFO 1 --- [main] com.company.api.Application : Started Application in 9.393 seconds (JVM running r 12.402)
2020-02-25T21:40:08Z I0225 21:40:08.205657 69 jvmti_agent.cc:221] Java VM termination
2020-02-25T21:40:08Z I0225 21:40:08.207619 40 jvmti_agent_thread.cc:103] Agent thread exited: CloudDebugger_main_worker_thread
2020-02-25T21:40:08Z I0225 21:40:08.215693 69 jvmti_agent.cc:235] JvmtiAgent::JvmtiOnVMDeath cleanup time: 10056 microseconds
2020-02-25T21:43:38Z I0225 21:43:38.522686 26 jvmti_globals.cc:327] Build time: May 7 2019 08:21:19
2020-02-25T21:43:38Z I0225 21:43:38.523125 26 jvmti_agent.cc:158] Java debuglet initialization started
2020-02-25T21:43:38Z I0225 21:43:38.523583 26 jvmti_agent.cc:192] Java debuglet initialization completed
2020-02-25T21:43:38Z I0225 21:43:38.682164 26 jvmti_agent.cc:203] Java VM started
2020-02-25T21:43:38Z I0225 21:43:38.699692 26 jvmti_agent.cc:213] JvmtiAgent::JvmtiOnVMInit initialization time: 17520 microseconds
2020-02-25T21:43:38Z I0225 21:43:38.699729 39 jvmti_agent_thread.cc:99] Agent thread started: CloudDebugger_main_worker_thread
2020-02-25T21:43:38Z I0225 21:43:38.700014 39 jvm_internals.cc:374] Loading internals from /opt/cdbg/cdbg_java_agent_internals.jar
2020-02-25T21:43:38Z OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
I did 2 things to resolve this :
1. Make sure the app.yaml file has resources specified. On some occassions, the VM does not have enough memory to run the application and it shuts down.
resources:
cpu: 2
memory_gb: 2.0
2. Like #Roie's answer above, add the repackage goal in the maven executions
I have build a web appliation containing a Spring MVC project with a mysql database and a tomcat7 server. This is now published to GIT of OpenShift.
But starting the server takes only 160ms and I can clearly see nothing is being loaded really.
How do I do a real deployment and connect the Openshift Tomcat to my project?
I can code, but deployment-wise I am not a smart bulb.
My GIT repository looks like this:
What is wrong?
EDIT:
As requested the pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.afterguard</groupId>
<artifactId>SailPlanner</artifactId>
<version>0.8.0</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<profiles>
<profile>
<id>openshift</id>
<build>
<finalName>sailplanner</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<outputDirectory>webapps</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.openshift</groupId>
<artifactId>openshift-java-client</artifactId>
<version>2.7.0.Final</version>
</dependency>
</dependencies>
</project>
The web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>SailPlanner</display-name>
<welcome-file-list>
<welcome-file>/WEB-INF/jsp/index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>sailplanner</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>sailplanner</servlet-name>
<!-- <url-pattern>/</url-pattern> -->
<url-pattern>/index</url-pattern>
<url-pattern>/inside/admin</url-pattern>
<url-pattern>/inside/admin/save</url-pattern>
<url-pattern>/inside/admin/delete</url-pattern>
<url-pattern>/inside/calendar_race</url-pattern>
<url-pattern>/inside/calendar_cruise</url-pattern>
<url-pattern>/inside/blog</url-pattern>
<url-pattern>/inside/blog/submit</url-pattern>
<url-pattern>/inside/blog/delete</url-pattern>
<url-pattern>/inside/event_feed</url-pattern>
<url-pattern>/inside/event/create</url-pattern>
<url-pattern>/inside/event/delete</url-pattern>
<url-pattern>/inside/event/crew/add</url-pattern>
<url-pattern>/inside/event/crew/remove</url-pattern>
<url-pattern>/inside/event/save</url-pattern>
<url-pattern>/login</url-pattern>
<url-pattern>/logout</url-pattern>
<url-pattern>/403</url-pattern>
<url-pattern>/registration</url-pattern>
<url-pattern>/inside/yacht/create</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/sailplanner-servlet.xml,
/WEB-INF/spring-security.xml,
/WEB-INF/spring-database.xml
</param-value>
</context-param>
<!-- Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Git Push Log (of successful build):
Repository ssh://566ffc920c1e668c8a000049#afterguard-sailplanner.rhcloud.com/~/git/afterguard.git/
Stopping jbossews cartridge
Sending SIGTERM to jboss:333213 ...
Stopping MySQL 5.5 cartridge
Stopping PHPMyAdmin cartridge
Waiting for stop to finish
Waiting for stop to finish
Repairing links for 1 deployments
Building git ref 'master', commit 277c797
Using Maven mirror /var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml
Apache Maven 3.0.4 (r1232336; 2012-12-18 14:36:37-0500)
Maven home: /usr/share/java/apache-maven-3.0.4
Java version: 1.7.0_91, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.32-573.12.1.el6.x86_64", arch: "i386", family: "unix"
Found pom.xml... attempting to build with 'mvn --global-settings /var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml clean package -Popenshift -DskipTests'
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SailPlanner 0.8.0
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.repository.redhat.com/techpreview/all/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.pom
...A LOT OF BUILDING AND DOWNLOADING...
Downloaded: http://mirror.ops.rhcloud.com/nexus/content/groups/public/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar (422 KB at 6105.7 KB/sec)
[INFO] Packaging webapp
[INFO] Assembling webapp [SailPlanner] in [/var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo/target/sailplanner]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo/WebContent]
[INFO] Webapp assembled in [517 msecs]
[INFO] Building war: /var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo/WebContent/ROOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.062s
[INFO] Finished at: Tue Dec 22 05:35:45 EST 2015
[INFO] Final Memory: 16M/161M
[INFO] ------------------------------------------------------------------------
Preparing build for deployment
Deployment id is 0f103f85
Activating deployment
Starting MySQL 5.5 cartridge
Starting PHPMyAdmin cartridge
Starting jbossews cartridge
Found 127.3.145.129:8080 listening port
-------------------------
Git Post-Receive Result: success
Activation status: success
Deployment completed with status: success
Tomcat log of OpenShift:
Dec 22, 2015 6:47:27 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1503 ms
Dec 22, 2015 6:47:27 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 22, 2015 6:47:27 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Dec 22, 2015 6:47:27 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.3.145.129-8080"]
Dec 22, 2015 6:47:27 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 251 ms
File Structure of ROOT.WAR, which is located in /var/lib/openshift/<uuid>/app-root/runtime/repo/WebContent :
|- META-INF
|- resources
|-- css
|-- fonts
|-- img
|-- js
|- WEB-INF
|-- classes
|--- com
|---- ...
|-- jsp
|--- index.jsp
|--- more jsp-sites
|-- jspf
|--- JSPF SITES I USE
|-- lib
|--- THE LIBS
|-- sailplanner-servlet.xml
|-- spring-datasource.xml
|-- spring-security.xml
|-- web.xml
It seems that you have forgotten to add an openshift maven profile inside your pom.xml like bellow with proper maven-war-plugin configuration.
<profiles>
<profile>
<id>openshift</id>
<build>
<finalName>travel</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<outputDirectory>webapps</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Then your application structure seems unusual. Usually to build a WAR with maven you put your webapp content in src/main/webapp, your resources in src/main/resources your WAR specific classes in src/main/java.
Take a look at maven-war-plugin user guide here.
Finally, check these documentations that could help you to unterstand how to deploy your application to Tomcat with OpenShift:
Host and Run Your Java Tomcat Application for Free on OpenShift’s PaaS
Tomcat Application Hosting
If you follow properly steps described in these documentations, then any git push will trigger a build and application re-deployment to Tomcat
EDIT
As you have a build compilation issue now (Java 8 not supported), you should take a look at this answer: invalid target release 1.8
I have a JSP application on OpenShift Tomcat.
But all of my source code located in /src/main
Java src code in /src/main/java that means com.example.Main 's location is <APP_NAME>/src/main/java/com/example/Main.java
JSP src code in /src/main/webapp that means index.jsp 's location is <APP_NAME>/src/main/webapp/index.jsp
Have you actually performed a git commit and git push?
If so, can you dump the logs from git push.
i have trouble with my maven web application what was created from maven-web-archetype. i am tried deploy my "helloworldapp" with tomcat7-maven-plugin, and it's not worked.
my errors list is there:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building weba Maven Webapp 1.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # web ---
[INFO] Deleting C:\Users\БОСС ЗДЕСЬ\IdeaProjects\projectb\web\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.401s
[INFO] Finished at: Mon Sep 14 13:34:27 GMT+04:00 2015
[INFO] Final Memory: 7M/109M
[INFO] ------------------------------------------------------------------------
C:\Users\БОСС ЗДЕСЬ\IdeaProjects\projectb>cd web
C:\Users\БОСС ЗДЕСЬ\IdeaProjects\projectb\web>mvn tomcat7:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building weba Maven Webapp 1.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) # web >>>
Downloading: http://repository.jboss.com/maven2/org/apache/tomcat/tomcat-catalina/7.0.47/tomcat-catalina-7.0.47.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-catalina/7.0.47/tomcat-catalina-7.0.47.jar
Downloaded: http://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat-catalina/7.0.47/tomcat-catalina-7.0.47.jar (1548 KB at 316.4 KB/sec
)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # web ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) # web ---
[INFO] No sources to compile
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) # web <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) # web ---
[INFO] Running war on http://localhost:8080/web
[INFO] Creating Tomcat server configuration at C:\Users\БОСС ЗДЕСЬ\IdeaProjects\projectb\web\target\tomcat
[INFO] create webapp with contextPath: /web
ёхэ 14, 2015 1:39:44 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
ёхэ 14, 2015 1:39:44 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
ёхэ 14, 2015 1:39:44 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
ёхэ 14, 2015 1:39:44 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.
java:2973)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1899)
at org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1469)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1246)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
ёхэ 14, 2015 1:39:44 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Parse error in application web.xml file at file:/C:/Users/┴╬╤╤%20╟─┼╤▄/IdeaProjects/projectb/web/target/tomcat/conf/web.xml
org.xml.sax.SAXParseException; systemId: file:/C:/Users/┴╬╤╤%20╟─┼╤▄/IdeaProjects/projectb/web/target/tomcat/conf/web.xml; lineNumber: 108;
columnNumber: 15; Error at (108, 15) : org.apache.catalina.deploy.WebXml addServlet
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2719)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1054)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.
java:2973)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1899)
at org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1469)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1246)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
... 26 more
ёхэ 14, 2015 1:39:44 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 108 column 15
ёхэ 14, 2015 1:39:45 PM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
ёхэ 14, 2015 1:39:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
ёхэ 14, 2015 1:39:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/web] startup failed due to previous errors
ёхэ 14, 2015 1:39:45 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/web] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application w
as stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
ёхэ 14, 2015 1:39:45 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>spring-webmvc</artifactId>
<groupId>org.epam</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>web</artifactId>
<packaging>war</packaging>
<version>1.1</version>
<name>weba Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>4.0.1.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.47</version>
<scope>provided</scope>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<version>3.0</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
<finalName>web</finalName>
</build>
</project>
parent's pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.epam</groupId>
<artifactId>spring-webmvc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Memorina</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>7.0.21</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.47</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.2-1003-jdbc4</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.com/maven2/</url>
</repository>
</repositories>
<build>
<finalName>spring-webmvc</finalName>
</build>
<packaging>pom</packaging>
<modules>
<module>service</module>
<module>web</module>
<module>db</module>
<module>model</module>
</modules>
</project>
my web.xml is
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- ======================== Introduction ============================== -->
<!-- This document defines default values for *all* web applications -->
<!-- loaded into this instance of Tomcat. As each application is -->
<!-- deployed, this file is processed, followed by the -->
<!-- "/WEB-INF/web.xml" deployment descriptor from your own -->
<!-- applications. -->
<!-- -->
<!-- WARNING: Do not configure application-specific resources here! -->
<!-- They should go in the "/WEB-INF/web.xml" file in your application. -->
<!-- ================== Built In Servlet Definitions ==================== -->
<!-- The default servlet for all web applications, that serves static -->
<!-- resources. It processes all requests that are not mapped to other -->
<!-- servlets with servlet mappings (defined either here or in your own -->
<!-- web.xml file). This servlet supports the following initialization -->
<!-- parameters (default values are in square brackets): -->
<!-- -->
<!-- debug Debugging detail level for messages logged -->
<!-- by this servlet. [0] -->
<!-- -->
<!-- fileEncoding Encoding to be used to read static resources -->
<!-- [platform default] -->
<!-- -->
<!-- input Input buffer size (in bytes) when reading -->
<!-- resources to be served. [2048] -->
<!-- -->
<!-- listings Should directory listings be produced if there -->
<!-- is no welcome file in this directory? [false] -->
<!-- WARNING: Listings for directories with many -->
<!-- entries can be slow and may consume -->
<!-- significant proportions of server resources. -->
<!-- -->
<!-- output Output buffer size (in bytes) when writing -->
<!-- resources to be served. [2048] -->
<!-- -->
<!-- readonly Is this context "read only", so HTTP -->
<!-- commands like PUT and DELETE are -->
<!-- rejected? [true] -->
<!-- -->
<!-- readmeFile File to display together with the directory -->
<!-- contents. [null] -->
<!-- -->
<!-- sendfileSize If the connector used supports sendfile, this -->
<!-- represents the minimal file size in KB for -->
<!-- which sendfile will be used. Use a negative -->
<!-- value to always disable sendfile. [48] -->
<!-- -->
<!-- useAcceptRanges Should the Accept-Ranges header be included -->
<!-- in responses where appropriate? [true] -->
<!-- -->
<!-- For directory listing customization. Checks localXsltFile, then -->
<!-- globalXsltFile, then defaults to original behavior. -->
<!-- -->
<!-- localXsltFile Make directory listings an XML doc and -->
<!-- pass the result to this style sheet residing -->
<!-- in that directory. This overrides -->
<!-- contextXsltFile and globalXsltFile[null] -->
<!-- -->
<!-- contextXsltFile Make directory listings an XML doc and -->
<!-- pass the result to this style sheet which is -->
<!-- relative to the context root. This overrides -->
<!-- globalXsltFile[null] -->
<!-- -->
<!-- globalXsltFile Site wide configuration version of -->
<!-- localXsltFile This argument is expected -->
<!-- to be a physical file. [null] -->
<!-- -->
<!-- -->
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Help me,please!
I'm trying to start a new struts 2 project using maven (struts2 blank archetype)
The code below runs and generates the project along with its pom.xml
D:\Dev\IndigoWS>mvn archetype:generate -B DgroupId=com.proj.core -DartifactId=MyStruts2Blank -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-ar
chetype-blank -DarchetypeVersion=2.2.1
with the following stacktrace from the terminal.
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Batch mode
[INFO] Archetype repository missing. Using the one from [org.apache.struts:strut
s2-archetype-blank:2.2.3] found in catalog remote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
but whenever I try to convert it into an eclipse project using the command
mvn eclipse:eclipse -Dwtpversion=1.5
I encountered the fatal error below
D:\Dev\MyWorkspace>cd MyStruts2Blank
D:\Dev\MyWorkspace\MyStruts2Blank>mvn eclipse:eclipse -Dwtpversion=1.5
[INFO] Scanning for projects...
[INFO]---------------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]------------------------------------------------------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.proj.core:MyStruts2Blank POM Location:
D:\Dev\MyWorkspace\MyStruts2Blank\pom.xml
the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.royj.core</groupId>
<artifactId>MyStruts2Blank</artifactId>
<version>${project.version}</version>
<packaging>war</packaging>
<name>Struts 2 Blank Webapp</name>
<properties>
<struts2.version>${project.version}</struts2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${struts2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
<scanTarget>src/main/resources/example.xml</scanTarget>
</scanTargets>
</configuration>
</plugin>
</plugins>
</build>
</project>
and the maven version
Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_24
Java home: C:\Program Files\Java\jdk1.6.0_24\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
What do I need to do to fix this and successfully generate a struts 2 blank archetype. I can successfully create a starter archetype for struts 2 using maven but with no success for the blank archetype. Is the blank archetype no longer available? By the way I am using Eclipse Indigo Version: Indigo , Release Build id: 20110615-0604
Thanks in advance guys.
The first i have to say don't use mvn eclipse:eclipse in relationship with Eclipse Indigo anymore, cause you have m2e as part of Indigo furthermore install m2e wtp plugin via Eclipse Marketplace. Where is your project.version defined, cause you are using it in relationship with your struts version but in your pom you didn't define any version.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.royj.core</groupId>
<artifactId>MyStruts2Blank</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Struts 2 Blank Webapp</name>
<properties>
<struts2.version>2.3.1.2</struts2.version>
</properties>
...
</project>
Apart from that i would suggest to upgrade to Maven 3.0.3 cause Eclipse Indigo uses a Maven 3. embedded.