gpt4 book ai didi

mysql - Anylogic - 模型不能在浏览器模式下运行

转载 作者:行者123 更新时间:2023-11-29 23:31:33 47 4
gpt4 key购买 nike

我在 Anylogic 7 中创建了一个模型,它从我的本地主机 mysql 数据库获取一些值。当我在独立模式下导出它时它会运行,但是当我在浏览器模式下测试它时,我收到错误消息:

CacheEntry[http://XXX.XXX.XXX.XXX/supply/com.xj.anylogic.engine.jar]:       
updateAvailable=true,lastModified=Fri Oct 24 08:33:50 EEST 2014,length=1401999
CacheEntry[http://XXX.XXX.XXX.XXX/supply/model.jar]:
updateAvailable=true,lastModified=Fri Oct 24 08:33:50 EEST 2014,length=471484
0
CacheEntry[http://XXX.XXX.XXX.XXX/supply/lib/mysql-connector-java-5.1.33-bin.jar]:
updateAvailable=true,lastModified=Fri Oct 24 08:33:50 EEST 2014,length=959987
Error during model creation:
ExceptionInInitializerError
Caused by: access denied ("java.util.PropertyPermission" "file.encoding" "read")
java.lang.ExceptionInInitializerError
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:307)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.xj.anylogic.engine.connectivity.Database.a(Unknown Source)
at com.xj.anylogic.engine.connectivity.Database.getConnection(Unknown Source)
at supply_chain.Factory.instantiateBaseStructure_xjal(Factory.java:1409)
at supply_chain.Factory.<init>(Factory.java:1394)
at supply_chain.Main.instantiate_factory_xjal(Main.java:589)
at supply_chain.Main.instantiateBaseStructure_xjal(Main.java:2863)
at supply_chain.Main.<init>(Main.java:2850)
at supply_chain.Simulation.createRoot(Simulation.java:3399)
at supply_chain.Simulation.createRoot(Simulation.java:1)
at com.xj.anylogic.engine.Experiment.a(Unknown Source)
at com.xj.anylogic.engine.ExperimentSimulation.b(Unknown Source)
at com.xj.anylogic.engine.ExperimentSimulation.run(Unknown Source)
at supply_chain.Simulation.executeShapeControlAction(Simulation.java:900)
Caused by: java.security.AccessControlException: access denied
("java.util.PropertyPermission" "file.encoding" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at com.mysql.jdbc.StringUtils.<clinit>(StringUtils.java:118)
... 16 more

我不明白错误在哪里。由于JAVA安全策略而无法连接MySQL?

最佳答案

在网络小程序中使用 Anylogic 时,您会受到很大的限制。如果您查看anylogic帮助文件,Anylogic help它指出:

According to the Software License Agreement, you may not access any kind of databases or files from Simulation Applets.

所以看来你必须将数据硬编码到模型中

关于mysql - Anylogic - 模型不能在浏览器模式下运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26542496/

47 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com