0

I am running Jakarta Bean Validation 6.1.2 under Apache Flink and running into the included "Caused by: java.io.NotSerializableException: com.sun.el.ExpressionFactoryImpl" error.

Here are the gradle deps:

  compile 'org.hibernate.validator:hibernate-validator:6.1.2.Final'
  compile 'org.glassfish:jakarta.el:3.0.3'
  compile 'org.apache.flink:flink-java:1.10.0'
  compile 'org.apache.flink:flink-streaming-java_2.12:1.10.0'
  compile 'org.apache.flink:flink-clients_2.12:1.10.0'
  compile 'org.apache.flink:flink-connector-kafka-base_2.12:1.10.0'
  compile 'org.apache.flink:flink-connector-kafka-0.10_2.12:1.10.0'

Thoughts?

thx in advance,

  • james
    org.apache.flink.api.common.InvalidProgramException: 
    com.sun.el.ExpressionFactoryImpl@7ca33c24 is not serializable. The object probably contains 
or references non serializable fields.
      at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:151)
      at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
      at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
      at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
      at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:126)
      at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:71)
      at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.clean(StreamExecutionEnvironment.java:1821)
      at org.apache.flink.streaming.api.datastream.DataStream.clean(DataStream.java:188)
      at org.apache.flink.streaming.api.datastream.DataStream.map(DataStream.java:590)
      at com.lacuna.data.mds.EventProcessor.main(EventProcessor.java:49)
    Caused by: java.io.NotSerializableException: com.sun.el.ExpressionFactoryImpl
      at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1185)
      at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349)
    WARNING: An illegal reflective access operation has occurred
James Todd
  • 21
  • 4
  • For a class to be serializable it must implement the Serializable interface in its source file and here those fileds clearly don't so unless u can change the definition of those jdk class files ur out of luck. – Sync it Apr 02 '20 at 03:36
  • agreed @RVISHAL ... thing is, i have to believe others have run into this situation as java-beans is quite popular and in this case i'm using it in a distributed application environment. i wonder if i am not importing the right impl provider jars? – James Todd Apr 02 '20 at 05:28
  • Right Or Wrong jars you really cant say. Maybe the developers don't want these classes to be serializable and maybe they intend it to stay that way in the later versions as well. Try finding out what classes need to be written to files and what dosent. – Sync it Apr 02 '20 at 06:37

0 Answers0