[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamically Generated Classes - Cannot load user class

Thinking out loud here:

I can't tell where the class load is failing.
The general model I've used with ByteBuddy in this scenario is very similar
to yours.
I subclass my superclass using ByteBuddy.
I inject the new class into a JAR that will be shared by the task managers.
I subclass the Flink classes such as RichMapFunction so that the template
parameters are accepted.
I would have to be careful in my subclassed functions to not instantiate
members that could not serialize.
This, too, gets injected into the JAR.
I would then instantiate all the classes and send them to the task managers.
The trick to getting the classes to load on the task manager was to make
sure all the JARs that they needed to reference were available. This would
include my temporary JAR containing ByteBuddy classes as well as any JARs
that weren't automatically distributed by Flink to the task managers, but
which were otherwise needed.

It's not clear from your note whether in dropping SQL your ByteBuddy
functions are getting called.
The last stack trace you produced indicates a problem other than finding or
loading bytebuddy objects.
Can you get the job to run without using Streams (ie, use Batch)?
Can you get the job to run without using ByteBuddy (ie, just execute the
SQL. Then use a hard-coded POJO. Then try adding bytebuddy.

Sent from: