Smooks failed to filter source - java.lang.NoSuchMethodError: sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class

Smooks failed to filter source - java.lang.NoSuchMethodError: sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class

我对 EDIFACT/D96A 比较陌生。我正在尝试使用 D96AInterchangeFactory 从 edi 进行转换。

这是我所拥有的:

D96AInterchangeFactory factory = D96AInterchangeFactory.getInstance();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(ediContent.getBytes());
UNEdifactInterchange interchange = factory.fromUNEdifact(byteArrayInputStream);

我收到以下错误:

 org.milyn.SmooksException: Failed to filter source.
    at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
    at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
    at org.milyn.Smooks._filter(Smooks.java:526)
    at org.milyn.Smooks.filterSource(Smooks.java:482)
    at .
    .
    .

org.milyn.smooks.edi.unedifact.UNEdifactReader.parse(UNEdifactReader.java:75)
    at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:76)
    at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
    ... 22 more
    Caused by: java.lang.NoSuchMethodError: sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class;
    at
    . .
    org.milyn.javabean.BeanInstanceCreator.createAndSetBean(BeanInstanceCreator.java:296)
        at org.milyn.javabean.BeanInstanceCreator.visitBefore(BeanInstanceCreator.java:241)
        at org.milyn.delivery.sax.SAXHandler.visitBefore(SAXHandler.java:307)
        ... 40 more

我阅读并在 d96a 中为 mvel2 和版本 2.2 添加了依赖项。0.Final。仍然弹出相同的错误。

使用 JAVA 8 我可能做错了什么? 提前致谢。

我使用 mvel2 2.3 修复了同样的错误。1.Final。

将 mylin 依赖项从 1.6 提升到 1.7.0 现在工作