我正在尝试从外部netbeans启动网络服务器。我确实将DERBY_INSTALL变量设置为适当的目录,然后发出setNetworkServerCP命令也可以正常工作。但是当我尝试运行startNetworkServer时,我收到以下错误。
C:\用户\ tandons> d:
D:> cd D:\ netbeans \ glassfish-v2.1 \ javadb \ bin
D:\ netbeans \ glassfish-v2.1 \ javadb \ bin> setNetworkServerCP DERBY_HOME或 DERBY_INSTALL未设置。将其中一个变量设置为 你的Derby安装。 d:\ netbeans的\与GlassFish V2.1 \ JavaDB之外\箱>设置 DERBY_INSTALL = D:\ netbeans \ glassfish-v2 .1 \ javadb
d:\ netbeans的\与GlassFish V2.1 \ JavaDB之外\ BIN> setNetworkServerCP.bat
d:\ netbeans的\与GlassFish V2.1 \ JavaDB之外\箱>设置 DERBY_INSTALL = D:\ netbeans \ GLASSF~1.1 \ j avadb
d:\ netbeans的\与GlassFish V2.1 \ JavaDB之外\箱>设置 CLASSPATH = d:\ netbeans的\与GlassFish V2.1 \Ĵ 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之外\箱>设置 DERBY_INSTALL = D:\ netbeans \ GLASSF~1.1 \ j avadb
d:\ netbeans的\与GlassFish V2.1 \ JavaDB之外\箱>设置 CLASSPATH = d:\ netbeans的\与GlassFish V2.1 \Ĵ 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 使用基本服务器安全策略安装管理器。访问 否认(" java.net.SocketPermission"" localhost:1527"" listen,resolve") java.security.AccessControlException:访问被拒绝 (" java.net.SocketPermission"" localhost:1527"" listen,resolve") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) 在java.lang.SecurityManager.checkPermission(未知来源) 在java.lang.SecurityManager.checkListen(未知来源) 在java.net.ServerSocket.bind(未知来源) 在java.net.ServerSocket。(未知来源) 在javax.net.DefaultServerSocketFactory.createServerSocket(未知的Sourc E) 在org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocke t(未知来源) at org.apache.derby.impl.drda.NetworkServerControlImpl.access $ 000(Unknow n来源) at org.apache.derby.impl.drda.NetworkServerControlImpl $ 1.run(Unknown Sou) RCE) at java.security.AccessController.doPrivileged(Native Method) 在org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unk) nown来源) at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unkno) wn来源) 在org.apache.derby.drda.NetworkServerControl.main(未知来源)
d:\ netbeans的\与GlassFish V2.1 \ JavaDB之外\ BIN>
还有一种更好的方法可以在java程序中执行此操作。我阅读了Apache网站上给出的官方文档(使用NetworkServerControl api),但我几乎没有做任何事情,因为那里..........