Updated Katalon Studio to version 5.9.1 - ClassNotFoundException - java

After updating Katalon Studio to 5.9.1, we occasionally get java.lang.ClassNotFoundException: cz.elektLabs.Keywords on our custom keyword class while running tests in Jenkins.
What is weird is that it doesn't happen every time and we are not able to reproduce it. It worked before in 5.7.
Here is beginning of our custom keyword class:
package cz.elektLabs
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import org.openqa.selenium.By
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.util.KeywordUtil
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import groovy.json.JsonSlurper
import groovy.time.TimeCategory
import internal.GlobalVariable
class Keywords {
#Keyword
def boolean checkIfValidImage(String url) {
...
}
...
}
And here is the error we get:
2018-12-14 09:18:53.987 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ? cz.elektLabs.Keywords
2018-12-14 09:18:53.988 ERROR c.k.katalon.core.main.TestCaseExecutor - ? cz.elektLabs.Keywords.openAndLogin() FAILED.
Reason:
java.lang.ClassNotFoundException: cz.elektLabs.Keywords
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)
at TestSystem.run(TestSystem:17)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:321)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:312)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:291)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:283)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:222)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1544775530390.run(TempTestSuite1544775530390.groovy:36)
Is there anything we could do to fix this issue?
edit: We updated Katalon Studio to version 5.10.1 and we are still getting ClassNotFoundException or NoClassDefFoundError every now and then.

Please make sure you have installed Open JDK 1.8 on the machine.

Related

lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html' import 'dart:html' as html;

I got this error when I was launching my app in the emulator does anybody know whats wrong sorry I am kind of new to android studio
lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
But I did everything correctly it's RIGHT THERE
import 'dart:async';
import 'dart:io' as io;
import 'package:file/file.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:telegramchatapp/Widgets/FullImageWidget.dart';
import 'package:telegramchatapp/Widgets/ProgressWidget.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:html' as html;
You can not import dart:html in app for mobile (android or iOS). Remove it.
If you want use it for web application, you can use conditional import explained here.

Eclipse cannot find JavaFX 11 Legend type

I'm trying to get some java 1.8 code working in Java 11. I've hit what seems to be a common wall, but none of the answers I've found are working.
System: Fedora 33 5.9.8-200.fc33.x86_64
Eclipse Version: 2020-09 (4.17.0) Build id: 20200910-1200
JDK: java-11-openjdk-11.0.9.11-0.fc33.x86_64
JavaFX: OpenFX javafx-sdk-11.0.2
Here's the bit of code that's blocking me.
class MyPie extends PieChart {
public Legend legend;
public MyPie() {
super();
legend = (Legend) getLegend();
}
}
The error is: "Legend cannot be resolved to a type" When I ask Eclipse to auto-generate an import statement, or use the suggestion, it put in this line:
import com.sun.javafx.charts.Legend;
This is a problem, because that doesn't seem to exist and doesn't follow the same pattern as the other JavaFX imports:
import javafx.scene.chart.PieChart;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextField;
I have a second one "com.sun.javafx.css.StyleManager" which I'm guessing will have the same solution.
What am I missing here?
Thanks.

UnsatisfiedLinkError when calling new World()

My error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: org.jbox2d.common.Timer.now()D
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:130)
Caused by: java.lang.UnsatisfiedLinkError: org.jbox2d.common.Timer.now()D
at org.jbox2d.common.Timer.now(Native Method)
at org.jbox2d.common.Timer.reset(Timer.java:35)
at org.jbox2d.common.Timer.<init>(Timer.java:31)
at org.jbox2d.dynamics.World.<init>(World.java:587)
at org.jbox2d.dynamics.World.<init>(World.java:158)
at org.jbox2d.dynamics.World.<init>(World.java:154)
at org.jbox2d.dynamics.World.<init>(World.java:145)
at com.badlogic.gdx.physics.box2d.World.<init>(World.java:61)
at com.example.blockbunny.states.Play.<init>(Play.java:22)
at com.example.blockbunny.handlers.GameStateManager.getState(GameStateManager.java:36)
at com.example.blockbunny.handlers.GameStateManager.pushState(GameStateManager.java:46)
at com.example.blockbunny.handlers.GameStateManager.<init>(GameStateManager.java:20)
at com.example.blockbunny.main.Game.create(Game.java:33)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:146)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:123)
And this occurs when I do this:
world = new World(new Vector2(0, -9.81f), true);
I have looked online, and some solutions included using this:
import com.badlogic.gdx.utils.GdxNativesLoader;
GdxNativesLoader.load();
However, I don't know where to put this function, and if it even works (I tried putting it in several different places)
How can I fix this issue?
Help will be appreciated, thanks!
As requested, here are my imports:
import static com.example.blockbunny.handlers.B2DVars.PPM;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.example.blockbunny.handlers.GameStateManager;
import com.example.blockbunny.main.Game;
I used Box2d several time with libgdx and i never encountered such a problem :
here what i propose t you :
GdxNativesLoader.load();
should be put on the create() method, but that doesn't seem to work with you
also try call it in a static way like this :
static {
GdxNativesLoader.load();
}
but i thin your problem is the extension of the library that you are using
verify that you are using gdx-box2d and not gdx-box2d-gwt which is used only for Html project
Verify that you are using the right (jar file) /(extension library) : gdx-box2d.jar and gdx-box2d-natives.jar (also verify the build path)
also try :
upgrade the box2d version that you're using
those were all the arrows i had ! hope one of it will work
Good luck !!
I came across the same issue, was using the gwt libraries. Updated the Maven dependency artifact from
gdx-box2d-gwt
to
gdx-box2d
and it fixed the error.

com.badlogic.gdx.backends.android.AndroidLiveWallpaper import is Erroring

When i import this
libgdx class com.badlogic.gdx.backends.android.AndroidLiveWallpaper
I get the following error:
com.badlogic.gdx.backends.android.AndroidLiveWallpaper is not visible.
What causes and how can I solve it?

How to solve Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE?

I'm trying to upload a file using Selenium web driver. Above error receive. I know code is ok. Most of post saying it is because "dependencies". How can I solve it? I checked there was no same name jar files. Here I have show some screen shot of my jar files. How can I solve this dependencies problem?
Java code:
import java.io.File;
import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
public class FusekiStart {
public static void main(String[] args) {
/* Selenium config */
String PROXY = "localhost:3030";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
.setFtpProxy(PROXY)
.setSslProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new FirefoxDriver(cap);
driver.get("http://localhost:3030/control-panel.tpl");
driver.findElement(By.xpath("//input[#value='Select']")).click();
driver.findElement(By.xpath("//input[#type='file']")).sendKeys("C:\\Users\\user1\\Desktop\\Ontology.owl");
driver.findElement(By.xpath("//input[#value='Upload']")).click();
}
}
Error message:
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init> (DefaultHttpRequestWriterFactory.java:52)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:72)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:84)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:59)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:487)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:147)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:136)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:112)
at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:68)
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:55)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:99)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:93)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104)
at uom.brts.statisticalmt.FusekiStart.main(FusekiStart.java:39)
Check this link:
Source Code at Grep
You are missing BasicLineFormatter class from org.apache.http.message package.
I would say not this will fix your problem but can you see by including a httpcore 4.2.2 jar file is what your are using currently. Can you try to get the higher one from the Link and replace it with current httpcore 4.2.2 and see what difference it makes ?
I faced the same problem. After a lot of debugging, I found out that there is a CLASSPATH conflict. A jar file already existing in the project
httpclient-osgi-4.2.1.jar
was conflicting with selenium jar files. Fortunately for me, the httpclient-osgi-4.2.1.jar file is not required in the project anymore, so I could safely remove it. After that the problem is gone.
The error message is pathetic. It doesn't help in any way to point out the real problem.

Categories