Menu

#1200 HtmlUnit is *NOT* serializable/transient

2.8
closed
RBRi
None
7
2012-10-21
2010-11-05
No

Background JS executor not serializable.

Code:

    WebClient client = new WebClient();     
    try {           
        Page page = client.getPage("http://www.google.com");            
        FileOutputStream fos = new FileOutputStream("object" + ".ser");
        ObjectOutputStream out = new ObjectOutputStream(fos);

        out.writeObject(page);
        out.close();            
    } catch (FailingHttpStatusCodeException e) {            
        e.printStackTrace();
    } catch (MalformedURLException e) {         
        e.printStackTrace();
    } catch (IOException e) {           
        e.printStackTrace();
    }

Discussion

  • knobenheimer

    knobenheimer - 2010-11-05
     
  • RBRi

    RBRi - 2011-02-09

    Now fixed in SVN. Thanks for reporting.

     
  • RBRi

    RBRi - 2011-02-09

    Hopefully finally fixed. Please keep in mind, that the page itself is serialized, but all outstanding javascript jobs are ignored during serialization.

     

Log in to post a comment.