Error while executing the scripts using Karate Framework when integrated with QMetry - qaf

I am getting below error while executing the scripts in Karate Framework.I have integrated QMetry with this Karate Framework. Followed this link to integrate with QMetry.
http://www.qmetry.com/resources/videos/qmetry-test-manager-for-jira-test-automation-training/
java.lang.NoSuchMethodError: org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:182)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:164)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:971)
at com.intuit.karate.http.apache.ApacheHttpClient.makeHttpRequest(ApacheHttpClient.java:302)
at com.intuit.karate.http.apache.ApacheHttpClient.makeHttpRequest(ApacheHttpClient.java:82)
at com.intuit.karate.http.HttpClient.invoke(HttpClient.java:207)
at com.intuit.karate.StepDefs.method(StepDefs.java:312)
at ✽.When method get(MyService/GetService.feature:8)
java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.empty()Lcom/fasterxml/jackson/annotation/JsonFormat$Value;
at com.fasterxml.jackson.databind.cfg.MapperConfig.<clinit>(MapperConfig.java:49)
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:558)
at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:474)
at com.infostretch.qmetrytestmanager.helper.ResultUploadHelper.uploadResultToServer(ResultUploadHelper.java:70)
at com.infostretch.qmetrytestmanager.result.TestExecution.close(TestExecution.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:294)
at com.sun.proxy.$Proxy7.close(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.close(JUnitReporter.java:232)
at com.intuit.karate.junit4.Karate.run(Karate.java:68)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

If your use case is to upload Karate test results to QMetry Test Management, it's possible. Karate results are similar to Cucumber (BDD) framework and generally the automation test results files could be generated in .json format. QMetry Test Management for Jira (QTM4J) has inbuilt support for Cucumber automation file uploads (supports json format), the test cases, test executions and execution results shall be automatically imported to the QMetry products. You can refer the following resources for uploading the test results to QMetry.
For QMetry Test Management for Jira
Upload Automation Test Results to QTM4J using Automation API
Upload Cucumber Framework Test Results to QTM4J
Note - Mostly, the .json results shall be directly uploaded to QMetry. Incase if the result file format do not match the supported format of QMetry, you can write a translator that can convert your results into a QMetry supported format and upload it OR you can take help from QMetry Support - qmetryforjira#qmetrysupport.atlassian.net to create a translator for you. Based on my experience the QMetry support team is very responsive and resourceful.

Related

Grails error-messages if I run the web app with tomcat 9

I'm updating a fairly large web app from Grails 2 to Grails 5. We are using the Shiro plugin (and others) and Java 11.
If I run the packaged war file under a tomcat-9 installation (currently with FreeBSD as the host os) I get the following errors:
org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static
singleton. This is an invalid application configuration.
at org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
at org.apache.shiro.subject.Subject$Builder.<init>(Subject.java:626)
at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
at org.apache.shiro.grails.AccessControl.accessControlMethod(AccessControl.groovy:35)
at org.apache.shiro.grails.AccessControl.accessControlMethod(AccessControl.groovy)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:44)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:89)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:157)
at shiro.ShiroGrailsPlugin$_doWithDynamicMethods_closure3.doCall(ShiroGrailsPlugin.groovy:253)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
etc.
But the app seems to work fine, if I'm not logged in, I'm redirected to the login page and afterwards to the pages of the app. Haven't tested with different permissions, but at first sight, it looks ok.
If I run it with "java -jar myApp.war", I don't have these error-messages.
The java-version for tomcat and the standalone start is the same.
Should be something with dependencies I think...
I cannot speak for the Grails side of things, but from a Shiro perspective:
It looks like you have a request that is being processed outside the scope of Shiro (i.e. either a request that is NOT behind the ShiroFilter), or you have a background or initialization thread calling a protected method (the stacktrace looks trimmed so it's hard to say)
If it's the former, the fix is to make sure all your requests go through the ShiroFilter (or equivalent Grails config), this will make sure a SecurityManager is bound to the request thread.
If it's the latter, take a look at: https://shiro.apache.org/static/1.9.1/apidocs/org/apache/shiro/web/servlet/AbstractShiroFilter.html
(this is often used for background threads running on behalf of a user)

Dataflow with Go SDK failing with 'InvalidProtocolBufferException'

We were previously running Beam 2.11.0 which started failing due to an apparent change in URN format. When I attempted to update and use the latest release (2.13.0) the pipeline started timing out, and the only seemingly relevant error that I could identify from the logs during testing was:
org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length.
To further test this, I attempted to use the wordcount example as provided in the Beam docs/repo here - https://beam.apache.org/get-started/wordcount-example/ - But I got the same result. I'm not sure if this is a generic error or something to do with Dataflow. The pipelines seem to work when running via direct runner.
Note: I have rebuilt our worker_harness_container_image with the latest version.
I understand the Go SDK is not officially supported by Dataflow, but could anybody tell me if the error is something related to Dataflow or some other issue?
PS: I've asked the question in Dataflow and Beam Slack channels but haven't had any response.

Java Web start printing job

I posted about the same problem before but got no answer. I am re-posting because I think its a simple problem that someone must have came across recently.
I have a JavaFX application that makes use of the awt.PrinterJob to print some Printable information. while on development everything works fine but when I sign the application and deploy it via Web Start clicking the same button to print the data just throws a Null pointer exception below:
Caused by: java.lang.NullPointerException
at javax.print.PrintServiceLookup.getServicesForContext(Unknown Source)
at javax.print.PrintServiceLookup.getListOfLookupServices(Unknown Source)
at javax.print.PrintServiceLookup.getAllLookupServices(Unknown Source)
at javax.print.PrintServiceLookup.lookupDefaultPrintService(Unknown Source)
at sun.print.Win32PrintServiceLookup.getWin32PrintLUS(Unknown Source)
at sun.awt.windows.WPrinterJob.getPrintService(Unknown Source)
at sun.print.RasterPrinterJob.setPrintable(Unknown Source)
at AdvancedSearchDetailedResultsTableViewController.printToImage(AdvancedSearchDetai..
I have another Java Swing app that I deploy the same way and its using the PrintJob with no issues. I thought that it could be something to do with JavaFX and awt but it works locally which made me think that it must have something to do with WebStart accessing printing services. I looked at JNLP API Printservices with no results.
Previous post link https://stackoverflow.com/questions/17403727/java-web-start-printerjob
Any ideas or workarounds would be much appreciated.
Thanks
Updating from Java 7u21 to 7u25 caused a similar problem in my JavaFX Web Start app, but I do not know the cause of the error yet. May be a permissions issue (see JDK 7u25 and JavaFX 2.2.25 Documentation Updates) or maybe a bug? Test your app with Java 7 update 21!

Cobertura not analysing the project in grails

I'm using grails 1.3.7.I installed code-coverage plugin.And placed the cobertura 1.9.4.jar and asm2.2.3.jar in project lib folder in STS workspace.Running using grails test-app -coverage command.When i'm doing this it runs the whole Junit test casses as well it generate the report in Cobertura folder in target.But in generated HTML code it showing Zero classes and all others are zero.
In console at last it displays 0 classes loading and 0 classes saving like this after running the test casses.
As well I tried in BuildConfig.groovy to add,
coverage { sourceInclusions = ['grails-app/target*'] }
It's not resolving the path
So how can i solve this problem to get correct cobertura report..??
While i'm running using the above mentioned command will the code-coverage (cobertura) automatically instrument the classes or mannually we have to say..??
I go through the cobertura instrumentation ref via comment lines document..in that they used cobertura-instrumented.bat --destination ... if use these comments cobertura-instrumented.bat is not internal or external command like this error is comming..
How to correct this and make this plugin work correct to get correct result rather than 0%..??
Thanks..
Make sure your app is not running at the same time you are running the test suite. Cobertura needs to instrument your compiled code and if the app is running it can interfere with that.
Code-Coverage correctly shows the output after i changed the lib jars as asm2.2.1 to asm3.1 as well asm-util.jar and oro.jar was added on it.

Why JSF throw OutOfMemoryError in Tomcat 7?

I have a fresh and clean Tomcat7 ready in my Windows machine, when I remove the JSF jars (jsf-api-2.0.1.jar and jsp-impl-2.0.1.jar) from WEB-INF/lib, I hit this error:
Caused by: java.lang.ClassNotFoundException: javax.faces.FacesException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
... 10 more
When I put the 2 jars in WEB-INF/lib, I hit error:
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1956)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1919)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1806)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1765)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1751)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1255)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:882)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Any clue on running JSF in Tomcat 7?
You haven't indicated if the error occurs instantly on deploy or after a while. If it occurs after a while, i.e. during your application run, your code will be to blame. Look at this excellent article that will help you use JDK 6 track down the source of the error.
A PermGen error is indicative of classloading issues pertaining to your application container.The Permanent Generation (PermGen for short) is the area where the JVM stores objects such as classes and string literals. Normally, the garbage collector is not supposed to operate frequently here. Classes loaded by the app server should be automatically cleaned up once the classloader for the web application (there is one per deployed webapp) is no longer being used. Tomcat has given me problems in this area in the past (especially when used within Netbeans). It seems to not be able to clean up after itself effectively after repeated redeploys. There are a handful of things you could do apart from increasing the size of the permgen space
1) You could move the common jars for the web applications running in that tomcat instance into the TOMCAT_HOME/lib. This way, you can expect your class libraries to not be loaded multiple times per requiring web application as is the default behaviour for tomcat(see this). Use this option with care however; if you eventually deploy a web application containing newer versions of the jar, you might run into NoClassDefFound errors.
2)You can try this -XX:MaxPermGen instead of (or in addition to) the -XX:MaxPermSize that mkyong suggested in his article.
Also take a look at this question and it's answers for further steps

Resources