Search code examples
javaandroidmavenselendroid

Selendroid enter infinite loop when trying to start session


I was trying to start a tutorial with Selendroid, using maven. But it turns into an infinite loop when parsing the desired capabilities into JSONObjects in io.selendroid.standalone.server.handler.CreateSessionHandler line 43 : return new SelendroidResponse(sessionID, new JSONObject(caps.asMap())).

The issue occurs in new JSONObject(caps.asMap()), it starts mapping objects into JSONObject, but when it comes to an object of type org.openqa.selenium.Platform, it fails to map it and a java.lang.StackOverflowError is thrown.

I tried to reproduce it, so I wrote this single line of code that fails JSONObject obj = new JSONObject(Platform.ANY); , I am not sure if the issue is related to Jackson, selendroid and a manipulation on mine. I wonder if anyone came across this and was able to solve it.

package org.mel.selendroid.base;

import org.json.JSONObject;
import org.openqa.selenium.Platform;

public class Test {
    public static void main(String...strings){
        JSONObject obj = new JSONObject(Platform.ANY);
        System.out.println(obj);
    }
}

Please note that I searched in the Web and stackoverflow, but without luck.

Thanks.


Solution

  • I was able to solve the problem by removing the parent tag in my pom.xml which was referring to spring-boot-starter-parent.

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.6.RELEASE</version>
    </parent>