gpt4 book ai didi

java - 运行startNetworkServer时出错

转载 作者:行者123 更新时间:2023-12-01 12:53:44 26 4
gpt4 key购买 nike

我正在尝试从外部 netbeans 启动网络服务器。我确实将 DERBY_INSTALL 变量设置为适当的目录,然后我发出 setNetworkServerCP 命令,该命令也可以正常工作。但是当我尝试运行 startNetworkServer 时,我收到以下错误

C:\Users\tandons>D:

D:>cd D:\netbeans\glassfish-v2.1\javadb\bin

D:\netbeans\glassfish-v2.1\javadb\bin>setNetworkServerCP DERBY_HOME or DERBY_INSTALL not set. Set one of these variables to the location of your Derby installation. D:\netbeans\glassfish-v2.1\javadb\bin>set DERBY_INSTALL=D:\netbeans\glassfish-v2 .1\javadb

D:\netbeans\glassfish-v2.1\javadb\bin>setNetworkServerCP.bat

D:\netbeans\glassfish-v2.1\javadb\bin>SET DERBY_INSTALL=D:\netbeans\GLASSF~1.1\j avadb

D:\netbeans\glassfish-v2.1\javadb\bin>set CLASSPATH=D:\netbeans\glassfish-v2.1\j avadb\lib\derbynet.jar;D:\netbeans\glassfish-v2.1\javadb\lib\derbytools.jar;

D:\netbeans\glassfish-v2.1\javadb\bin>setNetworkServerCP

D:\netbeans\glassfish-v2.1\javadb\bin>SET DERBY_INSTALL=D:\netbeans\GLASSF~1.1\j avadb

D:\netbeans\glassfish-v2.1\javadb\bin>set CLASSPATH=D:\netbeans\glassfish-v2.1\j avadb\lib\derbynet.jar;D:\netbeans\glassfish-v2.1\javadb\lib\derbytools.jar;D:\n etbeans\glassfish-v2.1\javadb\lib\derbynet.jar;D:\netbeans\glassfish-v2.1\javadb \lib\derbytools.jar;

D:\netbeans\glassfish-v2.1\javadb\bin>startNetworkServer Security manager installed using the Basic server security policy. access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve") java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkListen(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket.(Unknown Source) at javax.net.DefaultServerSocketFactory.createServerSocket(Unknown Sourc e) at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocke t(Unknown Source) at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknow n Source) at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Sou rce) at java.security.AccessController.doPrivileged(Native Method) at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unk nown Source) at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unkno wn Source) at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)

D:\netbeans\glassfish-v2.1\javadb\bin>

还有更好的方法在 java 程序中执行此操作。我阅读了 Apache 网站上给出的官方文档(使用 NetworkServerControl api ),但我几乎无法从那里给出的内容中得到任何东西..............

最佳答案

这是一个已知错误。下面的链接描述了解决方法。 (谷歌是你的 friend ):

Netbeans bug report

Blog 1

Blog 2

关于java - 运行startNetworkServer时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24033401/

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