I am using axis2-wsdl2code-maven-plugin to generate my SOAP service client. The plugin itself works correctly and it generates a correct SOAP client, but I get following warning in console with every build:
log4j:WARN No appenders could be found for logger (org.apache.axiom.locator.DefaultOMMetaFactoryLocator).
log4j:WARN Please initialize the log4j system properly.
I know I need to configure Log4j properties, but I haven't found any functional way to do this in context of axis2-wsdl2code-maven-plugin...
This is my pom.xml file:
<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>
<artifactId>powerauth-java-client-axis</artifactId>
<version>0.13.0</version>
<name>powerauth-java-client-axis</name>
<description>PowerAuth 2.0 Service Client - Axis</description>
<parent>
<groupId>io.getlime.security</groupId>
<artifactId>powerauth-parent</artifactId>
<version>0.13.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
<version>1.2.20</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
<version>1.2.20</version>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.6.19</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<!-- tag::wsdl[] -->
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>1.6.4</version>
<executions>
<execution>
<goals>
<goal>wsdl2code</goal>
</goals>
<configuration>
<packageName>io.getlime.powerauth.soap</packageName>
<wsdlFile>${basedir}/src/main/resources/soap/wsdl/service.wsdl</wsdlFile>
</configuration>
</execution>
</executions>
</plugin>
<!-- end::wsdl[] -->
</plugins>
</build>
</project>
This is actually a bug. The fix for AXIS2-5364 added a dependency on log4j to axis2-wsdl2code-maven-plugin. The problem is that some of the code executed by the plugin uses Commons Logging and therefore started to use log4j. That generates the warning you have seen because in a Maven environment, log4j isn't configured.
What the plugin should do is to redirect logs to SLF4J, because that API is supported by recent Maven versions. The -X option (which enables debug logging on the Maven command line) then works for these logs as well.
This problem will be addressed in AXIS2-5827.
Related
Hey i have a problem starting my maven project on devserver and update calls.
I buils my maven project to run with google cloud engine, but im getting this issue and cant start my server.
This is my 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>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<groupId>trainingBuddyServer</groupId>
<artifactId>Training-Buddy-Server</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
<archiveClasses>true</archiveClasses>
</properties>
<prerequisites>
<maven>3.5</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.67</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.objectify</groupId>
<artifactId>objectify</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
<version>1.9.67</version>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-endpoints</artifactId>
<version>1.9.67</version>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-management-control-appengine</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>com.google.endpoints</groupId>
<artifactId>endpoints-framework-auth</artifactId>
<version>1.0.3</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-testing</artifactId>
<version>1.9.67</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-stubs</artifactId>
<version>1.9.67</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-tools-sdk</artifactId>
<version>1.9.67</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>0.33</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- for hot reload of the web application-->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.67</version>
<configuration>
<appId>trainingbuddy-221215</appId> <!-- Override appengine-web.xml <project> -->
<version>1</version>
<fullScanSeconds>1</fullScanSeconds>
<retainUploadDir>true</retainUploadDir>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<deploy.promote>true</deploy.promote>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.5</version>
</requireMavenVersion>
<requirePluginVersions>
<message>Best Practice is to always define plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
<phases>clean,deploy,verify,appengine:run,appengine:deploy,appengine:update,appengine:devappaserver,site</phases>
</requirePluginVersions>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I think its something wrong with pom file, because error says that it cant find this element "com.google.appengine:appengine-maven-plugin:1.9.67:devserver". So this is teh error if it will help :
[INFO] --- appengine-maven-plugin:1.9.67:devserver (default-cli) # Training-Buddy-Server ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.212 s
[INFO] Finished at: 2018-11-01T23:37:27+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver (default-cli) on project Training-Buddy-Server: The parameters 'project' for goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver are missing or invalid -> [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/PluginParameterException
Maybe someone know how to fix this?
Adding the
<project>YOUR PROJECT ID</project>
Indeed solves it for me also, however I'm not using the newer gclod maven plugin but the older appengine one:
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
vs mine
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
At some point I should probably move on to the gcloud plugin but right now I haven't got time.
The old appengine plugin also works with the (undocumented) "project" configuration tag. Really confusing and also poor work by google since their getting (started examples) doesn't work, from 1.9.67 and above. Also if it's required from now on we should have gotten some information about it.
For the record I'm posting my multi module/services parent pom snippet including the pluginmanagement with the old appengine plugin:
<pluginManagement>
<plugins>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>${appengine.target.version}</version>
<configuration>
<project>YOUR PROJECT ID</project> <!-- WHAT DO WE NEED THIS FOR-->
<jvmFlags>
<jvmFlag>-Ddatastore.backing_store=${project.basedir}/local_db.bin</jvmFlag>
</jvmFlags>
<fullScanSeconds>-1</fullScanSeconds>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Did you manage to solve this? I've been using my multi module project pom(s) for at least 3 years with no problems, however since 1.9.67 I'm no longer able to deploy or running devserver via appengine maven plugin, with the same error:
The parameters 'project' for goal com.google.appengine:appengine-maven-plugin:1.9.67:devserver are missing or invalid
Using 1.9.65 works for me, so as a short time solution you should be able to use that version instead, however I don't know how old versions your allowed to deploy.
I had the same issue with latest AppEngine. It worked fine with lower than 1.9.64, but it generated the same error with the later version. Today I solved that issue by adding filed on the pom.xml as
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<project>your project ID on Google Cloud </project>
<deploy.promote>true</deploy.promote>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
</configuration>
</plugin>
This is a problem since 1.9.66:
The parameters 'project' for goal
com.google.appengine:appengine-maven-plugin:1.9.66:... are missing or
invalid
I have created a maven project for my automation selenium script and added all the required dependencies to pom.xml.
If I do the maven build(Test), test cases which I mentioned in TestNG.xml is running fine. But TestNG test result console is blank. It doesn't say any information about how many cases got executed and how many passed? Though Eclipse console output is having the test status.
TestNG.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite guice-stage="DEVELOPMENT" name="Default suite" >
<test verbose="2" name="Default test" >
<classes >
<class name="automation.BrowserNavigation"/>
</classes>
</test> <!-- Default test -->
</suite> <!-- Default suite -->
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>TupasRegression</groupId>
<artifactId>TupasRegression</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/TestNG.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
</profiles>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>3.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.14</version>
<scope>compile</scope>
</dependency>
<!-- </dependency> -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>openxml4j</artifactId>
<version>1.0-beta</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.3.1</version>
</dependency>
</dependencies>
</project>
Eclipse Console Output
TestNG result page
The testng console that you show in the screenshot will not show any results - that is a testng plugin provided console and it will only show results if you choose to run your tests or suite with the Run As -> TestNG (suite/test) options.
When you are running through maven, the testng plugin doesn't get exercised and hence you do not see anything in the console. If you need results of this run, you need to check the test-results folder in the target folder generated by maven.
I had the same problem. I think my answer is not the way to fix it, but you can see how many cases got executed and how many passed in the index.html by running it on browser, this file is in test-output folder. Each time you run testcases, TestNG will update this file.
It is possible to show the test results in the Maven build console output.
1) create a testng.xml file, which outlines your test classes.
To do in eclipse you right click your maven project then select TESTNG > Convert to TestNG.
2) Update your Maven POM file to include the relevant dependencies and plugins.
The key configuration is the Maven surefire plugin which is configured to point to your testng.xml file.
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Following plugin executes the testng tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<configuration>
<!-- Suite testng xml file to consider for test execution -->
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<!-- Compiler plugin configures the java version to be usedfor compiling
the code -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
</plugins>
</build>
3) Run a Maven test and the TestNG results will appear in the Maven output console.
I am trying to integrate Selenium TestNG to maven but having trouble in adding dependencies to pom.xml (as described in this article ), and getting error on the same. Issue appears only when I add selenium and testng dependencies, I have already imported those library to the project. Below is xml code
<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>ProV1</groupId>
<artifactId>ProV1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.47.1</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
And this is the error I am getting
As suggested in some articles I cleaned the project, refreshed but nothing worked out.
I am a newbie to Maven so will be very greatfull for all helpful suggestion on how to fix this.
Issue resolved by removing dependencies, there was no need to add dependencies. Maven adds them automatically.
I am using the Maven Tomcat plugin to test a Maven webservice project using Hibernate.
My POM looks like this:
<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>com.honeywell.gt</groupId>
<artifactId>WSOCCMeoReports</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Simple CXF project using spring configuration</name>
<description>Simple CXF project using spring configuration</description>
<properties>
<shiro.version>1.2.1</shiro.version>
<spring.version>3.1.2.RELEASE</spring.version>
<cxf.version>2.6.1</cxf.version>
<hibernate.version>3.6.5.Final</hibernate.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>com.sybase.jdbc</groupId>
<artifactId>SybDriver</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- mvn clean install tomcat:run-war to deploy
Look for "Running war on http://xxx" and
"Setting the server's publish address to be /yyy"
in console output; WSDL browser address will be
concatenation of the two: http://xxx/yyy?wsdl
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<executions>
<execution>
<id>start-tomcat</id>
<goals>
<goal>run-war</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<port>${test.server.port}</port>
<path>/webservice</path>
<fork>true</fork>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
The Debug goals are tomcat:run-war
After hitting a break point in the service I cannot step into third party dependencies such as Hibernate. However, if I run a Unit test from the same Maven web service project, I can step into Hibernate.
EDIT 1:
I ran into this and got some ideas about attaching source. Matter of fact, I am trying to debug Hibernate, so I edited source lookup and added paths to the following external archives in my .m2 repository:
hibernate-entitymanager-3.6.5.Final
hibernate-core-3.6.5.Final.
Saved changes and Eclipse still cannot find source to step into. Anyone out there?
Problem appears to be a know issue with Maven Plugin for Eclipse as indicated here.
This post was helpful but I found out that for hibernate 3.6.5, I had to add hibernate-core-3.6.5.Final-sources.jar to source lookup path instead of hibernate-core-3.6.5.Final.jar.
Issue
Working with TestNG on a maven managed project, i can't seem to run tests via the TestNG eclipse plugin. When trying to run tests, the following error message pops up (inside a dialog window):
Couldn't contact the RemoteTestNG client. Make sure you don't have an
older version of testng.jar on your class path.
Reason:
Timeout while trying to contact RemoteTestNG.
How to resolve this?
Things I have tried
(After asking all my peers at the office QA department on this, and looking up information via the common search engines and on TestNG forums)
Making sure I don't have an older version on my class path (naturally).
Eliminating possible collisions between maven imported jars and jars used by the TestNG eclipse plugin (both are of version 6.7, and the project's pom.xml confirmed to use only its own dependent jar).
Performing maven update and build after said changes.
Running on a different JRE (specifically 1.7.0).
Relevant information
Environment:
OS: Win XP pro SP3
JRE: 1.6.0 update 31
TestNG: 6.7
Maven: 3.0.3
IDE: Eclipse Juno Java EE SR1
pom.xml content:
<?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>
<artifactId>SGTest</artifactId>
<name>SGTest</name>
<description>Service Grid Test project for XAP</description>
<parent>
<groupId>com.my_product.quality.sgtest</groupId>
<artifactId>SGTest-parent</artifactId>
<version>3.0.0</version>
<relativePath>http://mvn-srv:8081/artifactory/libs-snapshot-local/com/my_product/quality/sgtest/SGTest-parent/3.0.0/SGTest-parent-3.0.0.pom</relativePath>
</parent>
<properties>
<xap.home>${env.XAP_LATEST}</xap.home>
</properties>
<dependencies>
<dependency>
<groupId>com.my_product</groupId>
<artifactId>my_opensource_product</artifactId>
<version>${gsVersion}</version>
<scope>system</scope>
<systemPath>${xap.home}/lib/required/my_opensource_product.jar</systemPath>
</dependency>
<dependency>
<groupId>com.my_product</groupId>
<artifactId>gs-runtime</artifactId>
<version>${gsVersion}</version>
<scope>system</scope>
<systemPath>${xap.home}/lib/required/gs-runtime.jar</systemPath>
</dependency>
<dependency>
<groupId>com.my_product.quality</groupId>
<artifactId>DashboardReporter</artifactId>
<version>0.0.1</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apps</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.my_product.quality</groupId>
<artifactId>webuitf</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.my_product.quality</groupId>
<artifactId>wanem</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.my_opensource_product.xenserver</groupId>
<artifactId>xenserver-machine-provisioning</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.swift.common</groupId>
<artifactId>confluence-soap</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.7</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.hyperic</groupId>
<artifactId>sigar</artifactId>
<version>1.6.5</version>
<scope>system</scope>
<systemPath>${xap.home}/lib/platform/sigar/sigar.jar</systemPath>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.10</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/main/java</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExcludes>com.my_product.quality.sgtest.apps.security:processor</classpathDependencyExcludes>
<classpathDependencyExcludes>com.my_product.quality.sgtest.apps.archives:customSecurityProcessor</classpathDependencyExcludes>
<classpathDependencyScopeExclude>runtime</classpathDependencyScopeExclude>
</classpathDependencyExcludes>
<argLine>-Xmx2048m -XX:MaxPermSize=512m</argLine>
<includes>
<include>${includes}</include>
</includes>
<excludes>
<exclude>${excludes}</exclude>
</excludes>
<disableXmlReport>true</disableXmlReport>
<reportsDirectory>${sgtest.summary.dir}</reportsDirectory>
<reportFormat>xml</reportFormat>
<properties>
<property>
<name>configfailurepolicy</name>
<value>continue</value>
</property>
<property>
<name>suitename</name>
<value>${sgtest.suiteName}${sgtest.suiteId}</value>
</property>
<property>
<name>testname</name>
<value>${sgtest.suiteName}${sgtest.suiteId}</value>
</property>
<property>
<name>outputDir</name>
<value>${sgtest.summary.dir}</value>
</property>
<property>
<name>listener</name>
<value>framework.testng.SGTestNGListener,framework.testng.SGTestNgSuiteSplitter,framework.testng.report.TestNgReporterImpl</value>
</property>
</properties>
<systemProperties>
<sgtest.suiteId>${sgtest.suiteId}</sgtest.suiteId>
<sgtest.numOfSuites>${sgtest.numOfSuites}</sgtest.numOfSuites>
<selenium.browser>${selenium.browser}</selenium.browser>
<org.apache.commons.logging.Log>org.apache.commons.logging.impl.Jdk14Logger</org.apache.commons.logging.Log>
<com.gs.logging.level.config>true</com.gs.logging.level.config>
<java.util.logging.config.file>${basedir}/logging/sgtest_logging.properties</java.util.logging.config.file>
<sgtest.buildFolder>${sgtest.buildFolder}</sgtest.buildFolder>
<sgtest.url>http://192.168.9.121:8087/sgtest3.0-xap/</sgtest.url>
<sgtest.disconnect.machines>${sgtest.disconnect.machines}</sgtest.disconnect.machines>
<com.gs.work>${com.gs.work}</com.gs.work>
<com.gs.deploy>${com.gs.deploy}"</com.gs.deploy>
<cppOS>${cppOS}</cppOS>
</systemProperties>
<testFailureIgnore>true</testFailureIgnore>
<detail>true</detail>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I was able to make the exact problem occur by configuring my TestNG launch configuration (within eclipse) incorrectly.
Specifically I specified for it to pass the following as a JVM argument:
-runTestAsTool=true
instead of
-DrunTestAsTool=true
Adding the missing D fixed it for me.
So maybe double-check how your launch configuration is configured.
This issue originates from a problem which occurs when running long Java classpaths on Windows (these exceed the process creation command limit). It had been reported on the Eclipse bug tracking system, and was also discussed here on Stackoverflow.
To work around this on Eclipse Juno releases, we can either bypass the command limit (using the solutions suggested in the above linked post), or apply the patch from the reported bug.
Ivan Sim posted the patching instructions on his coderwall, but I'll include an excerpt for the sake of completeness:
Download bug3271933.4.2hack.zip from the above link
Back up existing eclipse/plugins/org.eclipse.jdt.launching_3.4.*.jar
Copy and paste classes in the patch to org/eclipse/jdt/internal/launching in your org.eclipse.jdt.launching
JAR (replace existing files)
Edit the META-INF /MANIFEST.MF file in your org.eclipse.jdt.launching JAR file by removing everything starting
from the first "NAME:" entry. Make sure you leave two (2) line break
characters at the end of the file.
Re-start eclipse
Please make sure the Sock5 proxy on your Mac OS or Windows is turned off.
It seems TestNG tries to connect to JVM instance via creating socket to 'localhost' and in my /etc/hosts (I use linux) file I renamed localhost to something else so it bombed.
Changed back to localhost and all is good.