Skip to content

[BUG] IllegalAccessError when serializing on JPMS since 2.0.61: ObjectWriterProvider cannot access org.w3c.dom.Node #7672

Description

@clausnagel

We are seeing a regression starting with fastjson2 2.0.61 when using the library as a Java module (JPMS).

The following exception is thrown during serialization:

Exception in thread "main" java.lang.IllegalAccessError:
class com.alibaba.fastjson2.writer.ObjectWriterProvider (in module com.alibaba.fastjson2)
cannot access class org.w3c.dom.Node (in module java.xml)
because module com.alibaba.fastjson2 does not read module java.xml

The issue does not occur with 2.0.60. It first appears in 2.0.61. It looks like a new reference to org.w3c.dom.Node was introduced without adding

requires java.xml;

to the module descriptor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions