spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rachana Srivastava <Rachana.Srivast...@markmonitor.com>
Subject Frozen exception while dynamically creating classes inside Spark using JavaAssist API
Date Tue, 03 Nov 2015 18:52:29 GMT
I am trying to dynamically create a new class in Spark using javaassist API. The code seems
very simple just invoking makeClass API on a hardcoded class name. The code works find outside
Spark environment but getting this chedkNotFrozen exception when I am running the code inside
Spark
Code Excerpt:
ClassPool pool = ClassPool.getDefault()
CtClass regExClass= pool.makeClass("TestClass14",baseFeatureProcessor)
Exception Details:
###################### Exception make Class
java.lang.RuntimeException: TestClass14: frozen class (cannot edit)
    at javassist.ClassPool.checkNotFrozen(ClassPool.java:617)
    at javassist.ClassPool.makeClass(ClassPool.java:859)


Mime
View raw message