0
votes

I am trying to run the Machine Learning and Anylogic Simulation example workflow provided here. - https://www.anylogic.com/features/artificial-intelligence/h2o-ai/ I can run the second workflow, but the first workflow (Hospital Planning) keeps giving errors. I have tried it running on different systems as well.

Any help will be highly appreciated.

Below is the error code :

Loading Mojo: pipeline.mojo

    Loading Mojo: pipeline.mojo
    Error during model creation:
    Unable to make protected final java.lang.Class 
    java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) 
    throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to 
    unnamed module @44f69442
    java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class 
    java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) 
    throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to 
    unnamed module @44f69442
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
    at javassist.util.proxy.SecurityActions.setAccessible(SourceFile:159)
    at javassist.util.proxy.DefineClassHelper$JavaOther.defineClass(SourceFile:213)
    at javassist.util.proxy.DefineClassHelper$Java11.defineClass(SourceFile:52)
    at javassist.util.proxy.DefineClassHelper.toClass(SourceFile:260)
    at javassist.ClassPool.toClass(SourceFile:1232)
    at javassist.ClassPool.toClass(SourceFile:1090)
    at javassist.ClassPool.toClass(SourceFile:1048)
    at javassist.CtClass.toClass(SourceFile:1290)
    at ai.h2o.mojos.runtime.c.G.d(SourceFile:118)
    at ai.h2o.mojos.runtime.c.G.a(SourceFile:60)
    at ai.h2o.mojos.runtime.c.n.a(SourceFile:64)
    at ai.h2o.mojos.runtime.readers.b.b.a(SourceFile:135)
    at ai.h2o.mojos.runtime.MojoPipelineFactoryImpl.loadFrom(SourceFile:144)
    at ai.h2o.mojos.runtime.MojoPipelineFactoryImpl.loadFrom(SourceFile:101)
    at ai.h2o.mojos.runtime.MojoPipeline.loadFrom(SourceFile:41)
    at hospital_capacity_planning_ml.Main.loadModel(Main.java:690)
    at hospital_capacity_planning_ml.Main.setupPlainVariables_Main_xjal(Main.java:1498)
    at hospital_capacity_planning_ml.Main.doCreate(Main.java:1421)
    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.a(Unknown Source)
    at com.anylogic.engine.ExperimentSimulation.run(Unknown Source)
    at com.anylogic.engine.gui.ExperimentHost.f(Unknown Source)
    at com.anylogic.engine.gui.ExperimentHost.executeCommand(Unknown Source)
    at com.anylogic.engine.internal.webserver.e.onCommand(Unknown Source)
    at com.anylogic.executor.basic.rest.BasicAnimationSessionController. 
    lambda$null$9(BasicAnimationSessionController.java:112)
    at com.anylogic.engine.internal.webserver.i.acceptToAnimationSvgSession(Unknown Source)
    at com.anylogic.executor.basic.rest.BasicAnimationSessionController. 
    lambda$startController$10(BasicAni mationSessionController.java:112)
    at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47)
    at spark.http.matching.Routes.execute(Routes.java:61)
at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:130)
at com.anylogic.engine.internal.webserver.config.ALServerFactory$1.lambda$0(Unknown Source)
at org.eclipse.jetty.servlets.QoSFilter.doFilter(QoSFilter.java:201)
at com.anylogic.engine.internal.webserver.config.ALServerFactory$1.doHandle(Unknown Source)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1568)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:530)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
atorg.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java 
:382)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
at java.base/java.lang.Thread.run(Thread.java:834)
Error during drawing animation frame:
java.lang.NullPointerException
at com.anylogic.engine.gui.SVGFrameProducer.n(Unknown Source)
at com.anylogic.engine.gui.SVGFrameProducer.n(Unknown Source)
at com.anylogic.engine.gui.ExperimentHost$1.l(Unknown Source)
at com.anylogic.engine.gui.ExperimentHost$1.n(Unknown Source)
at com.anylogic.engine.gui.SVGFrameCollector.l(Unknown Source)
at com.anylogic.engine.gui.SVGFrameCollector.c(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:834)
1

1 Answers

2
votes

The problem is that AnyLogic 8.7 switched to newer Java (from 9 to 11). Add the following line to Java machine arguments in the experiment properties to make the model work in the recent updates 8.7.x:

--add-opens java.base/java.lang=ALL-UNNAMED