Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlUtils is using deprecated jsoup method #8929

Closed
mkreidenweis opened this issue Sep 1, 2020 · 0 comments · Fixed by #8938
Closed

HtmlUtils is using deprecated jsoup method #8929

mkreidenweis opened this issue Sep 1, 2020 · 0 comments · Fixed by #8938

Comments

@mkreidenweis
Copy link

Description of the bug

We were trying to use Vaadin 14.3.3 TestBench test together with io.github.bonigarcia webdrivermanager version 4.2.0, which depends on jsoup 1.13.1. This causes an exception during Vaadin component initialization because flow-server is using a deprecated jsoup method, which has been removed in jsoup 1.13.1

Has been deprecated since version 1.11.1: jhy/jsoup@f71712b#diff-e8dacc63f3cfadcc7f860888bbb32e56R30

Fix should be easy: Just remove the deprecated null argument from https://github.com/vaadin/flow/blob/master/flow-server/src/main/java/com/vaadin/flow/internal/HtmlUtils.java#L41
(Preferrably also for older Vaadin/Flow versions.)

Minimal reproducible example

Run a Vaadin TestBench test in a maven project with this dependency:

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>4.2.0</version>
        </dependency>

Expected behavior

It should just work like without the webdrivermanager dependency. :-)

Actual behavior

Getting this exception:

java.lang.NoSuchMethodError: 'void org.jsoup.nodes.TextNode.<init>(java.lang.String, java.lang.String)'
	at com.vaadin.flow.internal.HtmlUtils.escape(HtmlUtils.java:41)
	at com.vaadin.flow.component.grid.AbstractColumn.setHeaderText(AbstractColumn.java:170)
	at com.vaadin.flow.component.grid.HeaderRow$HeaderCell.<init>(HeaderRow.java:50)
...

Workaround

Exclude jsoup from webdrivermanager dependency:

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>4.2.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jsoup</groupId>
                    <artifactId>jsoup</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Versions:

- Vaadin / Flow version: 14.3.3 / 2.3.3
- Java version: 11
- OS version: Linux/Windows
@caalador caalador self-assigned this Sep 3, 2020
caalador added a commit that referenced this issue Sep 3, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from WIP to Closed Sep 3, 2020
pleku pushed a commit that referenced this issue Sep 3, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
pleku pushed a commit that referenced this issue Sep 7, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
pleku pushed a commit that referenced this issue Sep 7, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
haijian-vaadin pushed a commit that referenced this issue Sep 7, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
pleku pushed a commit that referenced this issue Sep 7, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
caalador added a commit that referenced this issue Sep 7, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
mshabarov pushed a commit that referenced this issue Sep 17, 2020
Stop using the method that was deprecated in 1.11.1

Closes #8929
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants