AnyLogic模型升级至8.8.2后无法运行,请求故障定位分析
AnyLogic 8.8.2升级后模型运行故障分析
故障背景
模型在AnyLogic 8.8.1版本可正常运行,升级至8.8.2版本后无法启动,报错信息如下:
Error during model creation: class [Lcom.anylogic.engine.presentation.ModelElementDescriptorUtils; cannot be cast to class [Lcom.anylogic.engine.presentation.ModelElementDescriptor; ([Lcom.anylogic.engine.presentation.ModelElementDescriptorUtils; and [Lcom.anylogic.engine.presentation.ModelElementDescriptor; are in unnamed module of loader 'app') java.lang.ClassCastException: class [Lcom.anylogic.engine.presentation.ModelElementDescriptorUtils; cannot be cast to class [Lcom.anylogic.engine.presentation.ModelElementDescriptor; ([Lcom.anylogic.engine.presentation.ModelElementDescriptorUtils; and [Lcom.anylogic.engine.presentation.ModelElementDescriptor; are in unnamed module of loader 'app') at com.anylogic.libraries.pypeline.PyCommunicator.doCreate(PyCommunicator.java:2165) at com.anylogic.engine.Agent.createAsEmbedded(Unknown Source) at combined.Main.doCreate(Main.java:6779) at com.anylogic.engine.Agent.createAsEmbedded(Unknown Source) at com.anylogic.engine.Agent.create(Unknown Source) at com.anylogic.engine.Engine.start(Unknown Source) at com.anylogic.engine.ExperimentSimulation.j(Unknown Source) at com.anylogic.engine.ExperimentSimulation.run(Unknown Source) at com.anylogic.engine.ExperimentSimulation.n(Unknown Source) at com.anylogic.engine.internal.f$f.run(Unknown Source) Error during drawing animation frame: java.lang.NullPointerException at com.anylogic.libraries.processmodeling.RackSystem.reserved(Unknown Source) at com.anylogic.libraries.processmodeling.RackSystem.b(Unknown Source) at com.anylogic.libraries.processmodeling.RackSystem$4.updateDynamicProperties(Unknown Source) at com.anylogic.engine.presentation.Shape.updateDynamicPropertiesStructural(Unknown Source) at com.anylogic.engine.presentation.ShapeGroup.updateDynamicPropertiesStructural(Unknown Source) at com.anylogic.engine.presentation.ShapeGroup.updateDynamicPropertiesStructural(Unknown Source) at com.anylogic.engine.presentation.ShapeGroup.updateDynamicPropertiesStructural(Unknown Source) at com.anylogic.engine.presentation.ShapeEmbeddedObjectIcon.updateDynamicPropertiesStructural(Unknown Source) at com.anylogic.engine.presentation.ShapeGroup.updateDynamicPropertiesStructural(Unknown Source) at com.anylogic.engine.Presentable.k(Unknown Source) at com.anylogic.engine.Presentable.updateShapeDynamicProperties(Unknown Source) at com.anylogic.engine.gui.SVGFrameProducer.k(Unknown Source) at com.anylogic.engine.gui.ExperimentHost$1.b(Unknown Source) at com.anylogic.engine.gui.ExperimentHost$1.k(Unknown Source) at com.anylogic.engine.gui.SVGFrameCollector.b(Unknown Source) at java.base/java.lang.Thread.run(Thread.java:834)
故障来源分析
核心根因:版本迭代导致类结构不兼容
AnyLogic 8.8.2版本对com.anylogic.engine.presentation包下的ModelElementDescriptor和ModelElementDescriptorUtils类做了结构调整,但模型依赖的PyPeline库(com.anylogic.libraries.pypeline)中的PyCommunicator.doCreate方法(第2165行)仍沿用8.8.1版本的类型转换逻辑,触发ClassCastException,直接导致模型创建失败。空指针错误为连锁反应
动画渲染阶段的NullPointerException是模型创建失败的衍生问题:核心组件初始化失败后,RackSystem对象未正确实例化,动画渲染时调用reserved方法访问空对象,从而触发空指针异常,并非独立故障点。
内容的提问来源于stack exchange,提问作者jiz148
相关产品推荐
相关产品推荐

