Agustin Scalisi February 2016

codename one error java.lang.NoSuchMethodError: javafx.scene.web.WebEngine.setUserDataDirectory(Ljava/io/File;)V

I receive this error when I run my CN1 project

java.lang.NoSuchMethodError: javafx.scene.web.WebEngine.setUserDataDirectory(Ljava/io/File;)V

I use a sidebar menu, but the error is on the main screen This is my SateMachine.java

  @Override
protected void beforePortada(Form f) {
  WebBrowser browser=new WebBrowser();
    f.setLayout(new BorderLayout());
    f.addComponent(BorderLayout.CENTER, browser);


    String URL= "someurl.php";

    String ssurhtml = "somehtml";

    ConnectionRequest req = new ConnectionRequest();
    req.setUrl(URL);
    NetworkManager.getInstance().addToQueueAndWait(req);
    byte[] data = req.getResponseData();
    if (data == null) {
        //throw new IOException("Network Error, try again later.");
    }
    //JSONParser parser = new JSONParser();
    // Map response = parser.parseJSON(new InputStreamReader(new ByteArrayInputStream(data), "UTF-8"));


    XMLParser xmlParser=new XMLParser();
    Element element= null;
    try {
        element = xmlParser.parse(new InputStreamReader(new ByteArrayInputStream(data), "ISO8859-1"));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    Element element1=element.getElementById("somediv");
    String test= String.valueOf(element1);

    char c= '\'';
    char r= ' ';

    test=test.replace(c,r);
    test=(ssurhtml+test+"</body></html>");
    browser.setPage(test,null);
}

I receive the error message, and the simulator show a black screen

Answers


Shai Almog February 2016

There is a regression in the current simulator that requires Java 8. Try upgrading to Java 8 to workaround it.

Post Status

Asked in February 2016
Viewed 3,858 times
Voted 7
Answered 1 times

Search




Leave an answer