Null pointer exception in Ignition.start - ignite

When starting an Apache Ignite client (Ignite version 2.3.0, connecting to the (single) cluster node seems to work at first. But then I get the following exception
Jan 04, 2018 5:18:23 PM org.apache.ignite.logger.java.JavaLogger error
SEVERE: Failed to process custom exchange task: ClientCacheChangeDummyDiscoveryMessage [reqId=c1d6d9fd-a2be-4826-9459-05912ad1f5a5, cachesToClose=null, startCaches=[risfahrt_v5_matched_intern_partitioned_by_fahrtid]]
java.lang.NullPointerException
at org.apache.ignite.internal.processors.cache.CacheGroupContext.<init>(CacheGroupContext.java:191)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCacheGroup(GridCacheProcessor.java:1850)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1792)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processClientCacheStartRequests(CacheAffinitySharedManager.java:428)
at org.apache.ignite.internal.processors.cache.CacheAffinitySharedManager.processClientCachesChanges(CacheAffinitySharedManager.java:611)
at org.apache.ignite.internal.processors.cache.GridCacheProcessor.processCustomExchangeTask(GridCacheProcessor.java:338)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.processCustomTask(GridCachePartitionExchangeManager.java:2142)
at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2231)
at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at java.lang.Thread.run(Thread.java:745)
Ignite client is started as follows:
IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
igniteConfiguration.setClientMode(clientMode);
TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(servers);
tcpDiscoverySpi.setIpFinder(ipFinder);
igniteConfiguration.setDiscoverySpi(tcpDiscoverySpi);
Ignite ignite = Ignition.start(igniteConfiguration);
The cache is configured as follows:
CacheConfiguration<String, V> cacheConfiguration = new CacheConfiguration<>();
cacheConfiguration.setName(cacheName);
cacheConfiguration.setCacheMode(CacheMode.PARTITIONED);
NearCacheConfiguration<String, V> nearCacheConfiguration = new NearCacheConfiguration<>();
nearCacheConfiguration.setNearEvictionPolicy(new LruEvictionPolicy<>(nearCacheSize));
IgniteCache<String, V> cache = ignite.getOrCreateCache(cacheConfiguration, nearCacheConfiguration);

The solution was to avoid underscores ("_") in the cache name. After doing so, everything worked without problems.

Related

How to Configure the Ports for Communication between Selenium Server and the Browsers

I'm using Selenium Standalone Server 3.141.59 https://www.seleniumhq.org/download
In my code, when a WebDriver is created the Selenium server debugs something like: Starting ChromeDriver on port 28208
Is it possible to configure a range of ports (e.g., 28000-28100) that are allowed to be used by the Selenium server?
Use below code to configure chrome to run on other then default port.
int desiredPortNo = 22300;
ChromeDriverService service = new ChromeDriverService.Builder().usingDriverExecutable(new File("chrome_driver_path")).usingPort(desiredPortNo).build();
WebDriver driver = new ChromeDriver(service);
Update
To use with RemoteWebDriver :
int desiredPortNo = 22300;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("...", true);
ChromeDriverService service = new ChromeDriverService.Builder()
.usingDriverExecutable(new File("driver_path")).usingPort(desiredPortNo)
.build();
service.start();
WebDriver driver = new RemoteWebDriver(service.getUrl(),capabilities);
driver.get("site_url");

Unable to run selenium web driver project for 3.8.1 version

Unable to run web driver 3.8.1 geckodriver 0.19.1 with guava 21 and 22 .
Firefox version 58.0.2 (64-bit)
getting error as :
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
running on iMac
System.setProperty("webdriver.gecko.driver", "//Users//(username)//Downloads//engage-test//engage-test-common//exes//geckodriver");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
driver= new FirefoxDriver(capabilities);
The error says it all :
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
Class NoSuchMethodError
public class NoSuchMethodError extends IncompatibleClassChangeError and as per the Java Docs it is thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method. Normally, this error is caught by the compiler and this error can only occur at run time if the definition of a class has incompatibly changed.
Solution
Perform the following steps :
When providing absolute paths either use double back slashes (\\) or single front slashes (/). Both are equivalent. So you need to update the System.setProperty() as follows :
System.setProperty("webdriver.gecko.driver", "/Users/<username>/Downloads/engage-test/engage-test-common/exes/geckodriver"); //Linux Style
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
Update your JDK to the most recent versions JDK 8u161
Upgrade Selenium-Java Clients to v3.10.0.
Clean up the Project Space from your IDE.
Run CCleaner tool to wipe off all the OS system chores.
If your base Web Browser version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of the Web Browser.
Take a System Reboot.
Execute your #Test
Update
As you are using Selenium-Java Client 3.11.0 where support of DesiredCapabilities is deprecated from the list of constructors for FirefoxDriver Class you have to use the method merge(Capabilities extraCapabilities) and merge the capabilities into an FirefoxOptions Class object as follows :
package demo;
import java.util.logging.Level;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
public class A_Firefox_DC_Opt
{
public static void main(String[] args)
{
System.setProperty("webdriver.gecko.driver", "C:/Utility/BrowserDrivers/geckodriver.exe");
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability("marionatte", true);
FirefoxOptions opt = new FirefoxOptions();
opt.merge(dc);
FirefoxDriver driver = new FirefoxDriver(opt);
driver.get("https://stackoverflow.com");
System.out.println("Application opened");
System.out.println("Page Title is : "+driver.getTitle());
driver.quit();
}
}
Console Output :
1522037759633 geckodriver INFO geckodriver 0.20.0
1522037759653 geckodriver INFO Listening on 127.0.0.1:20073
1522037760415 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\ATECHM~1\\AppData\\Local\\Temp\\rust_mozprofile.hRnaFvWiVBua"
1522037762202 Marionette INFO Enabled via --marionette
1522037765376 Marionette INFO Listening on port 1176
1522037765636 Marionette WARN TLS certificate errors will be ignored for this session
Mar 26, 2018 9:46:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Application opened
Page Title is : Stack Overflow - Where Developers Learn, Share, & Build Careers

Apache Ignite: start both client and server nodes in the same JVM

Is it possible to start both client and server nodes in the same JVM?
Yes, you can start several nodes within one JVM. You only need to make sure that IgniteConfiguration.getGridName() property is unique for each node. Here is the example:
public static void main(String[] args) {
Ignite server = startNode("server-node");
Ignite client = startNode("client-node");
...
}
private static Ignite startNode(String name) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridName(name);
return Ignition.start(cfg);
}

ConnectionNotFoundException occur when open https connection in CerEm J.V.M

I have a web site "some.website.com" that is listening to port 80(http) and port 443(https). When I execute following code in CrE-ME™ v4.12 jvm:
HttpConnection conn = (HttpConnection) Connector.open("http://www.example.com/");
My Program works correctly without any issue. When I execute following code in CrE-ME™ v4.12 jvm:
HttpConnection conn = (HttpConnection) Connector.open("https://www.example.com/");
I am getting ConnectionNotFoundException : The requested protocol does not exist
When I execute following code in Java Web Start:
URL url = new URL("http://www.example.com/");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
or
URL url = new URL("https://www.example.com/");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
I don't get any problem.
Please help me to solve this https issue in CrE-ME™ v4.12 jvm.
The solution of this problem is very simple. Use URL to open connection instead of Connector. Same coding as Java Web Start.
URL url = new URL("https://www.example.com/");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

Exception on Selenium Grid program

Have started the hub and registered the node. Then wrote a program in eclipse:
after running the program i am getting below exception:-
Exception in thread "main" java. lang.Class Cast Exception: java.lang.String cannot be cast to java.util.Map.
the remote web driver is :
Remote Web Driver driver = new Remote Web Driver(client URL,capability);
I've had the same error. The problem was in class org.openqa.selenium.remote.RemoteWebDriver (75):
Map<String, Object> rawCapabilities = (Map<String, Object>) response.getValue();
It's happened because I've given the wrong URL parameter for RemoteWebDriver():
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/"), capability);
That's why response had a String type.
Please check your url. It should be:
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
I hope it will help you :)