You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marco Mistroni <mm...@gmail.com> on 2007/12/01 18:01:16 UTC
cargo plugin problems
hi all,
i am trying to run selenium tests using maven2/ cargo / jetty / selenium
plugin
i am following instructions here (
http://wiki.foochal.org/index.php/Maven_Selenium)
however, when cargo starts, i am getting this exceptions
2007-12-01 16:52:53.582::WARN: Failed startup of context
org.mortbay.jetty.webapp.WebAppContext@bbd1b{/BudgetWeb-1.0-SNAPSHOT
,jar:file:/home/marco/BudgetAppV2/BudgetWeb/target/BudgetWeb-
1.0-SNAPSHOT.war!/}
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@8c02cc for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by
org.apache.commons.logging.LogConfigurationException: No suitable Log
constructor [Ljava.lang.Class;@8c02cc for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.springframework.web.context.ContextLoader.<init>(
ContextLoader.java:139)
at
org.springframework.web.context.ContextLoaderListener.createContextLoader(
ContextLoaderListener.java:57)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(
ContextLoaderListener.java:48)
at org.mortbay.jetty.handler.ContextHandler.startContext(
ContextHandler.java:511)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
at org.mortbay.jetty.webapp.WebAppContext.startContext(
WebAppContext.java:1191)
at org.mortbay.jetty.handler.ContextHandler.doStart(
ContextHandler.java:481)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java
:434)
at org.mortbay.component.AbstractLifeCycle.start(
AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(
HandlerCollection.java:147)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(
ContextHandlerCollection.java:120)
at org.mortbay.component.AbstractLifeCycle.start(
AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(
HandlerCollection.java:147)
at org.mortbay.component.AbstractLifeCycle.start(
AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(
HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at org.mortbay.component.AbstractLifeCycle.start(
AbstractLifeCycle.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.cargo.container.jetty.internal.JettyExecutorThread.run(
JettyExecutorThread.java:68)
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable
Log constructor [Ljava.lang.Class;@8c02cc for
org.apache.commons.logging.impl.Log4JLogger (Caused by
java.lang.NoClassDefFoundError: org/apache/log4j/Category)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
LogFactoryImpl.java:413)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
LogFactoryImpl.java:529)
... 25 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.getConstructor(Class.java:1629)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
LogFactoryImpl.java:410)
... 26 more
2007-12-01 16:52:53.588::INFO: Extract
jar:file:/home/marco/BudgetAppV2/BudgetWeb/target/jetty6x/cargocpc.war!/ to
/tmp/Jetty_0_0_0_0_8080_cargocpc.war__cargocpc__xflgf3/webapp
2007-12-01 16:52:54.210::INFO: Started SelectChannelConnector @
0.0.0.0:8080
[INFO] [beddedLocalContainer] Jetty 6.x Embedded started on port [8080]
[INFO] [cargo:deploy {execution: start-container}]
[INFO] [mbeddedLocalDeployer] Deploying
[/home/marco/BudgetAppV2/BudgetWeb/target/BudgetWeb-1.0-SNAPSHOT.war]
2007-12-01 16:52:58.114::INFO: Extract
jar:file:/home/marco/BudgetAppV2/BudgetWeb/target/BudgetWeb-
1.0-SNAPSHOT.war!/ to /tmp/Jetty_0_0_0_0_8080_BudgetWeb-
1.0-SNAPSHOT.war__BudgetWeb-1_0-SNAPSHOT__8a04wa/webapp
2007-12-01 16:52:59.925::WARN: failed
org.mortbay.jetty.webapp.WebAppContext@39f16f{/BudgetWeb-1.0-SNAPSHOT
,jar:file:/home/marco/BudgetAppV2/BudgetWeb/target/BudgetWeb-
1.0-SNAPSHOT.war!/}
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(
SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(
WebAppClassLoader.java:354)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(
WebAppClassLoader.java:325)
at org.mortbay.jetty.handler.ContextHandler.loadClass(
ContextHandler.java:978)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initListener(
WebXmlConfiguration.java:624)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initWebXmlElement(
WebXmlConfiguration.java:366)
at org.mortbay.jetty.webapp.WebXmlConfiguration.initialize(
WebXmlConfiguration.java:288)
at org.mortbay.jetty.webapp.WebXmlConfiguration.configure(
WebXmlConfiguration.java:221)
at org.mortbay.jetty.webapp.WebXmlConfiguration.configureWebApp(
WebXmlConfiguration.java:179)
at org.mortbay.jetty.webapp.WebAppContext.startContext(
WebAppContext.java:1188)
at org.mortbay.jetty.handler.ContextHandler.doStart(
ContextHandler.java:481)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java
:434)
at org.mortbay.component.AbstractLifeCycle.start(
AbstractLifeCycle.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer.addHandler(
Jetty6xEmbeddedLocalContainer.java:294)
at
org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalDeployer.deployWebApp
(Jetty6xEmbeddedLocalDeployer.java:77)
at
org.codehaus.cargo.container.jetty.internal.AbstractJettyEmbeddedLocalDeployer.deploy
(AbstractJettyEmbeddedLocalDeployer.java:95)
at
org.codehaus.cargo.maven2.DeployerDeployMojo.performDeployerActionOnSingleDeployable
(DeployerDeployMojo.java:79)
at
org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables
(AbstractDeployerMojo.java:118)
at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(
AbstractDeployerMojo.java:47)
at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(
AbstractCargoMojo.java:243)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to deploy [/home/marco/BudgetAppV2/BudgetWeb/target/BudgetWeb-
1.0-SNAPSHOT.war]
javax/servlet/ServletContextListener
here's my pom for your reference.......
***********************************************
<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>BudgetApp</groupId>
<artifactId>BudgetWeb</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>BudgetWeb</name>
<url>http://maven.apache.org</url>
<ciManagement>
<system>continuum</system>
<url>http://localhost:8080/continuum</url>
<notifiers>
<notifier>
<type>mail</type>
<configuration>
<address>mmistroni@sky.com</address>
</configuration>
</notifier>
</notifiers>
</ciManagement>
<developers>
<developer>
<id>MistroniM</id>
<name>Marco Mistroni</name>
<email>mmistroni@gmail.com</email>
<roles>
<role>Developer</role>
<role>Continuum Admin</role>
</roles>
<organization>WorldCorp Services Ltd</organization>
<timezone>0</timezone>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>COLL IT</name>
<subscribe>dev-subscribe@wakaleo.com</subscribe>
<unsubscribe>dev-unsubscribe@wakaleo.com</unsubscribe>
<post>dev@wakaleo.com</post>
<archive>http://mail-archives.wakaleo.com/modmbox/dev/</archive>
</mailingList>
</mailingLists>
<profiles>
<profile>
<id>BudgetApp</id>
<properties>
<deployDir>/home/marco/jboss-4.0.5.GA</deployDir>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
<scm>
<connection>scm:svn:svn://localhost/trunk/BudgetWeb</connection>
<developerConnection>scm:svn:svn://localhost/trunk/BudgetWeb</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>BudgetApp</groupId>
<artifactId>Backend</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>1.2.6</version>
<exclusions>
<exclusion>
<groupId>ehcache</groupId>
<artifactId>ehcache</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock-legacy</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.0.9</version>
<exclusions>
<exclusion>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
</exclusion>
<exclusion>
<groupId>xwork</groupId>
<artifactId>xwork</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>poi</groupId>
<artifactId>poi</artifactId>
<version>2.5.1</version>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.0.9</version>
</dependency>
<!-- selenium dependencies -->
<dependency>
<groupId>org.openqa.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver-tests</artifactId>
<version>0.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openqa.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>0.9.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<background>true</background>
<logOutput>true</logOutput>
<multiWindow>true</multiWindow>
</configuration>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3-SNAPSHOT</version>
<configuration>
<wait>false</wait>
<container>
<containerId>jetty6x</containerId>
<type>embedded</type>
</container>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/uattests/*Test.java</exclude>
</excludes>
<systemProperties>
<property>
<name>net.sourceforge.cobertura.datafile</name>
<value>target/cobertura/cobertura.ser</value>
</property>
</systemProperties>
</configuration>
<executions>
<execution>
<id>integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/uattests/*Test.java
</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<instrumentation>
<ignores>
<ignore>com.mm.budgetweb.ajax.*</ignore>
</ignores>
</instrumentation>
<check>
<haltOnFailure>true</haltOnFailure>
<totalBranchRate>60</totalBranchRate>
<totalLineRate>70</totalLineRate>
</check>
</configuration>
<executions>
<execution>
<goals>
<goal>clean</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<!-- <configuration>
<warName>BudgetWeb</warName>
<outputDirectory>${deployDir}/webapps</outputDirectory>
</configuration>-->
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>
</plugins>
</reporting>
</project>
???
anyone could help m e out?
i thought jetty would take crare of javax. packages..... as it is supposed
to start webserver.
please note that, if i run in 1 window jetty, in another one selenium
server, and in a third one my selenium tests everything works fine.....
thanks in advance and regards
marco